ork's "compress MCP outputs" hook (#2264) was dead for two independent reasons โ both invisible to the unit tests, both caught by testing on a real MCP call. Toggle through the states and watch the pipeline.
The pipeline โ a 30,005-char MCP result trying to reach the model
The two bugs (independent โ fixing one didn't fix the other)
updatedMCPToolOutput โ a deprecated field CC silently ignores (verified 0 live transforms). Fix: emit updatedToolOutput, the current field that works for all tools.
tool_output ?? tool_result โ but CC delivers it in tool_response. So the hook got undefined, found nothing to transform, and exited silently. Fix: read tool_response first.
tool_output (what the hook read), not tool_response (what CC sends) โ they validated the wrong contract and passed all along. The bug only surfaced on a real MCP call. Added 3 regression tests on the real field (64 pass).
Verified live on CC 2.1.183: a real 30,005-char MCP result โ 1,954 chars (โ94%), reversible (a Read <stash> pointer recovers the 28,205-char middle; stash confirmed to hold the full original). Fires PRE-cache, so no cache-bust.