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 via unified_file or search it with unified_search 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
- Agent can use
unified_filewith offset/limit orunified_searchto explore
This is more token-efficient as only necessary data is pulled into context.
Structs§
- Spool
Result - Result of spooling a tool output
- Spooler
Config - Configuration for the output spooler
- Tool
Output Spooler - Tool Output Spooler for writing large outputs to files
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