Commit 692d1fa
authored
fix(connect): exit zero when probe succeeds without platform evidence (#9282)
<!-- markdownlint-disable MD041 -->
## Summary
On macOS, `nemoclaw <name> connect --probe-only` completed the gateway
probe and any dashboard-forward recovery, then exited 1 because the
launch-readiness evidence store requires a Linux per-user runtime
authority (`/run/user/<uid>`). The permanent platform gap turned every
successful probe into a failure, so a scripted health check could not
tell a healthy sandbox from a real outage. After this change, a
successful probe and recovery on such a platform prints a note that
evidence is unavailable and exits 0.
## Related Issue
Closes #9278
## Changes
- `src/lib/actions/sandbox/connect.ts`: when publication reports
`evidence-failed` and the readiness decision carries
`authorityUnsupported` (thrown only for non-Linux platforms in
`src/lib/state/launch-readiness-lease.ts`), print `Note:
launch-readiness evidence is unavailable on this platform; the next
launch runs the complete preflight.` and return with exit 0. A
publication failure on a platform that supports evidence keeps `Probe
failed: ...` and exit 1. Fence failures, validation failures, and
unsafe-epoch exits are unchanged.
- `src/lib/actions/sandbox/connect-flow.test.ts`: the macOS-shaped case
now asserts recovery completes, the note prints, and the command
resolves with no exit call. The sibling cases for Linux publication
failure and validation failure still assert exit 1.
- `test/cli/connect-recovery.test.ts`,
`test/cli/connect-terminal-agent.test.ts`,
`test/sandbox-connect-inference/auto-pair-approval.test.ts`: probe-only
now expects exit 0 on every platform; the note substring still appears
only on darwin.
- `docs/reference/commands.mdx`,
`docs/manage-sandboxes/recover-rebuild-sandboxes.mdx`: state the new
macOS behavior and scope the nonzero publication-failure exits to Linux.
### Design record
PR #8951 (#8942 launch-readiness leases) recorded the previous contract:
macOS probe-only "completes recovery and probes, then returns nonzero
because authoritative evidence is unavailable." This PR narrows that
decision for the permanent platform gap only, per the QA expectation in
#9278: the probe's product operation succeeded, `launch` runs the
complete preflight without evidence on these platforms, and no consumer
relies on the macOS nonzero exit. Verified consumers: internal
probe-only callers (`start.ts`, `hermes-cron-restore-recovery.ts`) pass
`requireLaunchReadinessPublication: false` and return before the changed
branch; the E2E lease producer (`test/e2e/live/launch-agent-turn.ts`)
requires exit 0; managed-cloud checks treat probe-only nonzero as
failure. Linux infrastructure-producer strictness is untouched: a broken
`/run/user/<uid>` classifies as `missing`, not `unsupported`, and still
exits nonzero.
## Type of Change
- [x] Code change with doc updates
## Quality Gates
- [x] Tests added or updated for changed behavior
- [x] Docs updated for user-facing behavior changes
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: requested through this
PR's maintainer review (sandbox connect path)
## Documentation Writer Review
- [x] Documentation writer subagent reviewed the completed changes
- Result: `docs-updated`
- Evidence: `docs/reference/commands.mdx`,
`docs/manage-sandboxes/recover-rebuild-sandboxes.mdx`; review verified
the changed sentences against `src/lib/actions/sandbox/connect.ts` and
the controlled-word list, and its one accuracy suggestion (scoping
`commands.mdx:1277` to Linux) is applied in this commit
- Agent: Claude Code
<!-- docs-review-head-sha: 8b5f742 -->
<!-- docs-review-agents-blob-sha: e30afb2 -->
## Verification
- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run validate:pr` passed after refreshing `origin/main` when hooks
were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result: `npx vitest run
src/lib/actions/sandbox/connect-flow.test.ts` 35/35 passed; `npx vitest
run test/cli/connect-recovery.test.ts
test/cli/connect-terminal-agent.test.ts` 6/6 passed; `npx vitest run
test/sandbox-connect-inference/auto-pair-approval.test.ts` 9/9 passed;
`npm run typecheck:cli` clean
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [x] `npm run docs` builds without warnings (doc changes only) — exits
0; the 2 remaining warnings (fern auth, theme contrast) exist on `main`
before this change
### macOS verification plan
The Linux CI lanes exercise the unchanged behavior. The darwin branch is
covered by the unit test (platform-independent readiness-decision shape)
and will be verified on an Apple Silicon Mac against the exact #9278
repro (`connect --probe-only` on a healthy sandbox, then the
forward-recovery variant); evidence will be posted as a PR comment.
---
Signed-off-by: Dongni Yang <dongniy@nvidia.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* macOS `connect --probe-only` now completes recovery successfully when
launch-readiness evidence is unavailable.
* Probe-only checks consistently return exit code `0` when core checks
pass.
* macOS evidence limitations are clearly reported as informational notes
rather than failures.
* Linux readiness and publication failures continue to return nonzero
results with appropriate diagnostics.
* **Documentation**
* Clarified platform-specific probe-only behavior and subsequent launch
checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: Dongni Yang <dongniy@nvidia.com>1 parent 8b9a28a commit 692d1fa
7 files changed
Lines changed: 35 additions & 20 deletions
File tree
- docs
- manage-sandboxes
- reference
- src/lib/actions/sandbox
- test
- cli
- sandbox-connect-inference
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1273 | 1273 | | |
1274 | 1274 | | |
1275 | 1275 | | |
1276 | | - | |
1277 | | - | |
| 1276 | + | |
| 1277 | + | |
1278 | 1278 | | |
1279 | 1279 | | |
1280 | 1280 | | |
1281 | 1281 | | |
1282 | 1282 | | |
1283 | 1283 | | |
1284 | | - | |
1285 | | - | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
1286 | 1288 | | |
1287 | 1289 | | |
1288 | 1290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
638 | | - | |
| 638 | + | |
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | | - | |
654 | | - | |
655 | | - | |
| 653 | + | |
656 | 654 | | |
657 | 655 | | |
658 | 656 | | |
659 | 657 | | |
660 | | - | |
661 | | - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
662 | 661 | | |
| 662 | + | |
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1332 | 1332 | | |
1333 | 1333 | | |
1334 | 1334 | | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1335 | 1346 | | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
| 1347 | + | |
1339 | 1348 | | |
1340 | 1349 | | |
1341 | 1350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
0 commit comments