Repository navigation
Conversation
Extend the existing request parking owner to reconnect bootstrap reads. Respect server retry floors with one probe per connection, retain pause revisions, and preserve cancellation and request deadlines. A real isolated Gateway restart reduced rejected bootstrap calls from 150 to 10, with bootstrap recovery 4 ms after the replacement hello. Remote gateway-client and UI tests, runtime build, and the changed-check gate passed.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 2:53 PM ET / 18:53 UTC. ClawSweeper reviewWhat this changesThe PR coordinates five Gateway bootstrap requests during restart or suspension, allowing one delayed probe before resuming queued reads. Example: The Control UI reloads data during a Gateway restart
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR earns its place: current main does not cover the bootstrap retry storm, real Gateway evidence supports the improvement, and no actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared Gateway client carries requests from browser and Node clients over WebSocket. Its pending-request owner coordinates response matching, deadlines, cancellation, and recovery while the Gateway temporarily refuses work. flowchart TD
A[Browser and Node bootstrap reads] --> B[Shared pending requests]
C[Restart refusals and lifecycle notices] --> B
B --> D{Gateway paused?}
D -->|No| E[Gateway WebSocket]
D -->|Yes| F[Queue with original deadlines]
F --> G[One delayed probe]
G --> E
E -->|Successful current probe or readiness| B
Technical reviewBest possible solution: Keep restart recovery in the shared pending-request owner, with one bounded probe and unchanged request lifetimes. Do we have a high-confidence way to reproduce the issue? Yes: current main lacks coordinated restart parking, and the supplied real-Gateway baseline records 150 rejected bootstrap calls during a controlled restart drain. Is this the best way to solve the issue? Yes: extending the existing shared request owner avoids competing retry policies while preserving cancellation, deadlines, and write behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1339b6fd3e73. Provenance checked
TestingProof path: shipped entry point. Added test files: 1. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +62, Tests +278, Docs +2. Total +342 across 4 files. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment |
The restart bootstrap change in d51345a (#167407) intentionally parks sessions.list while the Gateway is draining or prepared. The two suspension fixtures waited for that roster before they could emit accepting. Use the existing initial-roster opt-out at those fixture owners, retaining all lifecycle, loading, failure, empty-state, and recovery assertions.
) Extend the existing request parking owner to reconnect bootstrap reads. Respect server retry floors with one probe per connection, retain pause revisions, and preserve cancellation and request deadlines. A real isolated Gateway restart reduced rejected bootstrap calls from 150 to 10, with bootstrap recovery 4 ms after the replacement hello. Remote gateway-client and UI tests, runtime build, and the changed-check gate passed.
The restart bootstrap change in 6f07486 (openclaw#167407) intentionally parks sessions.list while the Gateway is draining or prepared. The two suspension fixtures waited for that roster before they could emit accepting. Use the existing initial-roster opt-out at those fixture owners, retaining all lifecycle, loading, failure, empty-state, and recovery assertions.
What Problem This Solves
Fixes repeated bootstrap RPC rejections while a connected Gateway drains for restart. Identity reads, session subscriptions, groups, pending questions, and session lists previously retried independently against the same unavailable connection.
User Impact
The Control UI waits through the restart window and resumes loading on readiness or reconnect. Browser and embedded web views share this client. Original request deadlines and cancellation remain effective, and writes are never replayed. No configuration or stored-data changes.
Why This Change Was Made
Extend the protocol client's existing identity suspension parking to the five bootstrap methods and structured restart refusals/shutdown notices. One jittered probe honors the longest outstanding server retry hint (at least five seconds for restart). Only a successful probe of the current pause revision releases the queue. Canceled or expired reads cannot become probes.
A bounded probe is necessary because a restart signal fence can roll back without a readiness event or socket replacement. An empty expired pause therefore lets the next read probe immediately. This complements #167020's read-acknowledgement pacing.
Production LOC: +62 net (85 added, 23 removed; tests/docs excluded). The identity-only path is replaced in place. Growth is required for four additional idempotent methods and the existing deadline, cancellation, and connection-generation contracts while enforcing a single probe. There is one pause owner and no additional retry scheduler or configuration.
Evidence
Real isolated Gateway, synthetic state, two scripted protocol clients sharing the same SIGUSR2 restart and 30,001 ms admitted-RPC hold. Each client retries the five-method bootstrap batch after one second when it settles. Baseline client source:
7d59b5b98bd00aef301c9f7ef33a991be8e86d5c.15× fewer rejected calls, exceeding the 10× target. Both clients recovered; independent reconnect jitter explains the small difference in total recovery time.
Remote proof uses Crabbox provider aws, lease cbx_7122670587a7, after Blacksmith Testbox tbx_01m4e6qh92ybq0cvbqpccmtxkj completed an earlier gate but timed out syncing subsequent corrections. Both leases were stopped after use.
node scripts/run-vitest.mjs packages/gateway-client/src/protocol-client.request.test.ts --maxWorkers=1: 22 passed, 1.20 s Vitest / 2.34 s wrapper wall time.node scripts/run-vitest.mjs packages/gateway-client/src/*.test.ts: 373 passed across 27 files, 8.73 s wall time.node --import ./scripts/tsx.mjs scripts/build-all.mts sourcePerformance: passed, 51.4 s.node scripts/check-changed.mjs -- docs/web/control-ui.md packages/gateway-client/src/pending-request.ts packages/gateway-client/src/protocol-client.ts packages/gateway-client/src/protocol-client.request.test.ts: passed, including production/test types, formatting, lint, dead exports, and repository guards.No rendered UI changes or browser automation. This proves the shared protocol bootstrap; native Swift UI interaction and device behavior were not exercised. Remote proof ran on base
7d59b5b98bd0; the patch was rebased unchanged onto082c68a9cbd8before publication. All four changed files retained identical hashes. Exact-head CI passed in 547 seconds (46 successful jobs, 22 scope-skipped jobs; no reruns). The PR merged asd51345aaf72c.