fix: reconcile timed-out gateway message actions#104632
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 12, 2026, 5:02 PM ET / 21:02 UTC. Summary PR surface: Source +52, Tests +206. Total +258 across 5 files. Reproducibility: yes. Current source and the linked production incident establish a client timeout while Gateway work continues, later delivery, and unsafe retry pressure; the corrected current-head path still needs live observation. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the shared same-key reconciliation and bounded cancellation design, rebase the small adjacent current-main change, and merge only after redacted exact-head Telegram evidence shows a delayed send produces exactly one visible delivery. Do we have a high-confidence way to reproduce the issue? Yes. Current source and the linked production incident establish a client timeout while Gateway work continues, later delivery, and unsafe retry pressure; the corrected current-head path still needs live observation. Is this the best way to solve the issue? Yes. Reattaching the unchanged action and idempotency key at the shared Gateway boundary uses the existing in-flight join and completed-result cache and is narrower than downstream channel-specific suppression. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e3163d1e1f2d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +52, Tests +206. Total +258 across 5 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
Review history (11 earlier review cycles; latest 8 shown)
|
d9b9fa2 to
b3e94a4
Compare
5e12771 to
5b63486
Compare
bb0d2a2 to
0b36509
Compare
|
@openclaw-mantis telegram live: reproduce a delayed gateway message send past the client deadline and verify exactly one visible delivery, returning a redacted transcript and timing logs. |
0b36509 to
fc20e01
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
de23220 to
025f89b
Compare
|
Maintainer review + landing proof (pre-merge):
|
Related: #80177
Related: #102179
What Problem This Solves
Fixes duplicate channel replies when a Gateway-backed
message(action=send)exceeds the client deadline but succeeds later. The model can otherwise see a tool failure, compose a paraphrased retry, and make both deliveries visible. This was observed on Telegram after upgrading from an OpenClaw 2026.6.10 control window to the 2026.7.1 beta line.Why This Change Was Made
On
GatewayTransportError(kind="timeout")only,sendreattaches once to the unchangedmessage.actionpayload and idempotency key. The Gateway already joins same-key in-flight work and caches its completed result, so reconciliation observes the original action instead of dispatching another one.For agent calls with an abort signal, the reattachment has its own nine-minute deadline and still respects caller cancellation. The initial
sendwait is capped at 30 seconds, keeping transport plus reconciliation inside Codex's ten-minute outer watchdog even when a largertimeoutMsis supplied. Calls without a cancellation lifecycle use one bounded 60-second fallback attempt. There is no unbounded retry loop, non-sendactions are unchanged, and definitive errors still return immediately.This is intentionally a process-local mitigation: it relies on the live Gateway's in-flight join/cache and does not claim exactly-once delivery across Gateway restarts.
User Impact
Agents wait for the original delivery result instead of treating an ambiguous client timeout as an immediate send failure. This closes the timeout -> late success -> paraphrased duplicate path without lengthening normal sends or changing channel configuration.
Evidence
message(action=send)timing out after 30 seconds, the Gateway later recording the Telegram send as successful, and a paraphrased second send following.node scripts/run-vitest.mjs src/infra/outbound/message-action-runner.plugin-dispatch.test.ts extensions/codex/src/app-server/dynamic-tool-execution.test.ts -- --reporter=dot— 37/37 outbound and 26/26 Codex tests passed.node scripts/run-vitest.mjs src/gateway/server-methods/send.test.ts— 138/138 passed, including the same-key in-flight join contract..agents/skills/autoreview/scripts/autoreview --mode uncommitted --stream-engine-output— clean; no accepted/actionable findings (0.89 confidence on the final timeout-cap patch).