Skip to main content

Module output_limit

Module output_limit 

Source
Expand description

Configurable output size limits for agent safety.

When output exceeds the threshold, the full output is written to a spill file on the real filesystem and ExecResult.out is truncated with a pointer message. The agent can then selectively read the file.

Per-mode defaults: MCP kernels get an 8KB limit, REPL/test kernels are unlimited. Runtime-switchable via the kaish-output-limit builtin.

Structs§

OutputLimitConfig
Configurable output size limit.
SpillResult
Result of a spill operation.

Functions§

parse_size
Parse a size string with optional K/M suffix into bytes.
spill_aware_collect
Collect stdout from a child process with spill-aware size limiting.
spill_if_needed
Check if the result output exceeds the limit and spill to disk if so.