Repository navigation
Conversation
`does not stop the routed sandbox proxy when registry removal does not complete`
asserted that `withGatewayRouteMutationLock` was never taken. That lock stopped
identifying the routed teardown once the final gateway cleanup began taking it
too, so the test fails on `main` and in the macOS and WSL compatibility jobs:
AssertionError: expected "withGatewayRouteMutationLock" to not be called at
all, but actually been called 1 times
The behavior the test protects is intact. `removeSandboxRegistryEntryOutcome`
maps a `removeSandbox` result of `false` to `{ status: "not-found", removed:
false }`. `removed` stays false, so the routed teardown is skipped and
`stopModelRouterForDestroyedSandbox` is never called. `registryEntryAbsent`
covers `not-found` as well as `complete`, so the final gateway cleanup still
runs and takes the lock once, as its own comment describes for a retry.
Assert the teardown instead of the lock that guards it, and record why the lock
no longer distinguishes the two paths.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAoaWK8T98zLhCzNUk6RZF
Signed-off-by: Vishnu Rajeev <19866703+VishnuR23@users.noreply.github.com>
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA/NemoClaw/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. 📝 WalkthroughWalkthroughThe routed teardown test no longer asserts that ChangesSandbox teardown
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Closing this — the failure it repaired no longer reproduces, so the change would now remove an assertion that holds. When I opened this, On CI agrees. Run No commit changed the test or its harness setup in that range. The gate moved from One correction to carry forward, since the analysis in the PR body still holds and may be useful if this resurfaces: the lock was never exclusive to the routed teardown. I instrumented the spies in the failing case at the time and recorded
|
Outcome
src/lib/actions/sandbox/destroy-flow.test.tspasses again, and the case that #9098 protects is still asserted.Reason
The test asserted that
withGatewayRouteMutationLockwas never taken when registry removal did not complete:That worked while the routed Model Router teardown was the only holder of that lock.
destroySandboxnow takes the same lock for its final gateway cleanup, so the assertion fails onmain:The protected behavior is intact.
removeSandboxRegistryEntryOutcomemaps aremoveSandboxresult offalseto{ status: "not-found", removed: false }:removedstaysfalse, so the routed teardown block stays skipped andstopModelRouterForDestroyedSandboxis never called.registryEntryAbsentacceptsnot-foundas well ascomplete, so the final gateway cleanup still runs and takes the lock once — the retry case its own comment describes:// A retry after successful registry removal still owns final gateway cleanup.So the lock acquisition is correct and the assertion on it was the stale part.
Changes
stopModelRouterForDestroyedSandboxis not called, which is the behavior [Ubuntu 24.04][Inference] Model Router proxy survives sandbox destroy and blocks the next Model Router onboard #9098 protects, and stop asserting on the lock that now guards two paths.No production change.
Verification
Confirmed the lock acquisition belongs to the final gateway cleanup and not the routed teardown, by instrumenting the spies in the failing case before making the change:
The router teardown never runs, so the single acquisition is the final cleanup.
npx vitest run --project cli src/lib/actions/sandbox/destroy-flow.test.ts— 72 passed (1 failed before).npx vitest run --project cli destroy-flow.test.ts destroy-podman-cleanup-flow.test.ts destroy.test.ts— 3 files, 87 tests passed.destroy-podman-cleanup-flow.test.tsexercises the sameremoveSandboxResult: falsesetup.npx oxlintandnpx oxfmt --checkon the changed file — passed.Where this reproduces
Not macOS-only. Run
35499788663onmainatf2c0316fcfails the same test with the same message inmacOS compatibility (1/4)andWSL compatibility (1/4). Theplatform-vitest-main.yamlworkflow has failed on each of its six most recentmainruns.That run also reports two failures this PR does not address, in case they are not already tracked:
src/lib/onboard/gateway/automatic-port-completion.test.ts—promotes the trusted pending marker after direct onboarding succeeds (#10824)test/e2e/support/openshell-exact-main-driver-config.test.ts—resolves one canonical executable set for CLI, gateway, and sandbox (#11547)🤖 Generated with Claude Code
https://claude.ai/code/session_01VAoaWK8T98zLhCzNUk6RZF
Summary by CodeRabbit