fix(codex): terminate message-tool source replies#95839
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 23, 2026, 12:03 PM ET / 16:03 UTC. Summary PR surface: Source +12, Tests +33. Total +45 across 4 files. Reproducibility: yes. source-reproducible: current main has the shared source-reply detector and dynamic-tool termination hook, but the Codex bridge does not pass sourceReplyDeliveryMode into that decision. I did not run a live channel reproduction in this read-only review. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the local non-enumerable termination signal, thread sourceReplyDeliveryMode into the Codex bridge, and require redacted live proof that a message_tool_only Codex turn completes immediately after the visible source reply. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main has the shared source-reply detector and dynamic-tool termination hook, but the Codex bridge does not pass sourceReplyDeliveryMode into that decision. I did not run a live channel reproduction in this read-only review. Is this the best way to solve the issue? Yes for the narrow implicit-send path: the PR reuses the existing shared detector and leaves Codex's JSON protocol unchanged. The remaining gap is live behavior proof and maintainer choice versus the broader conflicting replacement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against dc9c11be917e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +12, Tests +33. Total +45 across 4 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
|
|
@/var/folders/ks/54l0_v5j441gbf_8nbz9kgb80000gn/T/tmp.imm790J0Rs |
Summary
message_tool_onlysource replies as terminal for Codex dynamic-tool runs.sourceReplyDeliveryModeinto the Codex dynamic tool hook context.This is a minimal alternative/companion to #95826. It keeps the fix scoped to the Codex dynamic-tool termination path and shared harness export without the additional iMessage/docs changes in that draft.
Root Cause
The embedded-agent path already has shared logic for detecting when a
message.sendcall delivered the visible source reply inmessage_tool_onlymode. The Codex app-server dynamic-tool bridge was not receivingsourceReplyDeliveryMode, so those delivered source replies were not included in Codex's dynamic-tool termination decision. Codex could therefore keep waiting after the user-visible reply had already been sent.Test Plan
node scripts/run-vitest.mjs run extensions/codex/src/app-server/dynamic-tools.test.tsnode scripts/run-vitest.mjs run src/agents/embedded-agent-runner/run/message-tool-terminal.test.ts src/agents/embedded-agent-message-tool-source-reply.test.tsgit diff --check origin/main...HEADpnpm buildcurrently fails on currentorigin/maindeclaration generation in unrelatedsrc/commands/doctor/shared/preview-warnings.tstype errors:ToolProfilePolicy | undefinedis not assignable toToolPolicyConfigat lines 450, 501, and 637.