Repository navigation
fix(workers): report full nodes as at capacity, not offline - #130445
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 6:34 PM ET / 22:34 UTC. ClawSweeper reviewWhat this changesThe PR makes existing sessions on connected but full remote worker nodes report capacity exhaustion rather than an offline-device error. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open. Current main still filters a connected full node out of discovery and reports it offline; this PR moves that distinction into the launch adapter and covers the relevant transitions. The maintainer-labeled PR still needs human confirmation and a successful exact-head required-check run. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherGateway worker launches look up a connected remote node, verify that a worker slot is available, and invoke its supervisor. The adapter turns those availability observations into an operator-visible result while the downstream launcher preserves the session placement. flowchart LR
A[Existing remote session] --> B[Gateway launch adapter]
B --> C[Connected node inventory]
C --> D{Node connected?}
D -->|No| E[Offline result]
D -->|Yes| F{Free worker slot?}
F -->|No| G[Capacity result]
F -->|Yes| H[Supervisor launch]
Decision needed
Why: This maintainer-labeled PR changes the operator-visible diagnostic for a live worker-session path, and the supplied exact-head check state is not yet green. Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +46. Total +50 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the connected-versus-full distinction in the launch adapter, retain the transition coverage, and land only after exact-head checks and maintainer confirmation of the operator-facing error contract. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main filters a zero-slot connected node out of discovery and then emits the offline path. The read-only review did not execute the failing baseline test. Is this the best way to solve the issue? Yes. The adapter owns the discovery-and-availability grace, its caller already distinguishes capacity from offline outcomes, and current docs describe those as separate operator conditions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d4c8aaa53672. LabelsLabel 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 (1 earlier review cycle)
|
|
Merged via squash.
|
* origin/main: (26 commits) fix(plugins): preserve registry epoch on activation rollback (#129232) refactor(plugins): make discovery invocation-owned (#130486) feat(ui): save appearance preferences per user profile (#130340) fix: Buzz bots recover relay stalls and reject revoked senders (#130467) fix(code-mode): serialize catalog handles nested in final values (#130276) fix(webchat): CLI skill and harness-injected turns render as operator-sent messages (#130427) fix(agents): read the published model catalog owner from session_status (#130277) fix(channels): preserve long presentation text (#130368) fix(agents): route CLI bootstrap truncation notice into the system prompt (#130325) refactor(plugins): unify setup registration and artifact selection (#130474) fix(memory): prevent forgotten session content from returning (#130451) refactor(outbound): consolidate transport completion (#130460) fix(workers): protect in-flight workspace manifests from concurrent retention (#130449) fix(portals): keep worker previews reachable and owned by the active environment (#130434) fix(config): keep core channels keys in the generated config schema (#120736) chore(deps): refresh dependencies after seven-day cooldown (#130296) fix(agents): remind exec models to quote shell metacharacters (#125485) fix(auth): honor shared-store ownership in temp-state exec and agent deletion (#130437) fix(openshell): preserve file writes during concurrent mirror commands (#130447) fix(workers): report full nodes as at capacity, not offline (#130445) ...
…#130445) * fix(workers): distinguish full nodes from offline runners * test(workers): follow conditional block style
What Problem This Solves
Fixes an issue where users sending a turn to an existing remote-node session were told the device was offline when it was connected but all worker slots were occupied. The incorrect reconnect guidance appeared after the bounded availability wait.
Why This Change Was Made
Node discovery combined device identity and free capacity in one filter, losing the distinction between a missing node and a full node. The launch adapter now retains the latest retryable observation and converts availability-grace expiry in one place. A connected full node produces the existing capacity error; an absent node retains the existing offline error.
The ten-second availability grace, durable supervisor admission, exact pairing/connection/authority checks, status/cancel access at capacity, and retryable placement behavior remain unchanged. No UI, config, protocol, permission policy, or storage changes. This aligns the existing node capacity/wait documentation rather than introducing a new operator contract.
Production +17/-13 (net +4); tests +52/-6 (net +46). The small growth records the missing capacity-versus-connectivity fact while removing duplicated timeout classification. AI-assisted.
User Impact
A saturated remote node reports capacity exhaustion rather than asking the operator to reconnect a healthy device. The session remains retryable after a slot becomes free. Nodes that actually disconnect still report offline.
Evidence
a482a50cda8850e9479d28a1ae29785a509841b2, fresh zero capacity producedThe device runner is offlinedespitenode.listconfirming the node remained connected.node scripts/run-vitest.mjs src/gateway/worker-environments/node-launch-adapter.test.tsfailed two new cases before the repair (2 failed, 19 passed). With the repair, this file plussrc/gateway/worker-environments/worker-turn-launcher-failure-recovery.test.tspassed all 31 tests.openclaw/ci-gate, onc65cdab10df2dc96f8efae79eb20582fc4359f28. This resolves the exact-head CI item below; no check was waived.Provenance: the capacity-as-connectivity filter came from #124356 (
dbad5e385d38, August 16), carried into exact slot inventory by #125708 (efaa867d934c, August 18). Both code author, PR author, and merger were @steipete. This repair preserves those intentional capacity gates and fixes their diagnostic classification.Test setup note: the diagnostic helper initially waited for a receipt for a capacity-rejected launch, which correctly has no durable receipt. The probe was corrected to distinguish rejected launches from admitted workers before the complete baseline above. A redundant dirty-checkout bootstrap rebuild was interrupted; candidate repetitions use the repository's documented prebuilt-dist E2E mode after a complete QA-enabled build.
Build provenance: the local build began while the repair was uncommitted on the baseline, so its pinned build stamp and the ad-hoc report's baseline SHA retain
a482a50cda8850e9479d28a1ae29785a509841b2. The candidate run contains the repaired adapter (confirmed in the emitted device-provider bundle); the subsequently committed production source is identical. Hosted CI validates the exact PR head separately. Ordinary PR CI was cancelled; the exact-head fallback run's lint runner received a shutdown signal (exit 143), not a lint diagnostic. Hosted validation is being recovered before landing.ClawSweeper follow-through (reviewed head
c65cdab10df2dc96f8efae79eb20582fc4359f28): no actionable correctness findings. Its two before-merge items are exact-head CI (still required) and the net-four-line production increase. The latter is accepted for the missing latest-observation fact at its existing owner, after consolidating duplicate expiry handling; removing the fact or moving classification downstream would recreate the bug. The generated stored-data-model warning does not apply: the complete two-file diff changes no schema, SQL, persistent shape, storage writer, or migration. The new observation is a launch-local variable, and the transport code is internal; no durable/protocol compatibility change is introduced. Final test LOC is +52/-6, correcting the review's older metric.Named infrastructure follow-up: hosted full-repository lint runner shutdowns. Fallback run 33018353920 lost its 4-vCPU/16-GB hosted runners during
oxlint:core; baseline-ratchets repeated the same shutdown on attempt 2, again exit 143 with no lint diagnostic. Its 20-minute job timeout had not elapsed. Normal PR CI run 33018340964, attempt 2, passed both lint and baseline-ratchets on the same source head. This PR changes no CI policy or lint execution settings; normal exact-head CI is being recovered rather than relaxing checks.