Expand description
Tool Output Spooler for Dynamic Context Discovery
Implements Cursor-style dynamic context discovery by writing large tool outputs to files instead of truncating them. This allows agents to retrieve the full output with bounded shell inspection or a focused source query when needed.
§Design Philosophy
Instead of truncating large tool responses (which loses data), we:
- Write the full output to
.vtcode/context/tool_outputs/{tool}_{timestamp}.txt - Return a file reference to the agent
- The agent can inspect the file with bounded
exec_commandreads
This is more token-efficient as only necessary data is pulled into context.
Structs§
- Spool
Result - Result of spooling a tool output
- Spooled
Output Reference - Validated view of the bounded model-facing portion of a spooled result.
- Spooler
Config - Configuration for the output spooler
- Tool
Output Spooler - Tool Output Spooler for writing large outputs to files
Enums§
Constants§
- DEFAULT_
SPOOL_ THRESHOLD_ BYTES - Default threshold for spooling tool output to files (8KB).
Keep this aligned with
DynamicContextConfig::default().tool_output_thresholdso invalid workspace config falls back to the same runtime behavior.
Traits§
- Spoolable
Output - Extension trait for integrating spooler with tool results