Repository navigation
Description
Since 2026.7.1, client-delegated dynamic tools return terminate: true (tool-split runner). The Telegram/channel message tool is delegated, so when an agent sends a progress message ("I'll do X now") and then intends to continue working, releaseTurnAfterTerminalDynamicTool fires interruptCodexTurn and kills the rest of the turn.
Observed: 33 premature turn releases in one day on a gpt-5.5 codex app-server agent — trajectory events turn.dynamic_tool_terminal_release, all with tool: "message". Before 2026.7.1 the same setup logged ~0 such events per day. User-visible symptom: the agent "promises but never follows through" — any turn that sends a channel message before doing tool work gets interrupted right after the send.
Expected: a message-tool result should not be treated as the turn's terminal answer while the model has not completed its turn — or at least make this release behavior configurable per tool.
Repro sketch:
- Embedded codex app-server agent (openai/gpt-5.5) bound to a Telegram channel.
- Prompt it to first send a short progress message, then run any other tool (e.g. exec).
- On 2026.7.1 the turn is interrupted right after the message send (
codex app-server turn released after terminal dynamic tool resultin gateway log); the second tool never runs.
Local workaround: patch shouldReleaseTurnAfterTerminalDynamicTool to return false — restores pre-2026.7.1 behavior (model ends its own turn; idle timeouts still protect against hangs).
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 17, 2026
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.
Close as a duplicate of the newer open report that tracks the same remaining omitted-
finalturn-termination behavior. Current main still intentionally terminates that path, so this is not an implemented-on-main closure.Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.
Root-cause cluster
Relationship:
duplicateCanonical: #127139
Summary: The supplied open report names the same omitted-
finalCodex message behavior that current main explicitly implements.Members:
canonical: [Bug]: Codex progress message(action=send) still ends turn after #108487 when final is omitted and stopReason is toolUse #127139 - Its title specifically describes the same progress-message turn termination whenfinalis omitted.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Canonical path: Consolidate the omitted-finality contract and a native-tool-in-flight regression at #127139, with the Codex protocol source checked before changing the plugin lifecycle.
So I’m closing this here and keeping the remaining discussion on #127139.
Review details
Best possible solution:
Consolidate the omitted-finality contract and a native-tool-in-flight regression at #127139, with the Codex protocol source checked before changing the plugin lifecycle.
Do we have a high-confidence way to reproduce the issue?
Yes, at source level: in
message_tool_onlymode, send a confirmed message reply withoutfinal:false; current code makes it terminal and schedulesturn/interrupt, though the authoritative Codex protocol source was unavailable here.Is this the best way to solve the issue?
No for a separate fix: the newer open canonical report already owns the same omitted-finality contract; its repair should add an end-to-end boundary case for a progress reply followed by native work.
Security review:
Security review: This is an issue review without a proposed patch.
AGENTS.md: found and applied where relevant.
What I checked:
finalon a confirmed message-tool-only source reply as final and marks the response terminal. (extensions/codex/src/app-server/dynamic-tools.ts:873, 13f0e02de62d)extensions/codex/src/app-server/run-attempt-server-requests.ts:326, 13f0e02de62d)terminate: true, while only explicitfinal: falsepreserves progress behavior. (extensions/codex/src/app-server/dynamic-tools.test.ts:2341, 13f0e02de62d)extensions/codex/src/app-server/dynamic-tools.ts:873, 5e1a28bb5664)extensions/codex/src/app-server/dynamic-tools.ts:873, 8e6f966482b0)finalstill ends a Codex turn after the earlier fix.Likely related people:
extensions/codex/src/app-server/dynamic-tools.ts,extensions/codex/src/app-server/dynamic-tools.test.ts)extensions/codex/src/app-server/dynamic-tools.ts)Codex review notes: model internal, reasoning high; reviewed against 13f0e02de62d.
amr2393 commentedon Jul 17, 2026
Stable-channel live repro (not just source-level) plus a variant that I think raises the severity: the release doesn't only skip promised work — it kills work that is already running in parallel.
Environment: OpenClaw
2026.7.1(2d2ddc4), embedded codex app-server, modelopenai/gpt-5.6-sol, Telegram group-topic session. Before 2026.7.1 this box logged zeroturn.dynamic_tool_terminal_releaseevents; they appear immediately after the update.Variant A — in-flight sibling call killed (live transcript, 2026-07-17 16:06Z)
User message:
run sh -c 'sleep 40; echo PROBE' backgrounded with yieldMs 1000, just ackThe model emitted parallel calls in one response:
bash—sh -c 'sleep 40; echo PROBE'(16:06:34.459Z)message(action=send)—"ACK"(16:06:34.461Z)The message result returned ok (
messageIddelivered, 16:06:34.462Z) and the turn was interrupted ~2ms later — while the native bash was mid-sleep. The command never completed, no output was ever produced anywhere, and the session recorded a clean success. Trajectory showsturn.dynamic_tool_terminal_releasewithtool: "message".Implication for the fix: an in-flight native tool call evidently does not count toward the release guard's in-flight counters, so
releaseTurnAfterTerminalDynamicToolfires even when the turn demonstrably has outstanding work. This is worse than message-loss — it is silent work-loss on a live user request.Variant B — classic ack-then-work truncation (2026-07-16, first post-update callback cycle)
Two consecutive turns on a Telegram topic died immediately after a
messageack ("I'll write it now" → silence); the user prodded twice and the deliverable arrived 36 minutes late. The third turn survived because it happened to run non-terminal dynamic tools (memory_search/web_fetch) before messaging — consistent with thecurrentTurnHadNonTerminalDynamicToolResultsuppression path.Adjacent observation worth considering in the fix design
After we deployed a prompt-level rule banning
message-tool sends while work is pending, the model complied by acking via final streamed text instead — with the same native bash still in flight. The turn then completed on the final text and the in-flight call was orphaned anyway (OpenClaw wrote its "recorded a native Codex tool.call without a matching tool.result before the turn completed" reconciliation marker; no release event involved). So a fix scoped only to the message-tool release path still leaves early-turn-end orphan semantics for running native calls; treating "outstanding native tool call" as turn-not-terminal would cover both.Verified workarounds (live-tested, for anyone else hitting this)
openclaw message sendCLI in bash (native call, no dynamic-tool semantics) — unaffected.launchctl submit(macOS);nohup ... &children did not survive the app-server bash sandbox in two attempts.Full transcript/trajectory excerpts for all three runs available on request.
EdgeClaws commentedon Jul 17, 2026
This looks already fixed on
mainby #108487 ("fix(codex): continue turns after progress replies", merged 2026-07-15), which makes omitted source-reply finality pending until the authoritative Codexturn/completed(explicitfinal:truestays terminal,final:falsestays progress).Worth flagging for other reporters: #108487 merged after the
v2026.7.1release (published 2026-07-13), so anyone on shipped2026.7.1still reproduces this until the next release — but it should be resolved onmain. Likely a dup of #106961 (which #108487 closed).For confirmation, we independently reproduced on shipped
2026.7.1(2d2ddc4), embedded Codex app-server,openai/gpt-5.6-sol, including in a brand-new empty chat (so it's not context/compaction related): the firstmessage(action=send)progress line releases the turn (codex app-server turn released after terminal dynamic tool result) and the follow-up work never runs.clawSean commentedon Jul 17, 2026
Fix provenance + earliest testable release, to close out the review's "confirm the exact current-main fix commit" ask:
d8a84a29cbe, merged 2026-07-13) introduced the Codex-projectedfinalcontrol onmessage(extensions/codex/src/app-server/message-tool-final-control.ts) — but omittedfinalstill degraded to legacy terminate-on-delivery, so the shipped2026.7.1behavior persisted for any model that doesn't set the flag.8e6f966482b0, merged 2026-07-15 23:27 UTC) is the root-cause fix: omitted finality stays pending until the authoritative Codexturn/completed(extensions/codex/src/app-server/source-reply-finality.ts); on success only the latest omitted reply is promoted to final, on failure it stays non-final — preserving Fix Codex message-tool-only source reply completion #95942's stranded-reply recovery. Closed [Bug]: Discord/Codex runtime: message tool is terminal, so progress updates silently end the turn #106961.v2026.7.2-beta.2(verified via tag containment; neither is on thev2026.7.1tag), so beta.2 is the earliest release where progress-message continuation can be live-verified.Residual grit #108487 does not address (possibly worth its own issue): when a release legitimately happens (explicit
final: true, or tool-ownedterminate), it is still enforced viainterruptCodexTurnBestEffort→ app-serverturn/interrupt(extensions/codex/src/app-server/run-attempt-lifecycle-controller.ts), so Codex records<turn_aborted>and injects "The user interrupted the previous turn on purpose." into thread history even for a clean, successful proactive close — misleading context for subsequent turns. #99442 (open) fixes abort detection on structural markers; the release-side semantics remain unclaimed. @amr2393's Variant A (in-flight sibling call killed ~2ms after the message result) also appears still reachable on the explicit-final path, since the release predicate's idle check can race freshly-batched native calls (per @thoughtmerchant's batching analysis on #107464).Johannes-Berggren commentedon Jul 18, 2026
Independent stable-channel confirmation on Slack (prior repros here were Telegram — this is channel-agnostic), OpenClaw
2026.7.1(2d2ddc4), embedded codex app-server,openai/gpt-5.5.Clean A/B via config: with
messages.visibleReplies(+messages.groupChat.visibleReplies) atautomaticwe logged 0turn.dynamic_tool_terminal_releaseevents/day; the day we flipped both tomessage_toolwe got 20 (alltool: "message"), and every affected turn shows the reported symptom: agent sends a progress note ("checking domain availability now"), release fires ~1ms after the send result, remaining work never runs.It's fully deterministic — a user follow-up ("status?") produced a second turn that acknowledged the interruption ("I got interrupted right after the first note"), sent that acknowledgment via the message tool, and was killed the same way.
Config-only workaround for stable users (no dist patch): set
messages.visibleRepliesandmessages.groupChat.visibleRepliesback toautomaticand restart the gateway (messages.*does not hot-apply on 2026.7.1). This removesmessage_tool_onlysource-reply delivery mode, soisDeliveredMessageToolOnlySourceReplyResultno longer marks implicit-route sends terminal — at the cost of the known unthreaded-reply behavior thatmessage_toolmode was solving. Can confirm @clawSean's tag-containment finding: neither fix commit is onv2026.7.1, so config revert or explicitfinal:falseprompting are the only stable-channel mitigations.dzisu commentedon Jul 18, 2026
Additional live confirmation from a Telegram direct-chat OpenClaw instance, with a root-cause trace matching this issue.
Environment
2026.7.1(2d2ddc4)v24.18.0message_tool_onlyObserved behavior
When the Codex agent sends an intermediate visible progress update via:
the turn is released immediately. Any subsequent native/tool work that the agent intended to run in the same turn is discarded. From the user perspective, the agent says it is starting work, then never follows through.
Local log counts, privacy-scrubbed:
The repeated pattern is:
No Telegram transport failure was observed; the failure boundary is after the successful message-tool result, at Codex turn release.
Root-cause chain from local diagnosis
message(action=send)is treated as a dynamic tool by the Codex integration.tool.execution.completeddiagnostic event.diagnosticTerminalType,emitDynamicToolTerminalDiagnostic()defaults successful responses to terminal"completed".shouldReleaseTurnAfterTerminalDynamicTool()evaluates true once the app-server side appears idle.interruptCodexTurnBestEffort()interrupts the active Codex turn.The relevant local bundled code paths are equivalent to:
extensions/codex/src/app-server/run-attempt.ts: release after terminal dynamic-tool result, theninterruptCodexTurnBestEffort(...)extensions/codex/src/app-server/dynamic-tools.ts:emitDynamicToolTerminalDiagnostic(...)maps successful responses without an override totool.execution.completedExpected behavior
A visible mid-turn progress update should not terminate the Codex app-server turn. Termination should happen only when the message is explicitly the final source reply, or after the authoritative Codex turn completion.
Workaround verified locally
Operational workaround: do not use
message(action=send)as an early progress indicator. Run the diagnostic/tool work first, then send one final visible response.This aligns with the suspected fix shape discussed above: preserve terminal release for final source replies, but classify progress/intermediate message sends as non-terminal, for example through explicit
final: false/ pending finality semantics.Authorship disclosure: this evidence was collected and privacy-scrubbed by the affected user's local OpenClaw agent at the user's request.
Countermarch commentedon Jul 18, 2026
Additional stable-channel evidence for the same message-tool terminal-release family, from installed OpenClaw
2026.7.1 (2d2ddc4)on Telegram direct chat.What is additive here is the trajectory/audit classification: the affected main direct turns repeatedly ended as successful, status-only runs with no substantive work tools and no durable continuation, while nearby
:active-memory:helper cancellations were separate sub-runs rather than the main direct run being cancelled.Observed pattern on
2026-07-18:11:31Zand13:52Z.success.message(action=send)progress/status/acknowledgement message, then stopped.:active-memory:helper sub-runs, not the main direct Telegram run.The strongest local hypothesis matches this issue: direct Telegram prompts require
message(action=send)for visible output, and the installed terminal classifier treats committed message-tool delivery as explicit terminal success. When the model sends progress text like "checking now" as the only delivered message and then stops, the runtime records success even though the promised work never happened.Redaction note: local chat IDs, message bodies, account names, media details, private paths, and local numeric event IDs are omitted here. Preserved details are limited to version, UTC time window, channel, tool-count/status pattern, the main-run-vs-helper-cancellation distinction, and the known-good controls.
No local runtime, prompt, config, gateway, session-store, or Telegram mutation was applied.
Countermarch commentedon Jul 18, 2026
Source-only red/green evidence and candidate patch boundary from an isolated checkout, with no installed-runtime or live-service mutation.
Scope
e0a83c0046src/agents/pi-embedded-runner/run/incomplete-turn.tssrc/agents/pi-embedded-runner/run.incomplete-turn.test.tsRed test
Added the failing regression first:
retries direct Telegram progress-only message tool delivery with no work.Focused run before the source change:
Result:
That proves the current source completed after one progress-only committed
message(action=send)delivery instead of retrying/continuing the actionable turn.Candidate patch boundary
The prototype reuses
resolvePlanningOnlyRetryInstructionrather than adding a separate terminal classifier. It treats committed message-tool text as visible planning/progress text only when it is the only visible output and there is no client tool, yield, deterministic approval prompt, tool error, committed media, substantive non-plan tool activity, or other continuation/progress evidence. Existing planning-only/actionable-prompt gates still apply.Candidate behavior:
initialReplayState: { hadPotentialSideEffects: true, replayInvalid: true }because a visible message was already sent.Green verification
Focused test after the patch:
Changed-file checks passed on rerun after an initial sandbox
fetch failedbefore validation. The successful rerun covered conflict markers, changelog attribution, wildcard re-export guards, duplicate-scan coverage, core typecheck, core test typecheck, core lint, runtime sidecar loader guard, runtime import cycles, webhook body guard, pairing store guard, and pairing account guard.git diff --checkalso passed.Maintainer decision needed
This gives a narrow source-level fix option, but it relies on natural-language progress/planning classification. Please decide whether that heuristic is acceptable here, or whether the runtime should instead introduce an explicit message-tool semantic signal such as
intent: "progress" | "final"/ equivalent finality metadata so source-reply finality is not inferred from status text.epruseal commentedon Jul 19, 2026
Additional Discord-channel confirmation, plus a quick post-update check on the release that appears to contain the fix.
Environment
2026.7.1(2d2ddc4), embedded Codex app-server2026.7.1-2(0790d9f)gpt-5.5messages.groupChat.visibleReplies = message_tool, so source replies are delivered through the message-tool pathStable-channel behavior before update
On
2026.7.1, the local trajectory/log pattern matched this issue:Representative local gateway timing immediately before the update showed several
codex app-server turn released after terminal dynamic tool resultevents from Discord-channel turns. The user-visible symptom was the same as the other reports here: the agent sent a visible progress/status message, then the rest of the intended work did not happen.Post-update check on
2026.7.1-2After updating and restarting the gateway/app-server, I ran the same practical scenario from a Discord channel: first send a visible progress message with
message(action=send), then continue with ordinary tools in the same turn. This time the turn continued successfully: after the message send, the agent ran additionalbashandmessage.readcalls and completed the diagnosis. The current-turn trajectory contained noturn.dynamic_tool_terminal_releaseevent.The installed bundled code also matches the expected fix shape: source-reply delivery is still recorded as delivery evidence, but
withDynamicToolTermination(...)now guards termination with!confirmedSourceReply, so a successful source message delivery alone no longer releases the turn.Authorship disclosure: this was collected and privacy-scrubbed by the affected user's OpenClaw agent at the user's request. User/channel IDs, message bodies, local paths, and tool-call IDs are omitted.
9 remaining items
jinngimk-lang commentedon Aug 17, 2026
vincentkoc commentedon Aug 24, 2026
Reviewed as a duplicate of #127139. Thanks @antonsbot for the original report and cross-channel reproduction trail.
This closure does not mean the behavior is fixed. On current main
a3f64c19b673469e45c80f351414e88b664e390e, a confirmedmessage_tool_onlyreply with omittedfinalis explicitly treated as final/terminal (dynamic-tools.ts:873-897, dynamic-tools.test.ts:2341-2358), and the successful terminal result schedules and performs a Codex turn release (run-attempt-server-requests.ts:325-337, run-attempt-lifecycle-controller.ts:39-77). That is the same remaining omitted-finalcontract tracked by #127139.I also checked the exact bundled upstream dependency,
@openai/codex0.148.0(rust-v0.148.0, commit3ba0f711642a888aec92a611a3f3b2211157ff89). Its dynamic-tool response contains only content items and success (item.rs:1563-1566); the app server submits that as a dynamic-tool result (dynamic_tools.rs:37-53). Turn completion remains a separate authoritative notification, whileturn/interruptis cancellation (README.md:81-83, README.md:209-212, turn_processor.rs:1443-1487). Tool completion therefore does not establish that the surrounding turn is complete.Closing this older report as a duplicate. Product/contract decisions and repair proof remain on #127139.