fix(codex): preserve source reply mode for active runs#86287
fix(codex): preserve source reply mode for active runs#86287ferminquant wants to merge 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 24, 2026, 10:27 PM ET / 02:27 UTC. Summary PR surface: Source +1, Tests +38. Total +39 across 2 files. Reproducibility: yes. Current-main source shows the Codex app-server handle lacks the delivery-mode field while the shared queue rejects message-tool-only wakeups without it; the PR’s focused test encodes that source-level path. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land this narrow Codex app-server contract fix after normal maintainer review, then close the linked Discord sub-agent completion issue as fixed by the merge. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows the Codex app-server handle lacks the delivery-mode field while the shared queue rejects message-tool-only wakeups without it; the PR’s focused test encodes that source-level path. Is this the best way to solve the issue? Yes. The patch is the narrow maintainable fix: carry an existing run-scoped fact onto an existing handle field and keep the existing mismatch guard intact. Codex review notes: model gpt-5.5, reasoning high; reviewed against 4798264a2993. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +38. Total +39 across 2 files. View PR surface stats
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
|
|
ClawSweeper PR egg ✨ Hatched: ✨ glimmer Sunspot Proofling Hatch commandComment Hatchability rules:
Rarity: ✨ glimmer. What is this egg doing here?
|
|
@clawsweeper automerge |
8baa1a4 to
727047f
Compare
|
ClawSweeper 🐠 reef update Thanks for the work here. GitHub would not let ClawSweeper push to this branch with the available credentials, so the fix moved to a narrow replacement PR. nothing personal, just permission currents. Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
fish notes: model gpt-5.5, reasoning high; reviewed against e7fdf7b. |
Summary
sourceReplyDeliveryModeon the Codex app-server active-run handle so message-tool-only source replies are accepted by the shared active-run queue.message_tool_onlyaccepts queued sub-agent completion steering and sendsturn/steer.AI assistance disclosure
This PR was prepared with AI assistance. I inspected the reported issue, related OpenClaw threads, source paths, queue contract, and validation output before making the change.
Real behavior proof
Behavior addressed: Codex app-server active runs now carry
message_tool_onlysource reply delivery mode into the shared active-run queue, allowing sub-agent completion wakeups to steer the active Codex turn instead of being rejected assource_reply_delivery_mode_mismatch.Real environment tested: Local OpenClaw source runtime in a dedicated worktree, using the production
queueAgentHarnessMessageactive-run guard and the Codex app-server steering queue.Exact steps or command run after this patch:
Evidence after fix:
{ "proof": "issue-86232-codex-source-reply-delivery-mode", "mismatchedMode": { "queued": false, "requestMethods": [] }, "matchedMode": { "sourceReplyDeliveryModeOnHandle": "message_tool_only", "queued": true, "steerMethod": "turn/steer", "steerParams": { "threadId": "proof-thread-86232", "expectedTurnId": "proof-turn-86232", "input": [ { "type": "text", "text": "subagent complete", "text_elements": [] } ] }, "requestMethods": [ "turn/steer" ] }, "expected": { "mismatchedQueued": false, "matchedQueued": true, "matchedMethod": "turn/steer" } }Observed result after fix: A handle without
sourceReplyDeliveryModestill rejects a message-tool-only source reply, while a Codex-style active handle withsourceReplyDeliveryMode: "message_tool_only"accepts the same reply and emitsturn/steerwith the sub-agent completion text.What was not tested: No live Discord group chat was used, so this proof does not verify Discord transport credentials, gateway delivery, or final message-tool posting. It proves the source runtime contract that caused the reported silent rejection.
Root Cause
The shared active-run queue rejects source replies marked
message_tool_onlyunless the registered active run handle also advertisessourceReplyDeliveryMode: "message_tool_only". The regular PI embedded runner already passes that field into its active handle, but the Codex app-server runner omitted it when registering its handle withsetActiveEmbeddedRun. As a result, Codex app-server group sessions that required message-tool-only delivery could reject sub-agent completion wakeups before steering the active turn.Regression Test Plan
params.sourceReplyDeliveryMode = "message_tool_only".queueAgentHarnessMessage.turn/steerrequest containing the completion text.Security Impact
Low. This preserves an existing run-scoped delivery-mode fact on the active handle. It does not weaken the existing guard: source replies that request
message_tool_onlyare still rejected unless the run explicitly carries that same mode.Human Verification
Human review should focus on whether this is the intended narrow contract alignment for Codex app-server runs, rather than expanding broader source-reply fallback behavior. Related final-message and requester-wake policy issues are intentionally out of scope.
Risks
runCodexAppServerAttempt.Validation
Passed.
Passed: 1 test passed, 218 skipped.
node scripts/run-vitest.mjs extensions/codex/src/app-server/run-attempt.test.ts -t "message-tool-only steering"Passed: 1 test passed, 218 skipped.
OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree PATH="$PWD/.artifacts/bin:$PATH" corepack pnpm check:changed --base upstream/mainPassed.
Passed: no actionable correctness issues found.
Validation note: the full
extensions/codex/src/app-server/run-attempt.test.tsfile currently has one unrelated isolated failure inpasses session plugin app policy context to elicitation handling(calendarPolicy?.pluginNamewasundefined). The new focused regression test passes independently.