SpillsConfig class final
The spills: config section (issue #678).
Tolerant parse: unknown keys and mistyped values produce notes and defaults, never a boot failure — a typo must not kill a session.
Constructors
-
SpillsConfig({bool enabled = true, int threshold = 8192, int headChars = 2000, int tailChars = 2000, int userThreshold = defaultUserSpillThresholdBytes, double userFraction = defaultUserSpillWindowFraction, List<
String> notes = const []}) -
Creates a configuration; see each field for its default.
const
- SpillsConfig.fromYaml(Object? node)
-
Parses the
spills:yaml section. Tolerant (issue #678 AC11): booleans/numbers are accepted, mistyped scalars fall back to the default with a note, unknown keys are noted and ignored, and a preview bound below spillsMinPreviewChars is clamped with a note. Thresholds below zero clamp to 0 (disabled). Never throws.factory
Properties
- enabled → bool
-
Master switch:
false= the hook is never attached, the session is byte-identical legacy (issue #678 AC1).final - hashCode → int
-
The hash code for this object.
no setterinherited
- headChars → int
-
Bounded head of the body in the preview (chars).
final
- isActive → bool
-
Whether spilling can ever fire: the kill-switch and the zero
threshold both mean legacy behavior.
no setter
- isUserActive → bool
-
Whether USER-message spilling can fire (issue #1760): the section
kill-switch plus the user path's own zero floor. Orthogonal to
isActive —
threshold: 0silences tool results only.no setter -
notes
→ List<
String> -
Tolerant-parse notes (unknown keys, clamped values) surfaced at boot.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tailChars → int
-
Bounded tail of the body in the preview (chars).
final
- threshold → int
-
Tool results whose text length (UTF-16 code units) exceeds this many
characters spill.
0= disabled (byte-identical legacy, AC1).final - userFraction → double
-
The fraction of the live window budget (effective context window minus
the compaction reserve) ONE user message's token estimate may carry
before it spills (issue #1760) — the relative half of the threshold.
final
- userThreshold → int
-
Absolute byte floor for the user-message path (issue #1760): a user
message never spills below this many UTF-8 bytes, whatever the window
math says.
0= the user path is disabled. Tuned by userSpillThresholdEnvVar for one run.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toYaml(
) → String -
The
spills:yaml section, only the non-default values — the file stays minimal (defaults are never written). Empty at the defaults, so CliConfig.toYaml embeds it only when explicitly configured (gh-1572: the section used to be unrenderable and silently dropped by every save).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited