Repository navigation
improve(worker): diagnose admission-deadline failures and widen daemon revalidation budget - #130435
Conversation
…n revalidation budget WorkerAdmissionDeadlineExceededError now carries the terminal diagnosis — the last connection failure kind and detail, attempt count, and the redacted endpoint — instead of a bare deadline sentence, and that text flows through IPC, container stderr, the node launch journal, and the gateway turn error. Credential material (raw, URL-encoded, JSON-escaped) is scrubbed before truncation. A LAN partition was misdiagnosed as a gateway admission wedge for a day because the old text was identical for never-connected and never-answered (#129979). Container daemon revalidation gets a 30s budget: a slammed-but-healthy OrbStack daemon exceeded the old 5s under a 50-container burst; fail-closed semantics unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 5:54 PM ET / 21:54 UTC. ClawSweeper reviewWhat this changesThe PR adds redacted, classified worker-admission deadline errors and raises pinned container-daemon revalidation from five to thirty seconds. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: this maintainer-owned PR has no blocking correctness finding and addresses the diagnostic owner without weakening daemon identity fencing. Exact-head CI remains the normal landing gate. Likely related people: steipete (high confidence, recent worker and node-host feature history). Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherGateway-launched workers must complete authenticated admission before running a turn. The node host records worker failures in a launch journal, which becomes the Gateway turn error seen by operators. flowchart LR
A[Gateway turn] --> B[Node host launch]
B --> C[Worker admission]
C --> D{Connection result}
D -->|ready| E[Worker runs turn]
D -->|deadline or rejection| F[Redacted launch journal]
F --> G[Gateway turn error]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +62, Tests +186, Docs +11. Total +259 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain failure classification and pre-output redaction at the WorkerConnection owner, and retain the thirty-second budget only for the pinned identity revalidation that still fails closed on daemon drift. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main emits the generic deadline error and uses the five-second pinned-daemon query, while the branch’s focused tests inject those paths. This read-only review did not run the farm scenario. Is this the best way to solve the issue? Yes: recording the last failure at WorkerConnection and propagating it through existing IPC and journal flow is the clean owner-boundary fix; the timeout changes only pinned revalidation, not identity fencing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 99a2434f7b89. 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
|
|
Merged via squash.
|
* origin/main: (275 commits) fix(ai): require explicit compatible-provider endpoints (#130453) test(control-ui): guard the hand-mirrored theme --bg copies (#130444) fix(onboard): preserve the saved skills package manager (#130438) improve(worker): diagnose admission-deadline failures and widen daemon revalidation budget (#130435) fix(plugins): align diffs external install metadata (#130362) refactor(models): consolidate config normalization (#130439) fix(browser): accept common keyboard aliases (#130401) fix(release): refresh IMAP plugin baselines (#130351) fix(tests): type sticky model agent fixtures (#130441) fix(qa): track current Slack progress cards (#130354) feat(ui): refine the mobile composer (#130308) fix(ui): clarify gateway disconnect status in tab title (#130364) test(qa): await gateway startup before network probes (#130353) fix(qa): run Buzz profile scenarios with pooled credentials (#130316) fix(crabbox): keep the setup failure reason and name its phase (#130425) fix: dashboard tools target the wrong Gateway after admission (#130112) fix(ui): distinguish inherited model defaults from session pins (#120805) feat(feishu): let agents resend received stickers (#130374) refactor(models): prepare selection policy once (#130413) fix(ui): make dashboard side panels enter split view (#130426) ... # Conflicts: # test/scripts/docker-build-helper.test.ts
…rker turns, defer debris cleanup (#130446) * fix(workers): re-arm admission-deadline launches, terminalize dead-worker turns, defer debris cleanup Three lifecycle repairs from the 50-worker campaign (#129979): the gateway launch adapter re-arms a launch up to five times (exponential backoff with jitter, caller-deadline capped, deterministic derived launch/turn ids so adapter replays find the same journal rows) when the node journal proves the child died on the admission deadline — credential/build rejections and post-start failures stay terminal; stuck-turn recovery records a terminal failure once a journal-terminal worker has no claim past a 30s cleanup grace instead of skipping keep_lane forever; and startup recovery defers orphan git cleanup for terminal placements into the first tracked background sweep (50-placement fixture: 50 startup git scans to zero, ~556ms to ~5ms) while pending-result recovery and ownership fences stay ahead of readiness. * fix(workers): use the diagnosed admission-deadline message after #130435 rebase WorkerConnection now formats the redacted last-failure diagnosis into the deadline error itself, so the runtime's re-format (and its lastConnectionFailure tracking) is redundant; errorText uses error.message. * fix(workers): cap admission re-arms within the minted credential lifetime Re-arms reused the credential minted before the first admission attempt, so with five 120s windows plus backoff the final advertised retry could start after the credential expiry and fail closed as credential-expired. The launcher now threads credential.expiresAtMs through the tunnel launch request, and the adapter re-arms only while the retried child still gets a full admission window (WORKER_ADMISSION_DEADLINE_MS, now shared from the connection contract) on the original credential; otherwise it returns the terminal admission result. Expiry-boundary tests walk both sides.
…n revalidation budget (openclaw#130435) WorkerAdmissionDeadlineExceededError now carries the terminal diagnosis — the last connection failure kind and detail, attempt count, and the redacted endpoint — instead of a bare deadline sentence, and that text flows through IPC, container stderr, the node launch journal, and the gateway turn error. Credential material (raw, URL-encoded, JSON-escaped) is scrubbed before truncation. A LAN partition was misdiagnosed as a gateway admission wedge for a day because the old text was identical for never-connected and never-answered (openclaw#129979). Container daemon revalidation gets a 30s budget: a slammed-but-healthy OrbStack daemon exceeded the old 5s under a 50-container burst; fail-closed semantics unchanged.
…rker turns, defer debris cleanup (openclaw#130446) * fix(workers): re-arm admission-deadline launches, terminalize dead-worker turns, defer debris cleanup Three lifecycle repairs from the 50-worker campaign (openclaw#129979): the gateway launch adapter re-arms a launch up to five times (exponential backoff with jitter, caller-deadline capped, deterministic derived launch/turn ids so adapter replays find the same journal rows) when the node journal proves the child died on the admission deadline — credential/build rejections and post-start failures stay terminal; stuck-turn recovery records a terminal failure once a journal-terminal worker has no claim past a 30s cleanup grace instead of skipping keep_lane forever; and startup recovery defers orphan git cleanup for terminal placements into the first tracked background sweep (50-placement fixture: 50 startup git scans to zero, ~556ms to ~5ms) while pending-result recovery and ownership fences stay ahead of readiness. * fix(workers): use the diagnosed admission-deadline message after openclaw#130435 rebase WorkerConnection now formats the redacted last-failure diagnosis into the deadline error itself, so the runtime's re-format (and its lastConnectionFailure tracking) is redundant; errorText uses error.message. * fix(workers): cap admission re-arms within the minted credential lifetime Re-arms reused the credential minted before the first admission attempt, so with five 120s windows plus backoff the final advertised retry could start after the credential expiry and fail closed as credential-expired. The launcher now threads credential.expiresAtMs through the tunnel launch request, and the adapter re-arms only while the retried child still gets a full admission window (WORKER_ADMISSION_DEADLINE_MS, now shared from the connection contract) on the original credential; otherwise it returns the terminal admission result. Expiry-boundary tests walk both sides.
What Problem This Solves
Two diagnosability/tuning items from the 50-worker farm campaign (#129979):
WorkerAdmissionDeadlineExceededErrorwas a bare "worker admission deadline exceeded" — identical whether the worker's TCP dials never connected (network partition), the socket opened but no hello arrived, or admission was retryably rejected. During the campaign this masked a LAN partition as a gateway admission wedge for a full day of misdiagnosis.docker infounder a 5s timeout; under a 50-container burst a slammed-but-healthy OrbStack daemon exceeded it and correctly failed a launch closed — but the budget, not the daemon, was the problem.Why This Change Was Made
host:port, never URLs with material). That text propagates end-to-end: worker IPC / container stderr → node launch journalerror_text→ gateway turn error. Credential material is scrubbed in raw, URL-encoded, and JSON-escaped forms before truncation so a cut credential can never escape into stderr or the journal.User Impact
A node worker that dies on a flaky network now records why ("connect failed: Opening handshake has timed out … after N attempts to 192.168.x.x:19801") wherever operators look — the session error,
openclawlogs, and the launch journal — instead of a sentence that reads like a gateway bug. Burst launches on a loaded container daemon no longer fail spuriously at 5s.Evidence
Regressions verified failing pre-fix: dial-failure-to-deadline carries the failure kind + endpoint; open-socket-no-hello carries that variant; fenced/retryable close behavior unchanged; slow-but-within-budget engine revalidation succeeds while the timeout message still names the command. Full sweep: 617 passed / 4 skipped across src/worker, src/node-host, tunnel and turn-launcher failure-recovery suites;
pnpm check:changedgreen; Codex autoreview clean (0.99). Production delta +91/−32 (diagnostic state + redaction, minus removed downstream reformatting); tests +235/−46.Context: #129979