Repository navigation
fix(gateway): surface blocking startup progress - #124309
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 10:13 PM ET / August 17, 2026, 02:13 UTC. ClawSweeper reviewWhat this changesThe PR keeps Gateway admission blocked during required startup work, shows retryable startup progress in the TUI and Control UI, and consolidates sidecar shutdown ownership. Merge readinessKeep open for maintainer handling. The branch preserves startup-gated admission while adding presentation-only progress and a Gateway-owned shutdown barrier; no discrete patch defect was confirmed, but this availability-sensitive lifecycle change still needs its exact-head checks to finish. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway binds its transport, runs plugin/channel/worker sidecars, and only then admits startup-gated work. TUI and Control UI clients consume retryable startup responses to show progress without exposing an incomplete Gateway capability snapshot. flowchart LR
A[Gateway transport binds] --> B[Startup sidecars run]
B --> C[Gateway lifecycle tracks ownership]
B --> D[Retryable startup response]
D --> E[TUI progress state]
D --> F[Control UI progress splash]
C --> G[Ordered shutdown barrier]
B --> H[Ready Gateway admission]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +365, Tests +931. Total +1296 across 35 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one canonical Gateway lifecycle owner only after exact-head validation confirms startup progress, readiness gating, and ordered teardown together. Do we have a high-confidence way to reproduce the issue? Yes—high-confidence source reproduction exists in the focused Gateway lifecycle and Control UI retry tests, although this read-only review did not execute them. Is this the best way to solve the issue? Yes—the branch keeps the existing admission boundary and projects its retryable state to presentation clients, rather than exposing incomplete Gateway capabilities early. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a23d19218c5b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (30 earlier review cycles; latest 8 shown)
|
…ready # Conflicts: # ui/src/app/gateway-store.ts
…ready # Conflicts: # ui/src/app/gateway-store.ts
Related to #78954; intentionally does not close the broader core-ready request.
Problem
Managed Gateway startup waits for plugins, channels, workers, and sidecars. During that wait, presentation clients hid retry state: TUI looked disconnected and Control UI mounted login/error UI. Admitting clients earlier would expose an incomplete capability snapshot.
Root cause
The Gateway correctly reports startup as retryable
UNAVAILABLE, but shared clients had no presentation-only startup state. Deferred startup also lacked one coherent lifecycle owner: failure and close races could mask the causative startup error, stop teardown early, double-stop or orphan sidecars, retain rejected cleanup promises, or publish work after close. The final shutdown race was an incomplete barrier: late sidecar cleanup could begin after the initial drain and outlive transport teardown. Plugin services and worker placement also had creation-to-publication gaps, including the plugin service lazy-import boundary. TUI overloaded “connection attempt failed” and “previously connected transport was lost,” so a retry before the first hello later ran reconnect-only recovery.Fix
startupSettledtruthful through plugin, channel, worker, recovery, sidecar, and ready publication.Gateway starting…in TUI and every Control UI startup view, including manual-login retry; dedupe repeated startup snapshots.Exact proof
Head:
6dcba54b8909e2cea474eb4a6256fc7af35b2ed9origin/main16ecf0098396f522eabf0d3d59291dc5611019ea. One Control UI overlap preserved main'sreload-requiredprecedence over retryable startup presentation.pnpm tsgo,pnpm tsgo:test, andgit diff --checkpassed..artifacts/control-ui-e2e/gateway-starting-merge-6dcba54b/06-gateway-starting-progress.png(sha256:b6156bb9ddbcc67b3e3c870f7e1f4e60405d8a730cf2332729744aad905dc04f). Visual inspection confirms the centeredGateway starting…splash. One older configured-token case transiently missed its mocked request in the grouped run; its permitted isolation rerun passed 1/1. Hosted exact-head UI E2E is green..artifacts/control-ui-e2e/gateway-starting-final-f6825fe8/06-gateway-starting-progress.png(sha256:a118c1c3c5e9b53e39cab50300ce0c48521463469f467bcd14cd0ed614e44bf6). Six matching WebM recordings are in the same evidence directory. Visual inspection confirms the centered retryableGateway starting…splash before recovery.pnpm deadcode:exports,pnpm tsgo:test,pnpm tsgo,pnpm ui:i18n:baseline,pnpm build, Oxfmt, andgit diff --check: passed.31986940395: all selected exact-head jobs passed; requiredopenclaw/ci-gatepassed at6dcba54b8909e2cea474eb4a6256fc7af35b2ed9. No required, pending, or failed checks remain.main. OpenClaw fast-lane policy permits BEHIND drift and forbids refreshing solely becausemainadvanced; refresh remains required only forCONFLICTING.gateway ready; a real user DM (1276) receivedOPENCLAW_E2E_OK(1277) in 3394 ms through one mock-provider request; SIGTERM shutdown completed cleanly in 264 ms. Evidence:.artifacts/telegram-e2e/pr-124309-6dcba54b-final/summary.json(sha256:c5a086aaee2a0d208699d810f0b256c647a7264b9cce59a57e5349748b661d17).+763/-399(net+364); tests+1142/-240(net+902). Production growth is startup presentation plus one canonical lifecycle ownership/barrier capability and explicit TUI connection lineage; duplicate shutdown owners were removed.Review resolution
Final gates
openclaw/ci-gategreen; no pending or failed checks.No force-push performed.