Repository navigation
Keep malformed reviewer output in a private diagnostic file - #1749
Conversation
Architecture-Review: unchanged; the command data flow and delivery roles still apply. Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 3d561478ec231897aa8ed20c4658409e75b545c4, 50.7s: request_changes (0 critical, 1 important, 2 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Findings without a file location:
- suggestion: Claude schema failures save the envelope tail, not the rejected result — Codex now passes
excerpt=message, but Claude still callsparse_review(..., raw=raw). For Claude the diagnostic is the last 2000 characters of the whole result envelope. The envelope ends with usage, modelUsage and cost metadata, so the saved excerpt may hold little or none of the rejected review. To make the file useful for both reviewers, pass the decoded result text (e.g.str(envelope.get('result', '')), or the structured output) asexcerpt.
Native Claude output is retained in the restricted local review receipt.
| provenance, raw = _codex_provenance(done.stdout, done.stderr, message, home=home) | ||
| if not message.strip(): | ||
| raise RunnerBadOutput("codex: no final message written", _tail(done.stdout + done.stderr)) | ||
| raise RunnerMalformedOutput("codex: no final message written", _tail(done.stdout + done.stderr)) |
There was a problem hiding this comment.
suggestion: Reclassifying runtime-output failures as malformed moves their runtime diagnostics off the terminal
codex: no final message written (line 1280) and codex: execution output lacks session/token provenance (line 1087) now raise RunnerMalformedOutput. Their tail is Codex stdout+stderr, which is runtime output such as stream or API errors on an exit-0 run. It is not a rejected review payload. With this change _review_failure cuts these to one line, and their stderr tail goes only to the private file. The task says runtime diagnostics should keep their existing output. Consider keeping these two as plain RunnerBadOutput, and limiting RunnerMalformedOutput to cases where the tail is the model's payload: not JSON, schema failures, and not UTF-8.
Architecture-Review: unchanged; cleanup still permits only task-owned artifacts and refuses symlinks. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on ff1d23d7e7b6885a6071e63f86b48836d4f5417b, 21.0s: approve (0 critical, 0 important, 1 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| payload = _claude_payload(envelope) | ||
| except (json.JSONDecodeError, ValueError) as exc: | ||
| raise RunnerBadOutput("claude: result text is not JSON", _tail(raw)) from exc | ||
| raise RunnerMalformedOutput("claude: result text is not JSON", _tail(str(envelope.get("result", "")))) from exc |
There was a problem hiding this comment.
suggestion: No tests cover the reclassified Claude/Codex errors or the narrowed Claude excerpt
This delta makes three behaviour changes that no test checks. (1) Missing Claude/Codex provenance and an empty Codex final message now raise RunnerBadOutput instead of RunnerMalformedOutput. That changes cli.py:1098/1124: the terminal now shows three lines including the tail, and no fragment is saved to the diagnostic file. (2) 'claude: result text is not JSON' now uses the envelope's result text instead of the whole stdout. (3) Claude schema failures now pass excerpt=json.dumps(payload). A search of tests/ finds none of these messages, so a regression that puts the provenance failures back into the malformed bucket (or the reverse) would go unnoticed. Smallest fix: add one parametrized runner test that checks the exception type and .tail for each of these four raise sites, plus a Claude schema-failure test that checks the payload excerpt is saved.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Keep malformed reviewer output in a private diagnostic file
Context and goal
Closes #1087
Acceptance
Transcript size
The baseline is
234ac2e0. Focused CLI and runner tests passed, including an unwritable diagnostic and the native Codex fixture with malformed review JSON.Notes
Base
Base: aa563c2
Replaces #1289.
Validation
Recorded for
ff1d23d7e7b6uv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review