Skip to content

fix: suppress replayed load session updates from output#38

Merged
osolmaz merged 3 commits intoopenclaw:mainfrom
osolmaz:fix/load-replay-session-update-suppression
Mar 1, 2026
Merged

fix: suppress replayed load session updates from output#38
osolmaz merged 3 commits intoopenclaw:mainfrom
osolmaz:fix/load-replay-session-update-suppression

Conversation

@dutifulbob
Copy link
Contributor

Summary

Fix replay leakage on reconnect/load by suppressing replayed session/update notifications at the ACP forwarding layer.

What changed

  • Added AcpClient replay gate: suppressReplaySessionUpdateMessages.
  • During loadSessionWithOptions(..., suppressReplayUpdates: true), suppress only inbound JSON-RPC notifications where method === "session/update".
  • Kept protocol flow intact (controller.enqueue(...)) and continued forwarding all non-session/update ACP messages.
  • Restored suppression state in finally and reset it on client close.
  • Extended mock agent to simulate replay-on-load:
    • --replay-load-session-updates
    • --load-replay-text <text>
  • Added integration coverage for the reconnect/load path:
    • replayed updates are not emitted in JSON output
    • non-update load request/response still visible
    • replayed updates are not written to session event log
    • live prompt chunk is still emitted and persisted

Why

Adapters may replay historical session/update notifications on session/load. Those were being forwarded raw, causing stale pre-turn output to leak to consumers like OpenClaw.

Validation

  • npm run typecheck
  • npm run lint
  • npm run format:check
  • npm run build
  • npm test

All passed locally.

@osolmaz osolmaz merged commit 3d452d5 into openclaw:main Mar 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants