Skip to content

Restore Codex completion notifications after reconnecting - #130503

Closed
pash-openai wants to merge 1 commit into
mainfrom
pash/restore-raw-events-on-resume
Closed

pash-openai wants to merge 1 commit into
mainfrom
pash/restore-raw-events-on-resume

Conversation

@pash-openai

Copy link
Copy Markdown
Contributor

OpenClaw enables raw Codex response events when starting a conversation, but does not request them when resuming one. A cold resume can therefore hide the native completion receipts used by the subagent monitor, causing a result that already reached the parent to be announced again.

Renew that opt-in in the shared resume request builder, including warm-resume bindings. This complements the completion-ownership fix in #130311 and #130347 without changing owner configuration, stored conversation history, or retry policy. Older app-server releases accept and ignore the field; restoring notifications requires an app-server release that supports the resume opt-in.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@pash-openai
pash-openai marked this pull request as ready for review August 26, 2026 23:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-27T00:01:25.642319Z dffc6fb Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 26, 2026, 7:56 PM ET / 23:56 UTC.

ClawSweeper review

What this changes

Renews the Codex app-server raw-event subscription when OpenClaw resumes a conversation.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: current main still omits the raw-event opt-in on resume, but direct Codex protocol verification and a real reconnect trace are missing.

Priority: P1
Reviewed head: dffc6fba0223ab7f0a399067ecaa1de3fcd03f00

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is narrowly targeted, but direct protocol and reconnect evidence are missing.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; a redacted reconnect trace remains necessary merge evidence.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; a redacted reconnect trace remains necessary merge evidence.
Evidence reviewed 6 items Current-main gap: Current main enables raw events for thread/start but its shared resume builder omits the option.
Resume owner boundary: The lifecycle constructs this request through the shared builder before calling the resume RPC.
Receipt dependency: The monitor records raw completion receipts and marks the child delivered instead of sending another completion.
Findings 1 actionable finding [P2] Validate the resume option against the Codex protocol
Security None None.

Live Verification

Command: pnpm test extensions/codex/src/app-server/run-attempt.test.ts -t "passes configured app-server policy, sandbox, service tier, and model on resume"

Result: FAIL (failed) — step 1 run pnpm test extensions/codex/src/app-server/run-attempt.test.ts -t "passes configured app-server policy, sandbox, service tier, and model on resume": previous terminal command was still running after 30 seconds: "pnpm test extensions/codex/src/app-server/run-attempt.test.ts -t \"passes configured app-server policy, sandbox, service tier, and model on resume\""

$ node --import tsx scripts/test-projects.mts extensions/codex/src/app-server/run-attempt.test.ts -t 'passes configured app-server policy, sandbox, service tier
, and model on resume'
[test] starting test/vitest/vitest.extension-codex.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130503-6upYqN/target

Assertions:

  • FAIL expect_output: passes configured app-server policy, sandbox, service tier, and model on resume

How this fits together

The Codex plugin resumes app-server threads and consumes raw native completion receipts so its monitor can avoid delivering a child result twice.

flowchart LR
A[Parent agent run] --> B[Codex lifecycle]
B --> C[Resume request]
C --> D[Codex app server]
D --> E[Raw completion receipt]
E --> F[Subagent monitor]
F --> G[Duplicate delivery suppressed]
Loading

Before merge

  • Validate the resume option against the Codex protocol (P2) - This adds experimentalRawEvents to a live Codex RPC, but the local type and test only prove OpenClaw serializes it. Direct upstream protocol evidence and an observed reconnect are needed to show the app server accepts the field and restores the receipt path.
  • Resolve merge risk (P1) - The actual Codex contract for experimentalRawEvents on thread/resume was not directly inspectable.
  • Resolve merge risk (P1) - No observed reconnect demonstrates that the resumed client receives a raw completion receipt.
  • Complete next step (P2) - This protected maintainer PR needs Codex protocol confirmation or reconnect proof, not an automated repair.

Findings

  • [P2] Validate the resume option against the Codex protocol — extensions/codex/src/app-server/thread-requests.ts:282
Agent review details

Security

None.

PR surface

Source +4, Tests +1. Total +5 across 3 files.

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

Review metrics

Metric Value Why it matters
Production versus test delta production +4, tests +1 The production growth is limited to a resume option and its type; the added assertion proves serialization, not app-server behavior.

Merge-risk options

Maintainer options:

  1. Prove resumed receipt delivery (recommended)
    Add upstream protocol confirmation and a redacted reconnect trace showing the resumed request and native completion receipt.
  2. Accept the evidence gap
    Land only if a Codex protocol owner explicitly confirms the resume field's behavior and compatibility.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Attach upstream Codex protocol evidence and a redacted reconnect trace for the resumed raw-event subscription.

Technical review

Best possible solution:

Keep the shared-builder repair and add direct Codex protocol evidence plus a redacted reconnect trace before merge.

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

No live reproduction was run; source provides a high-confidence path because resume omits the raw-event opt-in while the monitor consumes raw receipt notifications.

Is this the best way to solve the issue?

Unclear: the shared resume builder is the correct owner boundary, but the upstream Codex contract and reconnect behavior remain unverified.

Full review comments:

  • [P2] Validate the resume option against the Codex protocol — extensions/codex/src/app-server/thread-requests.ts:282
    This adds experimentalRawEvents to a live Codex RPC, but the local type and test only prove OpenClaw serializes it. Direct upstream protocol evidence and an observed reconnect are needed to show the app server accepts the field and restores the receipt path.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: A reconnect can lose the receipt that prevents duplicate child-completion delivery.
  • add merge-risk: 🚨 message-delivery: The changed subscription controls whether native child completion is treated as already delivered.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.

Label justifications:

  • P1: A reconnect can lose the receipt that prevents duplicate child-completion delivery.
  • merge-risk: 🚨 message-delivery: The changed subscription controls whether native child completion is treated as already delivered.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.

Evidence

What I checked:

Likely related people:

  • pash-openai: Authored the merged native completion receipt and recovery work connected to this resume-path follow-up. (role: introduced completion-receipt behavior; confidence: high; commits: 8e9db5e16689, a021f79badc8; files: extensions/codex/src/app-server/native-subagent-monitor.ts, extensions/codex/src/app-server/native-subagent-notification.ts)
  • Peter Steinberger: Current-main blame attributes the existing thread-start raw-event subscription in the shared request builder to this contributor. (role: recent area contributor; confidence: medium; commits: aec260b7002c; files: extensions/codex/src/app-server/thread-requests.ts)

Rank-up moves

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

  • Attach a redacted reconnect trace showing the resumed request and native completion receipt.
  • Verify the matching Codex protocol type/source when the required sibling checkout or network is available.

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.

@pash-openai

Copy link
Copy Markdown
Contributor Author

Withdrawing this approach. I’m keeping completion handling within OpenClaw without requiring a Codex protocol change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant