Bound large exec output while preserving searchable artifacts
Summary
Large shell/unified-exec outputs can currently become very large model-visible and UI-visible payloads. This can bloat the agent context, make transcript rendering expensive, and obscure the useful part of the result.
I would like to propose bounding the inline command output while preserving the full output as a local artifact path that the agent can inspect with normal lexical tools such as rg, sed, or tail.
Proposed behavior
- Keep small command outputs inline as today.
- When command output exceeds a configurable threshold, write the full output to a temp artifact file.
- Return a bounded preview plus metadata that includes the saved file path, byte count, approximate token count, and suggested inspection commands.
- Ensure telemetry/log previews do not create spill artifacts.
- Ensure app-server/TUI command transcript display prefers bounded formatted output when it exists, rather than loading the raw full output.
Why this helps
This keeps model-visible context bounded without losing access to the complete command result. It also protects TUI transcript rendering from very large command cells while keeping the full output available for follow-up searches.
Validation from prototype
A prototype branch adds config, core spill handling, unified exec wiring, app-server display handling, and tests for the spill paths. Targeted spill tests pass locally, and app-server-protocol tests pass locally.
I understand external code contributions are by invitation only; opening this issue first to see whether the approach aligns with the maintainers' intended direction.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗