Repository navigation
fix: keep concurrent node turns available during capacity updates - #164087
Conversation
Capacity, host-stat, and skill-bin publications no longer temporarily block unchanged pairing authority across connected nodes. Revocation, approval, failed-read blocks, and precommit ownership checks retain their fences. Add a deferred-worker regression and document Gateway-only update behavior. The owner fix adds five production lines under the bug-fix allowance. Validated on an isolated AWS lease: 145 focused/sibling tests, core and infra test typechecks, runtime build, targeted lint, and live concurrency/soak. Commit uses --no-verify because this sparse worktree has no dependencies; lease pnpm exec oxfmt --check passed for every changed file before commit.
|
🦞👀 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 3, 2026, 2:41 AM ET / 06:41 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR keeps node-hosted sessions available during capacity, host-statistics, and skill-bin updates, adds regression coverage, and documents Gateway-only upgrade behavior. Merge readiness✅ Ready for maintainer review Keep open: this focused repair remains necessary on current main and has no actionable correctness findings. The reported concurrency proof supports the intended outcome, and source inspection preserves the existing revocation fences. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway publishes pairing facts from its database worker so connected-node dispatch can check current authority without database access on the main thread. Node metadata updates pass through this same owner and affect session availability. flowchart TD
A[Node metadata updates] --> C[Pairing mutation owner]
B[Approval and revocation] --> C
C --> D{Authority can change?}
D -->|Yes| E[Block published authority]
D -->|No| F[Preserve usable authority]
E --> G[Publish committed pairing facts]
F --> G
G --> H[Check authority before node dispatch]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +94, Docs +4. Total +103 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the repair in the pairing publication owner, preserving current authority through metadata writes while retaining revocation and stale-publication fences. Do we have a high-confidence way to reproduce the issue? Yes: current source blocks all published node authority while a metadata mutation awaits its worker, and the PR records a matching real concurrency failure. This read-only review did not execute the scenario. Is this the best way to solve the issue? Yes: distinguishing identity-preserving operations at the existing publication owner fixes the interruption without adding another authority source or changing stored pairings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 88b1a534773a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Capacity, host-stat, and skill-bin publications no longer temporarily block unchanged pairing authority across connected nodes. Revocation, approval, failed-read blocks, and precommit ownership checks retain their fences. Add a deferred-worker regression and document Gateway-only update behavior. The owner fix adds five production lines under the bug-fix allowance. Validated on an isolated AWS lease: 145 focused/sibling tests, core and infra test typechecks, runtime build, targeted lint, and live concurrency/soak. Commit uses --no-verify because this sparse worktree has no dependencies; lease pnpm exec oxfmt --check passed for every changed file before commit.
Capacity, host-stat, and skill-bin publications no longer temporarily block unchanged pairing authority across connected nodes. Revocation, approval, failed-read blocks, and precommit ownership checks retain their fences. Add a deferred-worker regression and document Gateway-only update behavior. The owner fix adds five production lines under the bug-fix allowance. Validated on an isolated AWS lease: 145 focused/sibling tests, core and infra test typechecks, runtime build, targeted lint, and live concurrency/soak. Commit uses --no-verify because this sparse worktree has no dependencies; lease pnpm exec oxfmt --check passed for every changed file before commit. (cherry picked from commit 7a452b0) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes node-hosted turns failing reconciliation or stalling when another turn publishes worker-capacity updates.
User Impact
Concurrent node sessions keep their pairing authority while capacity, host statistics, and skill-bin metadata are updated. Update the Gateway; no node configuration, stored-pairing migration, or protocol change is required.
Why This Change Was Made
Pairing publication blocked every connected node while any pairing-store mutation was pending. Runner inventory writes session-host metadata on capacity updates, so ordinary concurrent turns could temporarily appear disconnected. The pairing owner now preserves usable authority only for the three metadata operations that cannot change pairing identity or generation. Revocation, approval, prior failed reads, epoch checks, and precommit ownership checks retain their existing fences.
The focused repair adds 5 production lines (+8/-3), using the campaign's small bug-fix allowance. Deleting unrelated code to offset this authority distinction would dilute the fix.
Evidence
device worker node is not connected with the supervisor dialect; another had a 28,878 ms tail. After: 12/12 turns across four sessions completed with ordered transcripts and no missing or duplicate inputs.pnpm test src/infra/device-pairing-publication.test.ts --maxWorkers=1: 13 passed, 4.43 s Vitest duration / 11.74 s total wall time. Hosted CI 37102981145 passed on exact head3ba04387fc5552f9e1c3ed288da8d7a4a472968d: 437 s total run wall time, 44 successful jobs, no failures or reruns. The hosted figure is whole-run time, not isolated test-file time.pnpm tsgo:core, the selected infra test typecheck, targeted oxlint, leaseoxfmt --checkon all four files, and theqaRuntimebuild passed. Independent Codex autoreview found no actionable findings.Warm-turn medians (five warm turns, same lease; milliseconds):
These small samples do not establish a tail-latency improvement. The node tail remains higher than local; this PR repairs the concurrency failure.
Additional live soak coverage and limits
The lab kit required two isolated harness corrections before useful proof: startup script names and waiting for
onHelloOkbefore RPCs. Neither is part of the product diff. No timing instrumentation is committed.