Repository navigation
fix: prevent duplicate and lost agent delivery - #120108
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready verification for exact head
Proof gap: Blacksmith Testbox could not start because the local |
|
Merged via squash.
|
* origin/main: refactor(test): compress repetitive fixtures in mega-tests, batch 2 (openclaw#120124) refactor(ui): adopt shared chat-host fixture across chat suites (openclaw#120120) fix(ci): provision native Android resources for frozen current-contract targets (openclaw#120081) fix: preserve agent delivery identity (openclaw#120108) fix(qqbot): add cause-specific setup guidance (openclaw#119780) fix(venice): replay Gemini tool signatures by turn occurrence (openclaw#119783) fix(gateway): yield before TTS status diagnostics (openclaw#119788) fix: gateway restart fails and leaves the macOS LaunchAgent unloaded when the gateway drains active work (openclaw#116875) fix(clickclack): show native agent progress while replying (openclaw#116683) fix: unhandled rejection crashes process when raw stream write fails (openclaw#119400) fix: prevent duplicate outbound delivery during concurrent recovery (openclaw#119966) # Conflicts: # src/agents/embedded-agent-runner/run.incomplete-turn.test.ts
What Problem This Solves
Fixes three delivery failures found in production: synthetic sub-agent and lifecycle turns could invalidate an existing Claude CLI session and reseed it from a lossy text-only transcript; message-tool sends and polls could discard their host-generated idempotency key before reaching the Gateway; and failed-session recovery notices could bypass normal outbound delivery and disappear on Signal and other plugins that intentionally do not implement send as a message action.
Why This Change Was Made
Synthetic turns now keep their turn-local reply policy separate from the existing session's stable CLI binding policy. Core outbound send and poll paths carry the host-owned idempotency key end to end. Main-session recovery notices now use a typed Gateway-owned normal outbound path with durable delivery identity, no plugin action fallback, and no transcript mirroring into a rebound session.
The reported
openclaw models listSonnet 5 crash was also checked and is already fixed onmainby #102186; this PR does not change model code.AI-assisted: implementation and review used Codex and Claude Code; the final diff was manually inspected and source-aware autoreview found no actionable issue.
User Impact
Sub-agent completions and internal lifecycle turns no longer force unnecessary Claude CLI reseeds or invite repeated agent actions from reconstructed history. Retried gateway-mode sends retain the same logical delivery identity, and operators on Signal and other outbound-only plugins receive the visible notice when a main session cannot be resumed after restart.
Evidence
node scripts/run-vitest.mjs src/auto-reply/reply/source-reply-delivery-mode.test.ts src/commands/agent.test.ts src/agents/main-session-restart-recovery.test.ts src/gateway/server-instance-runtime.test.ts src/infra/outbound/message-action-runner.media.test.ts src/infra/outbound/message-action-runner.poll.test.ts src/infra/outbound/message.channels.test.ts src/infra/outbound/outbound-send-service.test.ts src/agents/tools/message-tool.test.ts— 9 files / 563 tests passed across 6 shards.pnpm tsgo— passed.pnpm check:test-types— passed.node scripts/run-oxlint.mjs ...for all changed files — passed.pnpm build— passed, including CLI import guard and plugin SDK export checks.git diff --check— passed.gpt-5.6-sol, high) — clean, no accepted/actionable findings.blacksmithexecutable was absent; repository policy fallback was the successful local heavy gate above. Exact-head hosted CI remains required before landing.