fix: recover stale reply turns with valid send action#81202
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: no. not for the reported live Telegram stale-turn silence: the PR describes the scenario, but no forced stale-turn Telegram recovery proof is provided. Source inspection does show a high-confidence patch defect because the proposed Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Base stale-turn recovery on a real persisted current-main turn-state contract, or add that typed contract and its writer before sending the fallback through the current Do we have a high-confidence way to reproduce the issue? No, not for the reported live Telegram stale-turn silence: the PR describes the scenario, but no forced stale-turn Telegram recovery proof is provided. Source inspection does show a high-confidence patch defect because the proposed Is this the best way to solve the issue? No. The nested Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 8998e536fa0e. |
|
Thanks — acknowledged. This PR currently has schema/runtime validation proof, but not the forced live Telegram stale-turn recovery proof requested here. Current proof available: The proof shows the fallback now builds a valid I will add redacted live recovery evidence before treating this PR as merge-ready; for now, please keep the proof blocker open rather than assuming the contributor missed the request. |
|
Closing this draft to reduce duplicate/open PR load. Reason: the branch is conflicting and ClawSweeper identified a blocking contract issue: it depends on replyTurn* fields that current main does not type or persist, so the recovery branch would not run against real session stores. The proof is mock-only/hand-seeded rather than real Telegram stale-turn recovery. The useful learning has been carried forward as context on #86089. If this behaviour is still needed, it should be rebuilt against the current persisted session contract with live Telegram recovery proof. |
Summary
Fixes stale reply-turn recovery so Telegram interruption fallback messages use the current
message.actionschema.Why
A stalled reply turn could be released internally but fail to notify Telegram because recovery called
message.actionwith obsolete top-leveltarget,threadId, andmessagefields. The gateway now requires nestedparamsplusidempotencyKey, so the fallback was rejected and users saw silence.Changes
message.actionusing nestedparams.to,params.threadId, andparams.message.Real behavior proof
Behavior addressed: stale Telegram reply-turn recovery silently failed after a long run/tool timeout.
Real environment tested: Moeed Ahmed's local OpenClaw gateway on macOS, Telegram forum topic, installed runtime and clean upstream worktree.
Exact steps or command run after the patch:
pnpm oxfmt --check src/logging/diagnostic-stuck-session-recovery.runtime.ts src/logging/diagnostic-stuck-session-recovery.runtime.test.ts;pnpm vitest run src/logging/diagnostic-stuck-session-recovery.runtime.test.ts;node --check /opt/homebrew/lib/node_modules/openclaw/dist/diagnostic-stuck-session-recovery.runtime-CkodWvBA.js.Evidence after fix: formatting passed; targeted Vitest passed 1 file / 12 tests; installed runtime syntax check passed; live gateway remained reachable and Telegram channel status was OK.
Observed result after fix: the recovery fallback now builds a valid
message.actionrequest with nested send params and an idempotency key, so stale reply-turn closure can notify Telegram instead of failing schema validation.What was not tested: full upstream CI and live forced production stale-turn recovery after release packaging.
Tests
pnpm oxfmt --check src/logging/diagnostic-stuck-session-recovery.runtime.ts src/logging/diagnostic-stuck-session-recovery.runtime.test.tspnpm vitest run src/logging/diagnostic-stuck-session-recovery.runtime.test.tsnode --check /opt/homebrew/lib/node_modules/openclaw/dist/diagnostic-stuck-session-recovery.runtime-CkodWvBA.js