Skip to content

fix(codex): preserve authoritative turn completion and final output - #117185

Merged
vincentkoc merged 1 commit into
mainfrom
codex/qa400-anthropic-codex
Aug 1, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
codex/qa400-anthropic-codex

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

fix(codex): preserve authoritative conversation outcomes

What Problem This Solves

The Codex conversation-turn collector had five owner-boundary failures:

  1. turn/completed with status: "interrupted" could resolve successfully with partial assistant output.
  2. Completed phase: "commentary" messages could replace or impersonate the final answer.
  3. More than 100 notifications arriving before the turn/start response could evict the terminal notification and leave a finished turn timing out.
  4. A saturated delta buffer could evict the commentary completion, retain its deltas, and misreport progress as the answer.
  5. A buffer containing 100 commentary completions could discard the following authoritative final or legacy-unphased completion, then resolve an empty terminal summary with no reply.

These failures are shipped in v2026.7.2-beta.1 through .5.

Canonical Fix

The collector owns correlation of native Codex lifecycle notifications into one OpenClaw reply. This rewrite:

  • preserves the timeout and interruption lifecycle semantics from fix(inference): harden Codex streaming, cancellation, and live QA #116012
  • ranks bounded pre-start events as transient, commentary, final/legacy-unphased, then terminal
  • lets newer final completions replace older final completions so the last answer remains authoritative
  • excludes explicit commentary while preserving legacy unphased assistant completions
  • lets only status: "completed" terminal items supersede streamed completions
  • rejects failed, interrupted, and invalid non-terminal outcomes
  • removes duplicate turn-correlation and assistant-order bookkeeping

Production delta: +46/-46 (net zero). Tests: +348/-0.

Enlarging or unbounding the buffer would only defer the failure. Relying exclusively on terminal items would regress Codex 0.144.x and 0.145.0, whose completed turns could carry an empty terminal item list. A downstream conversation-binding guard would repair the wrong owner.

Direct Upstream Codex Contract Inspection

Maintainer reviewers personally inspected sibling ../codex at the rust-v0.146.0 dereferenced commit e363b08c9175ac1cbe5893615dd2cb9ddf95043b (annotated tag object be449751a978f02e5bbba886999662956c7f38f5) and the terminal-summary producer change 80f3c3141e4dd421c861408a87703bad0cb09874:

The same phase and terminal contracts were checked at shipped Codex tags 0.144.4 and 0.145.0.

Exact-Head Native Stdio Proof

The real authenticated repository-pinned codex-cli 0.146.0 app-server was run over native stdio against signed PR head ff523ac316965f04f86fa9df35161428b7267a1a. It used an ephemeral thread, approvalPolicy: "never", and a read-only sandbox.

The successful flow required exactly OPENCLAW_QA_NATIVE_FINAL. The interrupt flow waited for a real commandExecution running sleep 30, then sent turn/interrupt. This is the complete redacted proof output; it contains no paths, thread/item identifiers, accounts, endpoints, or credentials:

{
  "head": "ff523ac316965f04f86fa9df35161428b7267a1a",
  "binary": "codex-cli 0.146.0",
  "transport": "stdio",
  "successfulFinal": {
    "turnIdPresent": true,
    "phases": ["final_answer"],
    "exactFinalSeen": true,
    "terminal": {
      "status": "completed",
      "itemPhases": ["final_answer"]
    },
    "collectorReply": "OPENCLAW_QA_NATIVE_FINAL"
  },
  "interruptedTurn": {
    "turnIdPresent": true,
    "terminal": {
      "status": "interrupted",
      "itemPhases": []
    },
    "collectorError": "codex app-server turn interrupted"
  }
}

A separate stock-native saturation probe requested a deterministic 200-line answer. Across four authenticated codex-cli 0.146.0 trials, each turn emitted 1,016 notifications, including 999 agent-message deltas, and returned the complete first and last lines. All four observed zero notifications before the turn/start response. That proves the real producer can exceed the collector cap, but stock Codex exposes no deterministic control that forces provider output before the much shorter start response. The exact saturated pre-response ordering therefore remains covered by the production-handler binding replay rather than a patched or proxied binary.

Validation

  • collector tests: 23/23
  • conversation-binding tests: 47/47
  • exact-head binding replay: 1/1
    • registers the production notification handler
    • emits 100 commentary completions, one legacy-unphased final completion, and an empty completed terminal before mocked turn/start returns
    • proves the delivered reply is authoritative answer only after setTurnId replays the buffered stream
  • formatting and git diff --check: clean
  • full-branch P0/P1 autoreview: no findings, confidence 0.91
  • independent owner/caller/sibling review: clean
  • TruffleHog: clean
  • exact-head GitHub CI: green (openclaw/ci-gate, real-behavior proof, and all applicable checks): 30689051957
  • canonical changed gate: infrastructure blocked before tests
    • Blacksmith scheduler initially returned HTTP 429
    • AWS hydration failed because typescript was absent during repository postinstall
    • Blacksmith full sync timed out, then workflow dispatch returned HTTP 500
    • affected Blacksmith run: 30688153879

User Impact

Successful conversations return the authoritative final answer. Cancelled or invalid conversations fail visibly. Commentary cannot impersonate an answer, a saturated pre-start stream cannot hide terminal completion, and a full commentary buffer cannot discard the following final answer. No authentication, configuration, persistence, public SDK, protocol, snapshot, or reasoning-projection files change.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 3:27 AM ET / 07:27 UTC.

ClawSweeper review

What this changes

The PR changes the Codex conversation-turn collector so terminal and final assistant-completion facts survive a saturated pre-turn/start buffer, while commentary and interrupted outcomes cannot become the delivered reply.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 6 items remain

Keep this PR open for explicit maintainer handling. The collector repair is still necessary—current main does not contain the PR head—but the required direct upstream Codex source check cannot be completed because the mandated sibling ../codex checkout is absent and network DNS prevented obtaining it; under repository policy, that blocks a Codex merge or proof-sufficient verdict.

Priority: P1
Reviewed head: ff523ac316965f04f86fa9df35161428b7267a1a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation and focused regression coverage are coherent, but the hard upstream-contract verification gate remains unresolved.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The PR body contains redacted native stdio terminal output and an exact-head production-handler replay, but this reviewer cannot mark the proof sufficient because the repository requires a personal direct check of sibling ../codex producer source and that checkout is unavailable here. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR body contains redacted native stdio terminal output and an exact-head production-handler replay, but this reviewer cannot mark the proof sufficient because the repository requires a personal direct check of sibling ../codex producer source and that checkout is unavailable here. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current main does not contain this repair: The PR head is not an ancestor of the checked-out current main, and the collector differs between them; the current path still has the older bounded FIFO behavior rather than this branch's semantic retention logic.
Branch repairs the collector owner boundary: The proposed collector assigns retention priority to terminal, final or legacy assistant completion, commentary completion, and transient events; it rejects interrupted, failed, and invalid terminal statuses before resolving a reply.
Caller establishes the pre-start race boundary: Conversation binding registers the notification handler before requesting turn/start, then sets the collector turn ID only after the response; this is the correct local owner for buffering early notifications.
Findings None None.
Security None None.

How this fits together

The Codex extension receives native app-server notifications while turn/start is still resolving, buffers them by turn, and then correlates them with the returned turn ID. The collector selects one authoritative assistant reply or a visible terminal error for the conversation-binding layer to deliver.

flowchart LR
  A[Codex app-server] --> B[Lifecycle notifications]
  B --> C[Pre-start turn buffer]
  D[turn/start response] --> E[Turn ID correlation]
  C --> E
  E --> F[Phase and terminal selection]
  F --> G[OpenClaw reply]
  F --> H[Visible turn error]
Loading

Decision needed

Question Recommendation
Can a maintainer who can inspect the required sibling Codex source confirm that the pinned producer contract treats only completed final or legacy-unphased assistant messages as authoritative and permits notifications before turn/start returns? Verify the pinned upstream contract and land: Inspect the cited Codex producer revision locally, then accept this focused collector repair if its terminal and phase behavior matches the source.

Why: The repository’s Codex-specific policy explicitly prohibits a merge or proof-sufficient verdict without the acting reviewer personally inspecting the upstream source, and this read-only environment cannot satisfy that prerequisite.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR body contains redacted native stdio terminal output and an exact-head production-handler replay, but this reviewer cannot mark the proof sufficient because the repository requires a personal direct check of sibling ../codex producer source and that checkout is unavailable here. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The branch changes the source of truth for Codex final reply selection, so an unverified misunderstanding of upstream phase or terminal semantics could still suppress a valid legacy reply or surface an incorrect error.
  • Resolve merge risk (P1) - The required sibling ../codex checkout is unavailable and network DNS prevented obtaining it; repository policy therefore blocks a proof-sufficient or merge recommendation despite the submitted native and replay evidence.
  • Resolve merge risk (P1) - This PR carries the protected maintainer label, so automated cleanup or closure is not appropriate.
  • Complete next step (P2) - A concrete repair is already present; the remaining blocker is the repository-required maintainer dependency-contract check, not an automated code change.
Agent review details

Security

None.

PR surface

Source 0, Tests +348. Total +348 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 46 46 0
Tests 2 348 0 +348
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 394 46 +348

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Complete the upstream contract check (recommended)
    Before merge, inspect the pinned Codex source locally and confirm the collector's final, legacy-unphased, commentary, interruption, and pre-start ordering assumptions.
  2. Pause until source verification is available
    Do not merge from this review environment if the required sibling Codex checkout cannot be restored, because delivery and timeout behavior depend on that contract.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Inspect the pinned Codex producer source for turn terminal status, agent-message phase, and turn/start ordering; retain or adjust collector tests to the verified contract.

Technical review

Best possible solution:

Have a maintainer with the required upstream Codex checkout verify the exact turn/completed, assistant-message phase, and pre-response ordering contracts against the pinned producer revision; if they match the documented behavior, retain this focused collector repair and its binding-seam regression coverage.

Do we have a high-confidence way to reproduce the issue?

Yes, from current source: the main collector stops retaining notifications after 100 pre-start events, while conversation binding registers its handler before turn/start returns. The exact live Codex ordering was not executed in this read-only environment, but the source path and the branch's focused handler replay make the reported loss mechanism reproducible at the owner boundary.

Is this the best way to solve the issue?

Unclear pending the mandated upstream source check. Repairing the collector is the narrow owner-boundary approach shown by the caller flow, but the exact phase and terminal rules must be confirmed directly against Codex before calling this the best fix.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7aacd1314d71.

Labels

Label justifications:

  • P1: The PR addresses a user-visible Codex conversation failure where a finished turn can return the wrong response or wait until timeout.
  • merge-risk: 🚨 message-delivery: The collector determines which assistant completion becomes the response delivered to the user.
  • merge-risk: 🚨 availability: Its bounded pre-start retention logic determines whether a completed turn settles or remains waiting for terminal state.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body contains redacted native stdio terminal output and an exact-head production-handler replay, but this reviewer cannot mark the proof sufficient because the repository requires a personal direct check of sibling ../codex producer source and that checkout is unavailable here. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current main does not contain this repair: The PR head is not an ancestor of the checked-out current main, and the collector differs between them; the current path still has the older bounded FIFO behavior rather than this branch's semantic retention logic. (extensions/codex/src/conversation-turn-collector.ts:68, 7aacd1314d71)
  • Branch repairs the collector owner boundary: The proposed collector assigns retention priority to terminal, final or legacy assistant completion, commentary completion, and transient events; it rejects interrupted, failed, and invalid terminal statuses before resolving a reply. (extensions/codex/src/conversation-turn-collector.ts:63, ff523ac31696)
  • Caller establishes the pre-start race boundary: Conversation binding registers the notification handler before requesting turn/start, then sets the collector turn ID only after the response; this is the correct local owner for buffering early notifications. (extensions/codex/src/conversation-binding.ts:838, 7aacd1314d71)
  • Focused regression coverage targets the reported sequence: The branch adds collector and binding coverage for 100 commentary completions followed by an unphased authoritative completion and an empty completed terminal before the start response returns. (extensions/codex/src/conversation-binding.test.ts:2144, ff523ac31696)
  • Related lifecycle provenance: The current collector path appears to date to the merged Codex lifecycle repair, which is the relevant prior work cited by this PR; this branch adds a distinct bounded-buffer and completion-authority repair. (extensions/codex/src/conversation-turn-collector.ts:16, cb16d739cfda)
  • Required upstream dependency check is unavailable: Repository policy requires the acting reviewer to inspect sibling ../codex source before a Codex verdict. That checkout is absent, and attempted history retrieval could not resolve github.com, so the reported phase and terminal contracts cannot be independently verified here.

Likely related people:

  • steipete: The related merged Codex lifecycle repair is attributed to Peter Steinberger and provides the current main baseline for this collector path. (role: feature-history owner; confidence: high; commits: cb16d739cfda; files: extensions/codex/src/conversation-turn-collector.ts, extensions/codex/src/conversation-binding.ts)
  • vincentkoc: Authored the signed current PR head and the focused collector rewrite under review. (role: recent area contributor; confidence: high; commits: ff523ac31696; files: extensions/codex/src/conversation-turn-collector.ts, extensions/codex/src/conversation-turn-collector.test.ts, extensions/codex/src/conversation-binding.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Restore or provide access to the required sibling Codex checkout and verify the pinned terminal, phase, and pre-response notification producer paths.
  • After that source check, refresh the proof assessment against the exact PR head; preserve the redaction of runtime identifiers and credentials.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-01T03:55:42.791Z sha 078361d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T04:00:32.779Z sha 078361d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T04:17:17.930Z sha 078361d :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T06:04:16.616Z sha bbc88aec8394b7a290fb1567ca5c51d85e3ec0aa :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T06:40:04.586Z sha bbc88aec8394b7a290fb1567ca5c51d85e3ec0aa :: needs real behavior proof before merge. :: [P1] Evict commentary before dropping the final completion
  • reviewed 2026-08-01T06:58:15.845Z sha ffd1999b85f66f14d39b111967b3992f2a93ba41 :: needs real behavior proof before merge. :: [P1] Prove the saturated pre-start path through the native seam
  • reviewed 2026-08-01T07:11:33.017Z sha ff523ac :: needs real behavior proof before merge. :: [P1] Capture the saturated pre-start race through native Codex
  • reviewed 2026-08-01T07:21:48.248Z sha ff523ac :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 1, 2026
@vincentkoc vincentkoc self-assigned this Aug 1, 2026
@vincentkoc
vincentkoc force-pushed the codex/qa400-anthropic-codex branch from 078361d to bbc88ae Compare August 1, 2026 05:58
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer rewrite pushed at bbc88aec8394b7a290fb1567ca5c51d85e3ec0aa (signed).

Root cause: the collector buffered the first 100 pre-turn/start notifications indiscriminately, so deltas/tool events could evict the terminal fact; it also treated commentary and partial streamed text as candidate replies. The collector is the architectural owner because it alone correlates Codex lifecycle notifications into one authoritative OpenClaw reply.

Canonical fix:

  • preserve bounded-buffer turn/completed and assistant item/completed facts under pressure
  • exclude explicit commentary while preserving legacy unphased assistant completions
  • let only status: completed terminal items supersede streamed completions
  • reject failed, interrupted, and invalid non-terminal outcomes
  • retain the lifecycle/timeout semantics from fix(inference): harden Codex streaming, cancellation, and live QA #116012
  • remove duplicate turn-correlation and assistant-order bookkeeping

Production delta: +46/-46 (net zero). Tests: +216/-0. Collector 21/21; binding 46/46; formatting and git diff --check clean. Remote changed gate passed on Testbox tbx_01kyxy1079s7dg75fz5hsx0ke5: https://github.com/openclaw/openclaw/actions/runs/30686622358. Targeted remote lanes also passed on tbx_01kyxw117qdj7wkrvkdqza7fdh: https://github.com/openclaw/openclaw/actions/runs/30685524293. Autoreview reported no P0/P1 findings.

Native pinned Codex 0.146.0 stdio proof: completed turns returned only the final_answer item (OPENCLAW_QA_NATIVE_FINAL); a real commandExecution turn interrupted via turn/interrupt terminated as interrupted with zero items, and the collector rejected it.

Direct Codex contract inspection:

  • ../codex/codex-rs/app-server-protocol/src/protocol/v2/turn.rs:30-35 defines completed/interrupted/failed/inProgress
  • ../codex/codex-rs/protocol/src/models.rs:758-769 defines legacy unphased, commentary, and final-answer phases
  • ../codex/codex-rs/app-server/src/thread_state.rs:158-170 records the last nonempty final or legacy-unphased message
  • ../codex/codex-rs/app-server/src/bespoke_event_handling.rs:1270-1295,1463-1515 emits that item only for successful completion; interruptions carry none
  • ../codex/codex-rs/app-server/src/request_processors/turn_processor.rs:569-619 submits input before turn/start returns, proving the pre-response notification race

Shipped v2026.7.2-beta.1 through .5 all contain the vulnerable FIFO collector. Codex 0.144.x/0.145.0 terminal arrays were empty, so deleting the legacy item/completed fallback would regress shipped betas.

Not merging here; awaiting exact-head CI and ClawSweeper.

@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 1, 2026
@vincentkoc
vincentkoc force-pushed the codex/qa400-anthropic-codex branch from bbc88ae to ffd1999 Compare August 1, 2026 06:49
Retain terminal and assistant-completion facts when pre-start notifications exceed the bounded buffer. Exclude commentary from replies, accept legacy unphased final messages, and let completed terminal items own the final answer while rejecting interrupted, failed, or non-terminal outcomes.

Co-authored-by: Peter Steinberger <[email protected]>
@vincentkoc
vincentkoc force-pushed the codex/qa400-anthropic-codex branch from ffd1999 to ff523ac Compare August 1, 2026 07:06
@vincentkoc

Copy link
Copy Markdown
Member

Exact-head repair proof for ff523ac316965f04f86fa9df35161428b7267a1a (signed):

  • Root cause/owner: the conversation-turn collector owns pre-turn/start correlation; its bounded FIFO could discard authoritative completion facts and retain commentary/deltas.
  • Canonical fix: semantic bounded retention, final/legacy fallback, commentary exclusion, completed-terminal authority, explicit failed/interrupted rejection; production delta +46/-46 (net zero).
  • Binding-seam replay: 1/1 passes. The production notification handler receives 100 commentary completions, one legacy-unphased authoritative final, and an empty completed terminal before mocked turn/start returns; after setTurnId replay, the delivered reply is exactly authoritative answer.
  • Focused suites: collector 23/23; conversation binding 47/47; formatting and git diff --check clean.
  • Native pinned Codex 0.146.0 stdio: completed final returns exactly OPENCLAW_QA_NATIVE_FINAL; a real sleep 30 command interrupted through turn/interrupt terminates interrupted with zero items and is rejected by the collector.
  • Direct sibling Codex contract inspection is recorded in the updated PR body, including the pre-response notification race and phase/terminal producer paths.
  • Full-branch P0/P1 autoreview is clean at confidence 0.91; TruffleHog clean.
  • Exact-head CI is running: https://github.com/openclaw/openclaw/actions/runs/30689051957

Holding open and unmerged pending exact-head CI and fresh ClawSweeper verdict.

@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 1, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer proof decision for exact head ff523ac316965f04f86fa9df35161428b7267a1a:

  • Four authenticated stock codex-cli 0.146.0 saturation trials each emitted 1,016 notifications, including 999 agent-message deltas, and preserved the complete 200-line final answer. All four observed zero notifications before the turn/start response.
  • Stock Codex exposes no deterministic control to delay that response until 100+ provider notifications arrive. A patched binary, proxy, or synthetic provider would not be stronger stock-native proof.
  • The exact saturated ordering is covered through OpenClaw’s production notification handler before setTurnId; native stdio separately proves the real final-phase, terminal-summary, and interruption contracts.
  • Direct sibling ../codex inspection is complete. The body now correctly identifies rust-v0.146.0 commit e363b08c9175ac1cbe5893615dd2cb9ddf95043b and terminal-summary producer 80f3c3141e4dd421c861408a87703bad0cb09874.

We accept the residual scheduler risk and consider the binding replay plus native/source evidence sufficient. Please clear the proof-only P1 if the evidence now meets the gate.

@clawsweeper re-review

@vincentkoc

Copy link
Copy Markdown
Member

Final maintainer dependency-contract disposition for exact head ff523ac316965f04f86fa9df35161428b7267a1a:

  • required direct sibling Codex inspection completed personally at openai/codex@414782450952a196bbb64b1605a458c2531c47b6
  • checked TurnStatus, AgentMessage.phase, ItemCompletedNotification, app-server terminal event docs, and the authoritative item/completed contract
  • contract confirmed: item completion is authoritative; turn/completed is terminal (completed/interrupted/failed); commentary is interim; final_answer is final; unphased messages retain legacy compatibility; turn items are currently empty
  • exact-head native Codex 0.146.0 completion and interrupt proofs are redacted in the PR; four 1,016-notification stress runs retained the complete final output
  • exact-head production-handler replay covers the ordering ClawSweeper could not manufacture without patching/proxying Codex
  • exact-head CI and real-behavior proof: green; autoreview clean; 0 unresolved threads
  • ClawSweeper has no code finding; its source/proof blocker is satisfied by this maintainer inspection
  • live main: b97a21460436e7386735b6a6cfc10dde428ee8dc
  • touched-path drift: 0
  • clean synthetic merge tree: 1d8a4a6c66ebd8f2123ff12c3e3a82bcef5e526a

Accepting the maintainer evidence override and landing via squash.

@vincentkoc
vincentkoc merged commit 378d4ff into main Aug 1, 2026
108 of 110 checks passed
@vincentkoc
vincentkoc deleted the codex/qa400-anthropic-codex branch August 1, 2026 07:34
vincentkoc added a commit that referenced this pull request Aug 1, 2026
* origin/main: (41 commits)
  test(ci): update memory helper routing expectation (#117295)
  fix(canvas): emit successful control results in JSON mode (#117297)
  fix(imessage): settle native inbound reply delivery (#117282)
  fix(agents): reject invalid UTF-8 LSP responses (#117271)
  fix(line): centralize card and template message alt text (#117280)
  fix(release): validate candidates before Docker publication (#117252)
  fix(media): validate provider-owned generated media downloads (#117281)
  fix(feishu): restore custom HTTPS API domains (#117278)
  fix(models): reuse prepared plugin metadata (#117131)
  fix(agents): stop fallback after delivered-but-failed attempts (#114628)
  fix(memory): reuse targeted session corpus snapshot (#117247)
  fix(matrix): reconcile durable sends after response loss
  test(release): repair full validation regressions (#116931)
  fix(linux-canvas): report socket watcher fallback (#109502)
  fix(codex): preserve authoritative turn completion (#117185)
  fix(canvas): preserve widgets across derived-name collisions (#117132)
  fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (#117206)
  fix(msteams): prevent duplicate final replies (#116398)
  fix(doctor): session SQLite restore installs an empty session index over the valid archive (#117221)
  fix(plugins): preserve workspace plugins across CLI and control UI (#117265)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
Retain terminal and assistant-completion facts when pre-start notifications exceed the bounded buffer. Exclude commentary from replies, accept legacy unphased final messages, and let completed terminal items own the final answer while rejecting interrupted, failed, or non-terminal outcomes.

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main: (41 commits)
  test(ci): update memory helper routing expectation (openclaw#117295)
  fix(canvas): emit successful control results in JSON mode (openclaw#117297)
  fix(imessage): settle native inbound reply delivery (openclaw#117282)
  fix(agents): reject invalid UTF-8 LSP responses (openclaw#117271)
  fix(line): centralize card and template message alt text (openclaw#117280)
  fix(release): validate candidates before Docker publication (openclaw#117252)
  fix(media): validate provider-owned generated media downloads (openclaw#117281)
  fix(feishu): restore custom HTTPS API domains (openclaw#117278)
  fix(models): reuse prepared plugin metadata (openclaw#117131)
  fix(agents): stop fallback after delivered-but-failed attempts (openclaw#114628)
  fix(memory): reuse targeted session corpus snapshot (openclaw#117247)
  fix(matrix): reconcile durable sends after response loss
  test(release): repair full validation regressions (openclaw#116931)
  fix(linux-canvas): report socket watcher fallback (openclaw#109502)
  fix(codex): preserve authoritative turn completion (openclaw#117185)
  fix(canvas): preserve widgets across derived-name collisions (openclaw#117132)
  fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (openclaw#117206)
  fix(msteams): prevent duplicate final replies (openclaw#116398)
  fix(doctor): session SQLite restore installs an empty session index over the valid archive (openclaw#117221)
  fix(plugins): preserve workspace plugins across CLI and control UI (openclaw#117265)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants