Repository navigation
Conversation
Greptile SummaryThis PR fixes a parser gap in Changes:
No critical issues found. The priority logic ( Confidence Score: 4/5
Reviews (1): Last reviewed commit: "fix cli jsonl final-answer selection" | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66ec7ae94d
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
66ec7ae to
d4e5b0e
Compare
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #59920 |
|
Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 5:02 PM ET / 21:02 UTC. Summary PR surface: Source +87, Tests +387. Total +474 across 2 files. Reproducibility: yes. from source: current main and Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch against current main, preserve the newer stream-json safeguards, and land the parser precedence fix if maintainers accept terminal-field reply precedence for CLI JSONL fallback delivery. Do we have a high-confidence way to reproduce the issue? Yes from source: current main and Is this the best way to solve the issue? Yes for the narrow parser bug, with a compatibility caveat; the shared CLI JSONL parser is the right boundary, while dispatch, channel delivery, or Codex output-artifact changes would not fix existing JSONL stream precedence as directly. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 010b61746379. Label changesLabel justifications:
Evidence reviewedPR surface: Source +87, Tests +387. Total +474 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
d4e5b0e to
122619f
Compare
122619f to
8b90301
Compare
|
Updated branch, rebased on Addressed the ClawSweeper P2 streaming-path finding:
Added streaming regression coverage for commentary + generic item + Validation after rebase: Redacted real Codex CLI JSONL smoke proof from the installed CLI on this machine: The live CLI smoke confirms the JSONL runner path is exercised locally; the new regression covers the terminal-field priority shape from the review ( @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Updated the PR body with the required @clawsweeper re-review |
8b90301 to
5a48b4f
Compare
69374ce to
4dec47a
Compare
|
Clownfish 🐠 reef update Thanks for the contribution here. Clownfish nudged this branch back into the current, so the original PR can stay the review lane. Source PR: #59920 fish notes: model gpt-5.5, reasoning medium; reviewed against acd4812. |
4dec47a to
acd4812
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: [codex] prefer terminal reply fields in CLI JSONL parser This is item 1/1 in the current shard. Shard 0/4. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Closing due to inactivity. |
## Summary
type:"result"events and otherwise falls back to generic text collection, so OpenAI/Codex-style fallback runs can lose terminal reply semantics.phase:"final_answer"andtask_complete.last_agent_message.parseCliJsonl()now preferstask_complete.last_agent_message, then assistant messages taggedphase:"final_answer", and skipscommentary-phase generic item text.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
parseCliJsonl()was written around Claudetype:"result"lines plus a genericparsed.item.textfallback, but it did not understand newer OpenAI/Codex-style JSONL terminal fields.task_complete.last_agent_messageorphase:"final_answer", and no guard against treatingcommentaryitem text as the outbound reply.git blame, prior PR, issue, or refactor if known): the current behavior is discussed in [Bug]: CLI JSONL fallback parser drops final-answer semantics and can surface commentary instead #59918 as a narrower parser-path issue adjacent to the broader channel-leak family in Text between tool calls leaks to messaging channels #25592.Regression Test Plan (if applicable)
src/agents/cli-output.test.tsfinal_answer, andtask_complete, the parser returns the terminal answer; when onlyfinal_answeris present, it wins over commentary text.src/agents/cli-output.test.tscover the Claude-specific path and remain unchanged.User-visible / Behavior Changes
Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
output: "jsonl"Steps
parseCliJsonl()a JSONL stream containing commentary events plus a terminaltask_complete.last_agent_message.parseCliJsonl()a JSONL stream containing commentary plus assistantphase:"final_answer"content.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
pnpm exec vitest run src/agents/cli-output.test.ts src/agents/cli-backends.test.tstask_completeoutranksfinal_answer;final_answeroutranks commentary; commentaryitem.textis ignored.Real behavior proof
Behavior or issue addressed: OpenAI/Codex-style CLI JSONL output is now parsed so terminal reply records win over commentary or intermediate message text in both the full-buffer parser and streaming parser.
Real environment tested: Windows/PowerShell checkout at PR head
8b90301ef3; installed OpenAI Codex CLIcodex-cli 0.130.0-alpha.5; Nodev24.13.1; OpenClaw parser entry points imported directly fromsrc/agents/cli-output.ts.Exact steps or command run after this patch:
Evidence after fix:
Observed result after fix: The installed Codex CLI produced JSONL on this machine and both OpenClaw parser paths extracted the final agent message from that transcript. For the bot-cited terminal-field shape, both parser paths returned
TASK_COMPLETE_WINS;COMMENTARY_SHOULD_NOT_WINand the lower-priorityFINAL_ANSWER_SHOULD_BE_OVERRIDDENwere not surfaced.What was not tested: A live WhatsApp/Telegram delivery route was not exercised for this parser-only PR.
Review Conversations
Compatibility / Migration
Risks and Mitigations
item.textas the only final output.commentaryphase text and prefers explicit terminal fields; generic non-commentaryitem.textfallback remains intact.