Fix false approvals when adversarial review turns fail#465
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab9a971c30
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| parseError: | ||
| fallback.failureMessage ?? | ||
| `Codex run failed with status ${fallback.status} before returning a final structured message.`, | ||
| rawOutput: rawOutput ?? "", |
There was a problem hiding this comment.
Clear discarded review text from JSON payloads
When a failed adversarial turn first emits a schema-valid progress message and the caller uses adversarial-review --json or reads the stored JSON result, this new failure path still exposes that discarded message as rawOutput (and executeReviewRun also serializes the same finalMessage as codex.stdout). In that context stdout for the failed command can still contain "verdict":"approve", so machine consumers that read the raw final-output fields can continue to record a false approval even though the rendered output hides it. Clear these raw-output fields on nonzero statuses or move the interim text to a diagnostic-only field.
Useful? React with 👍 / 👎.
Summary
approvefollowed by a failed turnReproduction
A real adversarial review emitted schema-valid progress messages with
verdict: approve, then failed withNo tool output found for custom tool call .... The companion marked the job failed internally but parsed and rendered the last progress message as an approval.Verification
npm run buildnpm run check-versionclaude plugin validate plugins/codexnode --test --test-reporter=dot tests/*.test.mjsneeds-attentionwith six findings