- Extract parseDeliveryContextFromParams() into restart-request.ts and
import it in both config.ts and update.ts, eliminating the duplicated
inline IIFE parsing in update.ts
- Add comment in gateway-tool.ts explaining why agentThreadId is
intentionally excluded from liveDeliveryContextForRpc: threadId is
reliably derived server-side from the session key via
parseSessionThreadInfo() and is not subject to heartbeat contamination
- Add beforeEach(vi.clearAllMocks) to server-restart-sentinel.test.ts
and remove ad-hoc mockClear() calls from individual tests to prevent
mock state from leaking between test cases