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 with bounded shell inspection or a focused source query 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. The agent can inspect the file with bounded exec_command reads

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

Structs§

SpoolResult
Result of spooling a tool output
SpooledOutputReference
Validated view of the bounded model-facing portion of a spooled result.
SpoolerConfig
Configuration for the output spooler
ToolOutputSpooler
Tool Output Spooler for writing large outputs to files

Enums§

SpoolState

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