Repository navigation
Keep noisy test output out of Codex context while retaining exact evidence #64414
vamsiramakrishnan
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I maintain Straitjacket, an Apache-2.0 CLI and MCP sidecar for coding agents. Here is one way to keep a long test result from occupying the rest of a coding session while keeping the underlying evidence available.
Capture once, retrieve the part you need
With Python 3.11+, in a repository that has a pytest suite:
python -m pip install 'ctx-harness==0.5.0' ctx run -- python -m pytest -qFor a large result,
ctxstores the captured output locally and returns a bounded digest with a retrieval address. Copy the handle from your run, search it, then open the line range you need:Replace both the handle and example line range; use
#stderrif the diagnostic went there. A failed test command remains a failure in the digest;ctx runcan return exit 3.What this changes
The next model request can carry the digest and selected evidence instead of the complete log. That reduces the contribution of tool output to context growth. It does not change Codex's compaction threshold, remove material already in history, or guarantee a provider cache hit.
The committed November 23 replay uses a 20,001-line log with 302,628 raw o200k_base tokens and a 531-token canonical digest. I reran the offline evaluation on November 28 at commit a693a54. The three actual digest counts were 534, 531, and 540 tokens; all three canonical counts were 531. Run handles account for the tokenization difference. The run verified the quiet anomaly, stored bytes, and exact retrieval of an omitted control line, with zero provider requests.
You can reproduce it from a Straitjacket checkout with
python evals/cache_ab.py offline --out NEW_DIRECTORYafter installing.[dev]andtiktoken==0.11.0.Boundaries worth checking
For exploration, open a known definition directly or bundle source and caller information once you know what you need. Replacing text search indiscriminately with symbol search can lose matches in logs, comments, or documentation.
The useful failure report is a sanitized command/output pair where a digest hid a needed clue, or where retrieval added more work than it saved. Host capabilities and current validation limits.
All reactions