Skip to content

chore(node-host): cover password-missing supervisor exit - #137045

Merged
vincentkoc merged 1 commit into
mainfrom
test/node-host-password-missing-exit-20260903
Sep 3, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
test/node-host-password-missing-exit-20260903

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Related: #134142

What Problem This Solves

The CLI node host intentionally exits when the Gateway reports a terminal
token, password, bootstrap, or client-version reconnect pause so its supervisor
can restart it with refreshed credentials. The existing runner regression
coverage omitted the exact AUTH_PASSWORD_MISSING detail reported by the
Gateway upgrade incident.

Why This Change Was Made

This adds the missing password-auth case to the existing terminal-pause table.
The test keeps Gateway readiness pending, blocks MCP shutdown, and proves the
process cannot exit until MCP cleanup completes. Runtime behavior is unchanged.

User Impact

No user-visible behavior changes. The test protects the documented supervisor
restart policy and cleanup ordering for CLI nodes when a Gateway rejects a
reconnect because a password is missing.

Evidence

  • PATH="$HOME/.nodenv/versions/24.15.0/bin:$PATH" node scripts/run-vitest.mjs src/node-host/runner.test.ts (41 passed)
  • ./node_modules/.bin/oxfmt --write --threads=1 src/node-host/runner.test.ts
  • ./node_modules/.bin/oxlint --deny-warnings src/node-host/runner.test.ts
  • git diff --check
  • fresh Codex autoreview after the cleanup-order correction: clean, no accepted/actionable findings (0.99)

The prior ClawSweeper finding about pre-callback cleanup is addressed: the
runner remains live until onReconnectPaused, process.exit is asserted absent
while MCP close is pending, and exit status 1 is observed only after cleanup is
released.

@vincentkoc vincentkoc self-assigned this Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 3, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 2:10 AM ET / 06:10 UTC.

ClawSweeper review

What this changes

The PR adds missing-password reconnect-pause coverage to the node-host supervisor-exit test and verifies MCP cleanup completes before process exit.

Merge readiness

✅ Ready for maintainer review

The prior cleanup-order finding is addressed: the revised test holds startup pending, verifies MCP cleanup starts before exit, and releases exit only after cleanup. Keep this maintainer-authored, maintainer-labeled PR open for normal exact-head review and CI completion.

Priority: P3
Reviewed head: 3503101fff9deae48a63401be13140908fe7448c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, table-driven regression update that addresses the prior cleanup-order concern without production churn.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR changes only regression coverage; the external-contributor real-behavior proof gate does not apply. The reported focused Node 24 test result is supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR changes only regression coverage; the external-contributor real-behavior proof gate does not apply. The reported focused Node 24 test result is supplemental validation.
Evidence reviewed 4 items Introduced regression coverage: The PR adds AUTH_PASSWORD_MISSING to the existing terminal-pause table and keeps readiness pending while asserting MCP close completes before process.exit(1).
Current runtime contract: Current main classifies AUTH_PASSWORD_MISSING as terminal and invokes active runtime cleanup before process exit in the reconnect-pause callback.
Cleanup owner: The active node-host runtime joins MCP manager closure in its close promise, so the deferred MCP close used by the test is the production cleanup boundary.
Findings None None.
Security None None.

How this fits together

The CLI node host connects to the Gateway and owns local MCP clients. On terminal authentication or version reconnect pauses, it shuts those clients down before exiting so its supervisor can restart it safely.

flowchart LR
  Gateway[Gateway reconnect pause] --> Runner[CLI node host]
  Runner --> Decision[Terminal pause decision]
  Decision --> Cleanup[MCP client cleanup]
  Cleanup --> Exit[Supervisor-facing process exit]
  Exit --> Restart[Supervisor restart]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +24. Total +24 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 27 3 +24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 27 3 +24

Review metrics

Metric Value Why it matters
Production versus test delta production +0, tests +24 net (27 added, 3 removed) The change is confined to regression coverage and does not alter runtime behavior.

Technical review

Best possible solution:

Retain the focused table-driven regression test so future edits cannot omit MCP cleanup before a password-missing supervisor restart.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR adds regression coverage rather than reporting a separately reproducible runtime defect.

Is this the best way to solve the issue?

Yes: extending the existing parameterized terminal-pause test covers the omitted protocol detail without adding production seams or duplicate test structure.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 53066564532e.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR changes only regression coverage; the external-contributor real-behavior proof gate does not apply. The reported focused Node 24 test result is supplemental validation.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is a small, behavior-preserving regression-test improvement.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR changes only regression coverage; the external-contributor real-behavior proof gate does not apply. The reported focused Node 24 test result is supplemental validation.

Evidence

What I checked:

  • Introduced regression coverage: The PR adds AUTH_PASSWORD_MISSING to the existing terminal-pause table and keeps readiness pending while asserting MCP close completes before process.exit(1). (src/node-host/runner.test.ts:960, 3503101fff9d)
  • Current runtime contract: Current main classifies AUTH_PASSWORD_MISSING as terminal and invokes active runtime cleanup before process exit in the reconnect-pause callback. (src/node-host/runner.ts:63, 53066564532e)
  • Cleanup owner: The active node-host runtime joins MCP manager closure in its close promise, so the deferred MCP close used by the test is the production cleanup boundary. (src/node-host/runtime.ts:681, 3503101fff9d)
  • Main baseline and test-merge check: Main already contains the production password-missing exit behavior but lacks this table entry; the verified test merge changes only the test file and has no whitespace errors. (src/node-host/runner.test.ts:960, a0258b154202)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-03T05:54:04.777Z sha 086cb991d5860e9d41520227fced087b9a06390b :: needs changes before merge. :: [P2] Keep the runner alive while proving the added cleanup case

@vincentkoc
vincentkoc force-pushed the test/node-host-password-missing-exit-20260903 branch from 086cb99 to 3503101 Compare September 3, 2026 06:05
@vincentkoc
vincentkoc marked this pull request as ready for review September 3, 2026 06:05
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Addressed the cleanup-order finding on 3503101fff9: readiness stays pending,
MCP close is deferred, and the test proves process.exit(1) occurs only after
MCP cleanup completes. Focused Node 24 tests and fresh autoreview are clean.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 3, 2026
@vincentkoc
vincentkoc force-pushed the test/node-host-password-missing-exit-20260903 branch from 3503101 to 1c81a54 Compare September 3, 2026 06:24
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

CI found and we fixed the test mock return type on 1c81a544d3a: the deferred
MCP close now matches the existing Promise<undefined> contract. Focused Node
24 tests, format, oxlint, diff check, and fresh autoreview are clean.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc merged commit 9b09343 into main Sep 3, 2026
107 checks passed
@vincentkoc
vincentkoc deleted the test/node-host-password-missing-exit-20260903 branch September 3, 2026 06:38
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant