Skip to content

test(e2e): validate native GPU sandbox topology - #7040

Merged
apurvvkumaria merged 8 commits into
mainfrom
codex/5662-gpu-native-route-validation
Jul 17, 2026
Merged

test(e2e): validate native GPU sandbox topology#7040
apurvvkumaria merged 8 commits into
mainfrom
codex/5662-gpu-native-route-validation

Conversation

@apurvvkumaria

@apurvvkumaria apurvvkumaria commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Strengthen the existing Linux GPU onboarding acceptance so release sign-off proves the ordinary native OpenShell GPU route leaves one healthy sandbox container. The live test now fails if legacy container-swap behavior or a stopped backup sibling remains, even when the patched container itself appears healthy.

Related Issue

Fixes #5662

Changes

  • Require the native GPU route marker in the onboarding log.
  • Reject legacy recreation and Docker GPU-mode markers.
  • Inventory all labeled sandbox containers with docker ps -a, including stopped siblings.
  • Require exactly one sandbox container and reject legacy backup topology.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: this test-only change validates existing native GPU routing and container topology; it changes no command, option, default, or runtime behavior.
  • 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: maintainer review confirmed the assertions are confined to the existing GPU live lane, include stopped containers, and fail closed on legacy backup topology.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — Biome, CLI/plugin builds, CLI typecheck, repository checks, live-test collection, and git diff --check passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Apurv Kumaria akumaria@nvidia.com

Summary by CodeRabbit

  • Tests
    • Enhanced GPU install validation to capture and analyze the complete installer output, confirming direct sandbox GPU enablement.
    • Added assertions to prevent unexpected sandbox/container recreation and to ensure “Docker GPU mode selected” messaging is absent.
    • Strengthened container checks to require exactly one running, healthy native GPU route container (excluding the backup variant).
    • Added post-inference verification that the sandbox reports Phase: Ready.
    • Added a helper and unit coverage to robustly detect Phase: Ready even when output includes ANSI formatting.

Co-authored-by: hulynn <lynnh@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria apurvvkumaria added Recommended Blocker Recommended release blocker for maintainer review bug-fix PR fixes a bug or regression v0.0.85 labels Jul 16, 2026
@apurvvkumaria apurvvkumaria self-assigned this Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The GPU E2E test validates direct sandbox GPU enablement, confirms one running and healthy native GPU container remains, and verifies the sandbox returns to the Ready phase after inference.

Changes

GPU E2E validation

Layer / File(s) Summary
GPU proof and container checks
test/e2e/live/gpu-e2e.test.ts
Captures the install log, asserts GPU enablement and absent container-recreation messages, then verifies the labeled sandbox container count, name, running state, and health status.
Post-inference readiness check
test/e2e/live/gpu-e2e-helpers.ts, test/e2e/live/gpu-e2e.test.ts, test/e2e/support/gpu-e2e-helpers.test.ts
Adds ANSI-normalized exact Phase: Ready detection, uses it after routed inference, and tests Ready and non-Ready phase output.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: platform: ubuntu, area: e2e, area: sandbox

Suggested reviewers: prekshivyas

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: strengthening native GPU sandbox validation for the e2e flow.
Linked Issues check ✅ Passed The updated e2e test now enforces the native GPU route, healthy container state, and exact Ready phase after inference, matching #5662.
Out of Scope Changes check ✅ Passed The changes stay focused on GPU onboarding e2e coverage and the helper/test support for the new phase assertion.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/5662-gpu-native-route-validation

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage remains at 96%, unchanged from the main branch.

TypeScript / code-coverage/cli

The overall coverage in the codex/5662-gpu-nativ... branch remains at 80%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main c5b8dba codex/5662-gpu-nativ... 87ff00f +/-
src/lib/state/registry.ts 86% 83% -3%
src/lib/inference/local.ts 80% 82% +2%
src/lib/credentials/store.ts 59% 64% +5%
src/lib/inferen...er-lifecycle.ts 65% 71% +6%
src/lib/core/pr...mpt-activity.ts 67% 92% +25%
src/lib/inferen...lama/process.ts 50% 100% +50%

Updated July 17, 2026 00:34 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/e2e/live/gpu-e2e.test.ts`:
- Around line 197-223: The sandbox container assertion currently checks only
that one labeled container exists. Update the docker query and parsing around
sandboxContainerNames to retrieve container status and health, then assert the
retained container is running and healthy while preserving the
exactly-one-container requirement.
- Line 195: Update the negative assertion in the GPU end-to-end test to reject
the complete “Docker GPU mode selected” marker, including variants without a
trailing colon. Ensure the native-route gate checks the same substring used by
the shared helper rather than only the colon-suffixed form.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f4d8a998-ebd6-472c-b3c9-a05296e9a5ff

📥 Commits

Reviewing files that changed from the base of the PR and between b485249 and bebde17.

📒 Files selected for processing (1)
  • test/e2e/live/gpu-e2e.test.ts

Comment thread test/e2e/live/gpu-e2e.test.ts Outdated
Comment thread test/e2e/live/gpu-e2e.test.ts
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: No actionable findings remain in the canonical review ledger.

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized E2E selections differ; severity counts match.

Nemotron output stays in workflow artifacts and does not change the assessment above.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-onboard, credential-sanitization, security-posture, gpu-e2e

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking exact head bebde17 on two valid exact-head CodeRabbit findings before authorizing the live GPU plan. Align the negative oracle with the shared helper by rejecting the complete Docker GPU mode selected substring (not only the colon-suffixed variant). Also make the topology inventory prove the sole retained labeled container is running and healthy, not merely present/name-matched; preserve the exactly-one and no-backup assertions. Then run the focused mismatch/unit coverage and request trusted GPU E2E authorization/rereview.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addendum at bebde17: exact-head Advisor Nemotron also identifies a valid acceptance gap from #5662. nemoclaw status can exit 0 while rendering a non-Ready phase, so GPU/CUDA/topology checks can mask Error/Starting. Add an explicit OpenShell sandbox Phase: Ready assertion—preferably after routed inference—alongside the complete legacy-marker rejection and running/healthy exactly-one-container proof already requested.

Co-authored-by: hulynn <lynnh@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed exact head 6cdf24f. The marker and running/healthy-container blockers are fixed. One acceptance blocker remains: #5662 defines the closure signal as OpenShell Phase: Ready plus CUDA proof and no legacy swap, but this test still relies on nemoclaw status exit 0/CUDA text and never asserts the OpenShell sandbox phase. nemoclaw status can exit zero while rendering a non-Ready phase. Please add a fail-closed exact openshell sandbox get/list assertion for Phase: Ready (preferably after routed inference), then run the authorized cloud-onboard, credential-sanitization, security-posture, and gpu-e2e plan on the refreshed head.

Co-authored-by: hulynn <lynnh@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

Addressed the remaining review gate at exact head dc94801fbf526dc0f2d70fa90b7a942ba448a650. The trusted GPU E2E now queries openshell sandbox get after routed inference succeeds and requires an exact trimmed Phase: Ready line, so a merely exit-zero but non-ready sandbox fails closed. The focused E2E helper suite, project-membership check, Biome, hooks, and full diff check all pass; the commit is GitHub Verified and preserves the original author as co-author. @cv please re-review this exact head.

cjagwani and others added 3 commits July 16, 2026 12:59
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Co-authored-by: Charan Jagwani <cjagwani@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
@apurvvkumaria

Copy link
Copy Markdown
Collaborator Author

Exact head 2bd90d62ecff2b49183b8573b7d2e5b32b2f82c4 now clears the requested gates. All ordinary checks are settled with no failures or pending checks. The trusted-main deterministic E2E plan e769193c12eedfddcc9d176b1725b9752cdd9bbea6c9bfaa6beb965e48445b25 passed in run 29533433288: gpu-e2e, cloud-onboard, credential-sanitization, and both OpenClaw and Hermes security-posture lanes. The exact-head advisor is informational with 0 blockers, 0 warnings, and 0 suggestions; CodeRabbit reports no actionable comments; all review threads are resolved. @cv please re-review this exact head and clear the stale change request if satisfied.

@cv
cv requested review from ericksoa and jyaunches July 16, 2026 21:02
@cv

cv commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Exact-head gate update for 2bd90d62ecff2b49183b8573b7d2e5b32b2f82c4:

Approval is intentionally held until #7024 lands: the current main controller emitted a later skipped same-name check after the successful proof, so the fail-closed maintainer checker still reports that stale bootstrap artifact. After #7024, rerun the immutable gate against the unchanged current head/base and require it green. No merge performed.

Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
@apurvvkumaria
apurvvkumaria merged commit dddfc51 into main Jul 17, 2026
52 checks passed
@apurvvkumaria
apurvvkumaria deleted the codex/5662-gpu-native-route-validation branch July 17, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression Recommended Blocker Recommended release blocker for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Linux][Onboard] Sandbox enters Error phase during GPU onboard despite patched container running and healthy

4 participants