Harden review parsing and background monitor status#3
Open
BoldNewMedia wants to merge 2 commits into
Open
Conversation
Use claude agents --json when monitoring background jobs so non-TTY Codex sessions can read lifecycle state and mark completed sessions done. Also tolerate Claude JSON envelopes whose result string begins with Claude tool-call markup before the review JSON. Direct review payload validation remains strict so arbitrary leading prose is still rejected. Tests cover agents JSON completion and tool-call-prefixed review output.
Handle Claude JSON envelopes whose result begins with status prose before the requested review JSON. The direct review payload validator remains strict; this recovery is limited to Claude CLI envelope results. Adds a regression test for a result beginning with 'Now I have enough context to review.'
Author
|
Follow-up pushed in That happens when the Claude CLI JSON envelope is valid, but its Re-verified:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claude agents --jsoninstead of the TTY-orientedclaude agentsoutput.state: done.resultbegins with<function_calls>...</function_calls>before the review JSON.Why
In non-interactive Codex sessions,
claude agentscan fail with a TTY error whileclaude agents --jsonworks. Also, Claude can return a successful JSON envelope whoseresultstring includes tool-call markup before the requested review JSON, which currently causes strict parsing to fail despite the review findings being present.Verification
node --test tests/runtime.test.mjs→ 19/19 passnode --test tests/commands.test.mjs→ 26/26 passnode --test tests/*.test.mjs→ 45/45 passnode tests/validate-plugin.mjs→plugin metadata okgit diff --check→ clean