Skip to content

fix(gateway): stop update.run restart leaking to wrong channel (#18239)#18267

Merged
steipete merged 1 commit intoopenclaw:mainfrom
yinghaosang:fix/update-sentinel-delivery-context
Feb 16, 2026
Merged

fix(gateway): stop update.run restart leaking to wrong channel (#18239)#18267
steipete merged 1 commit intoopenclaw:mainfrom
yinghaosang:fix/update-sentinel-delivery-context

Conversation

@yinghaosang
Copy link
Contributor

@yinghaosang yinghaosang commented Feb 16, 2026

Summary

update.run doesn't capture deliveryContext in the restart sentinel payload, so post-restart confirmation messages can get routed to the wrong channel/recipient. The config handlers (config.patch, config.apply) were already fixed in 4104229 but update.run got missed.

Closes #18239

lobster-biscuit

Root Cause

update.run in src/gateway/server-methods/update.ts builds a RestartSentinelPayload with sessionKey but leaves deliveryContext and threadId undefined. After restart, scheduleRestartSentinelWake falls back to the session store's stale delivery route — which can point to a completely different channel/recipient than the one that triggered the update.

Changes

  • Before: update.run sentinel payload has no deliveryContext — restart handler falls back to stale session store data, potentially sending internal details to external contacts
  • After: update.run calls extractDeliveryInfo(sessionKey) (same pattern as config handlers) and includes both deliveryContext and threadId in the sentinel payload

Tests

  • update.test.ts — 3 cases: deliveryContext with sessionKey, undefined without sessionKey, threadId for threaded sessions. All fail before fix, pass after.
  • pnpm build && pnpm check pass
  • All 83 tests in src/gateway/server-methods/ pass

Greptile Summary

Fixes a channel-routing bug where update.run's restart sentinel payload omitted deliveryContext and threadId, causing post-restart confirmation messages to be routed to the wrong channel/recipient via stale session store data. The fix applies the same extractDeliveryInfo(sessionKey) pattern already used by config.patch and config.apply handlers.

  • Added extractDeliveryInfo call in update.run handler to capture deliveryContext and threadId from the session key before restart
  • Included both fields in the RestartSentinelPayload so scheduleRestartSentinelWake can route the post-restart message correctly
  • Added 3 test cases covering: delivery context with session key, undefined without session key, and thread ID for threaded sessions

Confidence Score: 5/5

  • This PR is safe to merge — it's a minimal, well-tested bug fix that follows an established pattern.
  • The change is a 3-line addition to update.ts that replicates an existing pattern from config.ts handlers. The fix addresses a real routing bug (deliveryContext missing from sentinel payload) with a proven approach. Tests cover all key scenarios. No risk of regression — the added fields are already expected by the RestartSentinelPayload type and consumed by scheduleRestartSentinelWake.
  • No files require special attention.

Last reviewed commit: d4f08a8

@steipete steipete merged commit aeec95f into openclaw:main Feb 16, 2026
27 checks passed
@sebslight sebslight self-assigned this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: restart sentinel leaks delivery context to unintended channel/recipient

3 participants