Skip to content

fix: preserve interrupted Codex MCP traces and submitted input - #339

Open
seyoung4503 wants to merge 1 commit into
experiment/mcp-integrated-correctnessfrom
fix/codex-interrupted-traces
Open

seyoung4503 wants to merge 1 commit into
experiment/mcp-integrated-correctnessfrom
fix/codex-interrupted-traces

Conversation

@seyoung4503

Copy link
Copy Markdown
Collaborator

A Codex timeout previously preserved raw events but skipped extraction of MCP calls, partial answers, CLI status and event hashes into the per-case record. This made interrupted failures difficult to compare with completed attempts. Preserve those fields after stopping the process, including complete events preceding a truncated JSON line. Log malformed lines and retain their line numbers without rewriting raw evidence; malformed streams and timeouts remain failed predictions.

Save the exact UTF-8 request bytes submitted on stdin and their SHA256 before spawning Codex. This captures the submitted question/schema/documentation, not the CLI's hidden system context. No prompt text, production tool behavior, model, official evaluator or historical grade changes. The current integrated 78-case experiment had no timeouts: this is a reproducible trace completeness fix, not its semantic-error explanation or an accuracy improvement claim. Historical missing inputs are not fabricated.

Validation: two new end-to-end runner tests failed before the change (missing normal input artifact; missing timeout MCP calls). With the fix, normal completion and timeout preserve exact submitted bytes, hashes, calls and exit status. Additional tests cover a truncated event tail and a process that never started. Root tests: 295 passed, 1 skipped. Ruff and diff check passed. No CODE MAP generator exists in this repository. No merge.

Reuses digest, write_json, the existing runner/process lifecycle and provenance validator. One trace-capture helper consolidates success/failure extraction; +132 net lines including tests/docs.

Principle Result Evidence
Reuse O Existing runner/digest/writer; one capture concept
Cause scope O Missing interrupted trace and exact input only
Logging O Case ID + input hash at start; malformed line + exception; existing final status
Error handling O Timeouts remain failures; malformed data warned and cannot qualify
Environment injection N/A No environment setting added
Issue comments O No issue numbers in code comments
Validation O 295 passed/1 skipped; Ruff/diff; before-fix reproduction
Authorization O PR only, no merge
Call path O runner -> Codex stdin/events -> capture -> existing SQL provenance/scoring
Sync/async O One async process lifecycle; same small local-file reads/writes as existing runner; no duplicate worker
Constants/deployment N/A No timeout/default or deployment parameter change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant