Skip to main content

Module output_spooler

Module output_spooler 

Source
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:

  1. Write the full output to .vtcode/context/tool_outputs/{tool}_{timestamp}.txt
  2. Return a file reference to the agent
  3. Agent can use unified_file with offset/limit or unified_search to explore

This is more token-efficient as only necessary data is pulled into context.

Structs§

SpoolResult
Result of spooling a tool output
SpoolerConfig
Configuration for the output spooler
ToolOutputSpooler
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_threshold so invalid workspace config falls back to the same runtime behavior.

Traits§

SpoolableOutput
Extension trait for integrating spooler with tool results