Skip to main content

compress_tool_result

Function compress_tool_result 

Source
pub fn compress_tool_result(content: &str, tool_name: Option<&str>) -> String
Expand description

Proxy compression funnel: routes a tool result to the right compressor.

  1. Already-cited research output (from ctx_url_read / the web layer) is kept verbatim — it is distilled and citation-stamped, so the shell pipeline must not touch its footer or claim markers.
  2. Prose results (web fetches, doc reads, research MCP bridges) are squeezed by the prose-aware research compressor instead of the log/code-tuned shell engine.
  3. Everything else (shell/build/search output) flows through the unified compress_if_beneficial pipeline. A $ ... command hint is extracted so the pattern engine gets the same routing as the CLI and MCP paths.