Skip to content

fix(e2e): stabilize residual release gates - #5911

Merged
cv merged 5 commits into
mainfrom
codex/fix-deepagents-tui-marker-sidecar
Jun 27, 2026
Merged

fix(e2e): stabilize residual release gates#5911
cv merged 5 commits into
mainfrom
codex/fix-deepagents-tui-marker-sidecar

Conversation

@cv

@cv cv commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stabilizes the final residual release-gate harnesses uncovered by fresh main validation. Deep Agents TUI evidence now uses a sidecar so Expect's buffered log_file cannot overwrite lifecycle markers, the issue #4434 sandbox-egress repro skips gateway-managed hosted inference just as its legacy shell lane already does, and double-onboard stale recovery receives its exact target-scoped custom endpoint.

Changes

  • Write Deep Agents prompt and lifecycle evidence to a separate marker sidecar, fold it into the sanitized capture, and remove the sensitive intermediate during cleanup.
  • Preserve the actual prompt match alongside readiness and exit markers so strict prompt/exit assertions remain intact.
  • Skip the issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 sandbox-egress firewall repro before onboarding or mutation when either the explicit sentinel or hosted-compatible key selects gateway-managed inference.
  • Align double-onboard stale rebuild recovery with the legacy shell gate by passing the target's fake endpoint instead of intentionally mismatched ambient values.
  • Extend helper, image-contract, workflow, and runtime support tests for the new boundaries.

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: release-gate harness behavior only; no user-facing behavior changed.
  • 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: self-review of E2E-only capture cleanup and firewall preconditions; the sidecar is sanitized then deleted, and the hosted-mode guard executes before onboarding or firewall mutation.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Git hooks passed during commit and push, or npx prek run --from-ref main --to-ref HEAD passes
  • Targeted tests pass for changed behavior
  • Full npm test passes (broad runtime changes only)
  • 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)

Targeted verification:

npm test -- --run test/deepagents-code-tui-startup-check.test.ts test/langchain-deepagents-code-image.test.ts test/e2e-script-workflow.test.ts test/e2e-scenario/support-tests/ci-compatible-inference.test.ts
NEMOCLAW_RUN_E2E_SCENARIOS=1 NEMOCLAW_ISSUE_4434_LIVE=1 NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts --silent=false --reporter=default
bash -n test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
npx prek run shfmt --files test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
npx prek run shellcheck --files test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
npm run typecheck:cli

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved TUI startup lifecycle verification by isolating and preserving readiness/exit marker streams through sanitization, and ensuring temporary marker artifacts are fully cleaned up.
    • Updated the live issue-4434 scenario to skip when gateway-managed hosted inference is detected.
  • Tests

    • Expanded Deep Agents Code TUI startup e2e coverage to validate marker appending/concatenation and final capture content.
    • Added CI-compatible inference detection fixture coverage (including live gating assertions).
    • Enhanced double-onboard rebuild coverage to use the provided fake base URL and avoid the prior hardcoded invalid endpoint/model.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this Jun 27, 2026
@coderabbitai

coderabbitai Bot commented Jun 27, 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: da8fd075-dcd6-40aa-906f-ee1491dd2477

📥 Commits

Reviewing files that changed from the base of the PR and between f0b9860 and 3639818.

📒 Files selected for processing (1)
  • test/e2e-scenario/support-tests/ci-compatible-inference.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e-scenario/support-tests/ci-compatible-inference.test.ts

📝 Walkthrough

Walkthrough

The TUI startup harness now writes lifecycle markers to a separate marker capture file, the issue-4434 live scenario skips when hosted inference is gateway-managed, and the double-onboard rebuild step now uses the provided fake base URL.

Changes

TUI marker capture separation

Layer / File(s) Summary
Shell harness updates
test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
run_tui_expect accepts a markers path, append_marker writes to that file, and main creates marker_capture_file, includes it in cleanup, and concatenates it into the combined capture.
Unit test capture cleanup
test/deepagents-code-tui-startup-check.test.ts
The startup-check tests route marker output to a separate capture path, pass MARKER_CAPTURE into the harness, and assert that the marker capture file is removed after sanitization.
Contract assertions for markers
test/langchain-deepagents-code-image.test.ts
The image test expectations now require append_marker $markers, NEMOCLAW_TUI_MARKERS, and three-file capture concatenation.

Hosted inference skip gate

Layer / File(s) Summary
Live test skip condition
test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts
The issue-4434 live test adds gateway-managed hosted-inference detection and test.skipIf(...), and the setup comment documents the skipped repro mode.
Inference compatibility checks
test/e2e-scenario/fixtures/ci-compatible-inference.ts, test/e2e-scenario/support-tests/ci-compatible-inference.test.ts
The compatibility fixture defines the gateway-managed predicate, and the support tests validate the skipped live run plus the provider/key cases.
Workflow script ordering check
test/e2e-script-workflow.test.ts
The e2e workflow test inspects the live scenario script and asserts the stale rebuild helper uses the fake base URL and no longer includes the removed invalid endpoint or model override.

Double-onboard rebuild environment

Layer / File(s) Summary
Rebuild env helper
test/e2e-scenario/live/double-onboard.test.ts
staleRebuildEnv now takes sandboxName and fakeBaseUrl, returns onboardEnv(sandboxName, fakeBaseUrl), and the Phase 5 rebuild step passes fake.baseUrl through.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5839: Modifies the same TUI startup check flow and related validation around marker handling.
  • NVIDIA/NemoClaw#5908: Changes the same TUI startup expect harness and marker capture handling path.
  • NVIDIA/NemoClaw#5897: Touches the same live issue-4434-tui-unreachable-inference.test.ts flow and its surrounding scenario behavior.

Suggested labels

area: e2e, bug-fix

Suggested reviewers

  • jyaunches
🚥 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 is concise and broadly matches the PR’s purpose of stabilizing end-to-end release-gate checks.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-deepagents-tui-marker-sidecar

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

@github-code-quality

github-code-quality Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the codex/fix-deepagents... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main codex/fix-deepagents... 3639818 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the codex/fix-deepagents... branch is 67%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main codex/fix-deepagents... 3639818 +/-
src/lib/actions...all/run-plan.ts 80%
src/lib/state/o...oard-session.ts 79%
src/lib/actions...dbox/rebuild.ts 74%
src/lib/state/sandbox.ts 72%
src/lib/shields/index.ts 70%
src/lib/onboard/preflight.ts 69%
src/lib/actions...licy-channel.ts 59%
src/lib/onboard...er-gpu-patch.ts 59%
src/lib/policy/index.ts 52%
src/lib/onboard.ts 20%

Updated June 27, 2026 21:44 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — Changes requested

Merge posture: Do not merge yet
Primary next action: Fix PRA-4: Source-of-truth review missing for gateway-managed inference detection fixture; then add or justify PRA-T1.
Open items: 2 required · 7 warnings · 2 suggestions · 4 test follow-ups
Since last review: 4 prior items resolved · 5 still apply · 2 new items found

Action checklist

  • PRA-4 Fix: Source-of-truth review missing for gateway-managed inference detection fixture in test/e2e-scenario/fixtures/ci-compatible-inference.ts:1
  • PRA-5 Fix: Missing source-of-truth documentation for HOSTED_INFERENCE_IS_GATEWAY_MANAGED skip gate in test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:50
  • PRA-1 Resolve or justify: Source-of-truth review needed: test/e2e-scenario/fixtures/ci-compatible-inference.ts
  • PRA-2 Resolve or justify: Source-of-truth review needed: test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:50
  • PRA-3 Resolve or justify: Source-of-truth review needed: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138
  • PRA-6 Resolve or justify: Missing rationale comment for marker sidecar design in run_tui_expect in test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138
  • PRA-7 Resolve or justify: Marker sidecar two-file capture rationale undocumented at function signature in test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138
  • PRA-8 Resolve or justify: Heavyweight integration test for skip gate; add lighter unit test in test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15
  • PRA-9 Resolve or justify: Static string-match test for staleRebuildEnv fix is brittle in test/e2e-script-workflow.test.ts:1273
  • PRA-T1 Add or justify test follow-up: Heavyweight integration test for skip gate; add lighter unit test
  • PRA-T2 Add or justify test follow-up: test/e2e-scenario/fixtures/ci-compatible-inference.ts
  • PRA-T3 Add or justify test follow-up: test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:50
  • PRA-T4 Add or justify test follow-up: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138
  • PRA-10 In-scope improvement: Key classification logic assumes non-nvapi keys for non-public providers are gateway-managed in test/e2e-scenario/fixtures/ci-compatible-inference.ts:8
  • PRA-11 In-scope improvement: staleRebuildEnv function lacks direct unit test in test/e2e-scenario/live/double-onboard.test.ts:63

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify architecture Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
PRA-2 Resolve/justify architecture Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
PRA-3 Resolve/justify architecture Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
PRA-4 Required architecture test/e2e-scenario/fixtures/ci-compatible-inference.ts:1 Add a block comment at the top of ci-compatible-inference.ts documenting: (1) invalid state = running sandbox-egress blocking test against gateway-managed inference, (2) source boundary = test assumes inference uses sandbox egress, (3) why source can't be fixed = gateway routing is architectural, (4) regression test = ci-compatible-inference.test.ts:15-45, (5) removal condition = permanent correct design, not workaround.
PRA-5 Required architecture test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:50 Add a block comment above line 50 (const HOSTED_INFERENCE_IS_GATEWAY_MANAGED) documenting: invalid state, source boundary, why source can't be fixed, regression test, and removal condition.
PRA-6 Resolve/justify correctness test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138 Add a comment above run_tui_expect explaining: markers isolated from raw PTY capture to prevent Expect's buffered log_file from overwriting lifecycle markers (READY, TIMEOUT, EXIT_CAPTURED).
PRA-7 Resolve/justify docs test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138 Add a brief comment at the run_tui_expect function signature explaining raw_capture_file (secret scanning) vs marker_capture_file (lifecycle markers).
PRA-8 Resolve/justify tests test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15 Add a focused unit test that directly tests the test.skipIf predicate: verify test.skipIf(isGatewayManagedCompatibleInference({NEMOCLAW_E2E_USE_HOSTED_INFERENCE: '1'})) returns early without calling onboard.from() or inserting iptables rules. Keep integration test as secondary coverage.
PRA-9 Resolve/justify correctness test/e2e-script-workflow.test.ts:1273 Replace with a unit test that imports and calls staleRebuildEnv directly with a fake URL, verifying the returned env object has correct NEMOCLAW_ENDPOINT_URL and no ambient-wrong-model.
PRA-10 Improvement security test/e2e-scenario/fixtures/ci-compatible-inference.ts:8 Add a comment explaining the threat model: why non-nvapi keys for non-public providers are assumed to be gateway-managed. Document the expected key format for NVIDIA internal hosted inference keys.
PRA-11 Improvement correctness test/e2e-scenario/live/double-onboard.test.ts:63 Add a unit test for staleRebuildEnv that verifies: (1) it returns onboardEnv with the provided fakeBaseUrl, (2) NEMOCLAW_MODEL is 'test-model' (not 'ambient-wrong-model'), (3) NEMOCLAW_ENDPOINT_URL matches fakeBaseUrl.

🚨 Required before merge

Address these before merging unless a maintainer explicitly overrides the advisor with rationale.

PRA-4 Required — Source-of-truth review missing for gateway-managed inference detection fixture

  • Location: test/e2e-scenario/fixtures/ci-compatible-inference.ts:1
  • Category: architecture
  • Problem: The ci-compatible-inference.ts fixture implements a localized workaround (skipping sandbox-egress repro when gateway-managed inference is detected) without documenting the five required source-of-truth elements: invalid state, source boundary, why source can't be fixed, regression test, and removal condition.
  • Impact: Future maintainers may not understand why this conditional skip exists and could inadvertently remove or break it, causing false-negative inference reachability tests when NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1 or hosted-compatible keys are used.
  • Required action: Add a block comment at the top of ci-compatible-inference.ts documenting: (1) invalid state = running sandbox-egress blocking test against gateway-managed inference, (2) source boundary = test assumes inference uses sandbox egress, (3) why source can't be fixed = gateway routing is architectural, (4) regression test = ci-compatible-inference.test.ts:15-45, (5) removal condition = permanent correct design, not workaround.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Read test/e2e-scenario/fixtures/ci-compatible-inference.ts lines 1-13 for explanatory comment covering all five source-of-truth elements.
  • Missing regression test: The integration test in test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 serves as regression test for the skip gate behavior.
  • Done when: The required change is committed and verification passes: Read test/e2e-scenario/fixtures/ci-compatible-inference.ts lines 1-13 for explanatory comment covering all five source-of-truth elements.
  • Evidence: Fixture mirrors legacy shell nemoclaw_e2e_using_compatible_inference; integration test verifies skip behavior; no block comment present.

PRA-5 Required — Missing source-of-truth documentation for HOSTED_INFERENCE_IS_GATEWAY_MANAGED skip gate

  • Location: test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:50
  • Category: architecture
  • Problem: The test uses test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED) to skip the sandbox-egress firewall repro when gateway-managed inference is selected, but lacks a block comment documenting the source-of-truth analysis per the rubric.
  • Impact: Future maintainers may not understand why this conditional skip exists and could inadvertently remove or break it, causing false-negative inference reachability tests when gateway-managed inference is used.
  • Required action: Add a block comment above line 50 (const HOSTED_INFERENCE_IS_GATEWAY_MANAGED) documenting: invalid state, source boundary, why source can't be fixed, regression test, and removal condition.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Check test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts lines 49-55 for explanatory comment.
  • Missing regression test: The integration test in test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 serves as the regression test for the skip gate.
  • Done when: The required change is committed and verification passes: Check test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts lines 49-55 for explanatory comment.
  • Evidence: Line 50: const HOSTED_INFERENCE_IS_GATEWAY_MANAGED = isGatewayManagedCompatibleInference(); line 53: test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED) — no explanatory comment present.
Review findings by urgency: 2 required fixes, 7 items to resolve/justify, 2 in-scope improvements

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

PRA-1 Resolve/justify — Source-of-truth review needed: test/e2e-scenario/fixtures/ci-compatible-inference.ts

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as missing.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 integration test spawns vitest with hosted env, verifies test skipped.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: Fixture mirrors legacy shell nemoclaw_e2e_using_compatible_inference; no block comment documenting these five elements.

PRA-2 Resolve/justify — Source-of-truth review needed: test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:50

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as missing.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 integration test.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: const HOSTED_INFERENCE_IS_GATEWAY_MANAGED = isGatewayManagedCompatibleInference(); test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED) — no explanatory comment.

PRA-3 Resolve/justify — Source-of-truth review needed: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: deepagents-code-tui-startup-check.test.ts tests verify markers appear in sanitized capture.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: run_tui_expect now takes marker_capture_file parameter; append_marker writes to markers file; markers concatenated into combined_capture_file before sanitization. No rationale comment at function definition.

PRA-6 Resolve/justify — Missing rationale comment for marker sidecar design in run_tui_expect

  • Location: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138
  • Category: correctness
  • Problem: The run_tui_expect function now takes a second marker_capture_file parameter and writes lifecycle markers (READY, TIMEOUT, EXIT_CAPTURED) to it separately from the raw PTY capture. This prevents Expect's buffered log_file from overwriting markers. The design intent is not documented in the shell script.
  • Impact: Future changes to the capture logic could inadvertently break the marker isolation, causing flaky TUI startup checks where readiness/exit markers are lost.
  • Recommended action: Add a comment above run_tui_expect explaining: markers isolated from raw PTY capture to prevent Expect's buffered log_file from overwriting lifecycle markers (READY, TIMEOUT, EXIT_CAPTURED).
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Read test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh lines 138-150 for explanatory comment at function definition.
  • Missing regression test: The deepagents-code-tui-startup-check.test.ts tests verify markers appear in sanitized capture, but not the rationale.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Read test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh lines 138-150 for explanatory comment at function definition.
  • Evidence: Function signature at line ~138: run_tui_expect() { local raw_capture_file="$1" local marker_capture_file="$2" ... append_marker writes to $markers — no comment explaining why two files.

PRA-7 Resolve/justify — Marker sidecar two-file capture rationale undocumented at function signature

  • Location: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138
  • Category: docs
  • Problem: The two-file capture design (raw PTY for secret scanning vs lifecycle markers for readiness/exit detection) is not explained at the run_tui_expect function signature.
  • Impact: Reduced maintainability; the separation of concerns between secret-scanning artifacts and lifecycle markers is not self-documenting.
  • Recommended action: Add a brief comment at the run_tui_expect function signature explaining raw_capture_file (secret scanning) vs marker_capture_file (lifecycle markers).
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check function signature at line ~138 for comment explaining the two-file design.
  • Missing regression test: N/A — documentation item
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check function signature at line ~138 for comment explaining the two-file design.
  • Evidence: Function signature and first 20 lines lack design rationale comment.

PRA-8 Resolve/justify — Heavyweight integration test for skip gate; add lighter unit test

  • Location: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15
  • Category: tests
  • Problem: The integration test spawns vitest as a subprocess (execFileSync) with ~30s timeout, depending on vitest binary path and project config. Unit tests for isGatewayManagedCompatibleInference function exist, but no focused unit test directly verifies test.skipIf predicate behavior without process spawn.
  • Impact: Increased CI latency and potential flakiness from path resolution. The test provides end-to-end confidence but duplicates what a unit test could verify faster.
  • Recommended action: Add a focused unit test that directly tests the test.skipIf predicate: verify test.skipIf(isGatewayManagedCompatibleInference({NEMOCLAW_E2E_USE_HOSTED_INFERENCE: '1'})) returns early without calling onboard.from() or inserting iptables rules. Keep integration test as secondary coverage.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Run the integration test and measure duration; check if vitest.mjs path resolution is stable. Then verify a unit test can be added in the same file testing skipIf behavior directly.
  • Missing regression test: A unit test for test.skipIf predicate behavior that doesn't spawn vitest subprocess.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Run the integration test and measure duration; check if vitest.mjs path resolution is stable. Then verify a unit test can be added in the same file testing skipIf behavior directly.
  • Evidence: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 uses execFileSync to spawn vitest.mjs with --project e2e-scenarios-live.

PRA-9 Resolve/justify — Static string-match test for staleRebuildEnv fix is brittle

  • Location: test/e2e-script-workflow.test.ts:1273
  • Category: correctness
  • Problem: The test uses readFileSync + string contains checks to verify the staleRebuildEnv function signature and body, rather than importing and calling the function directly.
  • Impact: Test could pass while the function returns an incorrect env object (e.g., wrong endpoint URL, missing model, or stale ambient-wrong-model).
  • Recommended action: Replace with a unit test that imports and calls staleRebuildEnv directly with a fake URL, verifying the returned env object has correct NEMOCLAW_ENDPOINT_URL and no ambient-wrong-model.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check test/e2e-script-workflow.test.ts lines 1273-1285 — the test uses readFileSync + string contains checks instead of direct function invocation.
  • Missing regression test: A unit test importing staleRebuildEnv and asserting on the returned env object structure.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check test/e2e-script-workflow.test.ts lines 1273-1285 — the test uses readFileSync + string contains checks instead of direct function invocation.
  • Evidence: Test verifies: 'function staleRebuildEnv(sandboxName: string, fakeBaseUrl: string)', 'return onboardEnv(sandboxName, fakeBaseUrl);', 'env: staleRebuildEnv(SANDBOX_A, fake.baseUrl)', but not actual function behavior.

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

PRA-10 Improvement — Key classification logic assumes non-nvapi keys for non-public providers are gateway-managed

  • Location: test/e2e-scenario/fixtures/ci-compatible-inference.ts:8
  • Category: security
  • Problem: isGatewayManagedCompatibleInference returns true for any non-nvapi key when provider is not in PUBLIC_NVIDIA_PROVIDERS. This could misclassify custom keys as gateway-managed if they don't start with 'nvapi-'.
  • Impact: If production hosted inference keys use a different format, the skip gate could incorrectly activate or fail to activate, leading to false negatives or unnecessary test runs.
  • Suggested action: Add a comment explaining the threat model: why non-nvapi keys for non-public providers are assumed to be gateway-managed. Document the expected key format for NVIDIA internal hosted inference keys.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Review the key classification logic and confirm it matches the actual hosted inference key formats used in production.
  • Missing regression test: Test case with a custom non-nvapi key for provider=custom to verify gateway-managed classification.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Line 8: return key.length > 0 && !key.startsWith('nvapi-'); — treats any non-nvapi key as hosted-compatible for non-public providers.

PRA-11 Improvement — staleRebuildEnv function lacks direct unit test

  • Location: test/e2e-scenario/live/double-onboard.test.ts:63
  • Category: correctness
  • Problem: staleRebuildEnv now takes fakeBaseUrl parameter but the old signature (without parameter) is not tested for removal — the string-match test in e2e-script-workflow.test.ts only checks for new signature presence.
  • Impact: Function behavior (correct endpoint URL, correct model) is only indirectly tested via the heavyweight double-onboard integration test.
  • Suggested action: Add a unit test for staleRebuildEnv that verifies: (1) it returns onboardEnv with the provided fakeBaseUrl, (2) NEMOCLAW_MODEL is 'test-model' (not 'ambient-wrong-model'), (3) NEMOCLAW_ENDPOINT_URL matches fakeBaseUrl.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Check if staleRebuildEnv is exported and testable, or refactor to make it testable.
  • Missing regression test: Direct unit test for staleRebuildEnv function behavior.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Function at line 63: function staleRebuildEnv(sandboxName: string, fakeBaseUrl: string) { return onboardEnv(sandboxName, fakeBaseUrl); } — no direct unit test.
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Heavyweight integration test for skip gate; add lighter unit test — Add a focused unit test that directly tests the test.skipIf predicate: verify test.skipIf(isGatewayManagedCompatibleInference({NEMOCLAW_E2E_USE_HOSTED_INFERENCE: '1'})) returns early without calling onboard.from() or inserting iptables rules. Keep integration test as secondary coverage.
  • PRA-T2 test/e2e-scenario/fixtures/ci-compatible-inference.ts — test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 integration test spawns vitest with hosted env, verifies test skipped.. Fixture mirrors legacy shell nemoclaw_e2e_using_compatible_inference; no block comment documenting these five elements.
  • PRA-T3 test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:50 — test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 integration test.. const HOSTED_INFERENCE_IS_GATEWAY_MANAGED = isGatewayManagedCompatibleInference(); test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED) — no explanatory comment.
  • PRA-T4 test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138 — deepagents-code-tui-startup-check.test.ts tests verify markers appear in sanitized capture.. run_tui_expect now takes marker_capture_file parameter; append_marker writes to markers file; markers concatenated into combined_capture_file before sanitization. No rationale comment at function definition.
Since last review details

Current findings, using the urgency labels above:

PRA-1 Resolve/justify — Source-of-truth review needed: test/e2e-scenario/fixtures/ci-compatible-inference.ts

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as missing.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 integration test spawns vitest with hosted env, verifies test skipped.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: Fixture mirrors legacy shell nemoclaw_e2e_using_compatible_inference; no block comment documenting these five elements.

PRA-2 Resolve/justify — Source-of-truth review needed: test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:50

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as missing.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 integration test.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: const HOSTED_INFERENCE_IS_GATEWAY_MANAGED = isGatewayManagedCompatibleInference(); test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED) — no explanatory comment.

PRA-3 Resolve/justify — Source-of-truth review needed: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: deepagents-code-tui-startup-check.test.ts tests verify markers appear in sanitized capture.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: run_tui_expect now takes marker_capture_file parameter; append_marker writes to markers file; markers concatenated into combined_capture_file before sanitization. No rationale comment at function definition.

PRA-4 Required — Source-of-truth review missing for gateway-managed inference detection fixture

  • Location: test/e2e-scenario/fixtures/ci-compatible-inference.ts:1
  • Category: architecture
  • Problem: The ci-compatible-inference.ts fixture implements a localized workaround (skipping sandbox-egress repro when gateway-managed inference is detected) without documenting the five required source-of-truth elements: invalid state, source boundary, why source can't be fixed, regression test, and removal condition.
  • Impact: Future maintainers may not understand why this conditional skip exists and could inadvertently remove or break it, causing false-negative inference reachability tests when NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1 or hosted-compatible keys are used.
  • Required action: Add a block comment at the top of ci-compatible-inference.ts documenting: (1) invalid state = running sandbox-egress blocking test against gateway-managed inference, (2) source boundary = test assumes inference uses sandbox egress, (3) why source can't be fixed = gateway routing is architectural, (4) regression test = ci-compatible-inference.test.ts:15-45, (5) removal condition = permanent correct design, not workaround.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Read test/e2e-scenario/fixtures/ci-compatible-inference.ts lines 1-13 for explanatory comment covering all five source-of-truth elements.
  • Missing regression test: The integration test in test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 serves as regression test for the skip gate behavior.
  • Done when: The required change is committed and verification passes: Read test/e2e-scenario/fixtures/ci-compatible-inference.ts lines 1-13 for explanatory comment covering all five source-of-truth elements.
  • Evidence: Fixture mirrors legacy shell nemoclaw_e2e_using_compatible_inference; integration test verifies skip behavior; no block comment present.

PRA-5 Required — Missing source-of-truth documentation for HOSTED_INFERENCE_IS_GATEWAY_MANAGED skip gate

  • Location: test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:50
  • Category: architecture
  • Problem: The test uses test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED) to skip the sandbox-egress firewall repro when gateway-managed inference is selected, but lacks a block comment documenting the source-of-truth analysis per the rubric.
  • Impact: Future maintainers may not understand why this conditional skip exists and could inadvertently remove or break it, causing false-negative inference reachability tests when gateway-managed inference is used.
  • Required action: Add a block comment above line 50 (const HOSTED_INFERENCE_IS_GATEWAY_MANAGED) documenting: invalid state, source boundary, why source can't be fixed, regression test, and removal condition.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Check test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts lines 49-55 for explanatory comment.
  • Missing regression test: The integration test in test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 serves as the regression test for the skip gate.
  • Done when: The required change is committed and verification passes: Check test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts lines 49-55 for explanatory comment.
  • Evidence: Line 50: const HOSTED_INFERENCE_IS_GATEWAY_MANAGED = isGatewayManagedCompatibleInference(); line 53: test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED) — no explanatory comment present.

PRA-6 Resolve/justify — Missing rationale comment for marker sidecar design in run_tui_expect

  • Location: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138
  • Category: correctness
  • Problem: The run_tui_expect function now takes a second marker_capture_file parameter and writes lifecycle markers (READY, TIMEOUT, EXIT_CAPTURED) to it separately from the raw PTY capture. This prevents Expect's buffered log_file from overwriting markers. The design intent is not documented in the shell script.
  • Impact: Future changes to the capture logic could inadvertently break the marker isolation, causing flaky TUI startup checks where readiness/exit markers are lost.
  • Recommended action: Add a comment above run_tui_expect explaining: markers isolated from raw PTY capture to prevent Expect's buffered log_file from overwriting lifecycle markers (READY, TIMEOUT, EXIT_CAPTURED).
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Read test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh lines 138-150 for explanatory comment at function definition.
  • Missing regression test: The deepagents-code-tui-startup-check.test.ts tests verify markers appear in sanitized capture, but not the rationale.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Read test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh lines 138-150 for explanatory comment at function definition.
  • Evidence: Function signature at line ~138: run_tui_expect() { local raw_capture_file="$1" local marker_capture_file="$2" ... append_marker writes to $markers — no comment explaining why two files.

PRA-7 Resolve/justify — Marker sidecar two-file capture rationale undocumented at function signature

  • Location: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:138
  • Category: docs
  • Problem: The two-file capture design (raw PTY for secret scanning vs lifecycle markers for readiness/exit detection) is not explained at the run_tui_expect function signature.
  • Impact: Reduced maintainability; the separation of concerns between secret-scanning artifacts and lifecycle markers is not self-documenting.
  • Recommended action: Add a brief comment at the run_tui_expect function signature explaining raw_capture_file (secret scanning) vs marker_capture_file (lifecycle markers).
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check function signature at line ~138 for comment explaining the two-file design.
  • Missing regression test: N/A — documentation item
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check function signature at line ~138 for comment explaining the two-file design.
  • Evidence: Function signature and first 20 lines lack design rationale comment.

PRA-8 Resolve/justify — Heavyweight integration test for skip gate; add lighter unit test

  • Location: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15
  • Category: tests
  • Problem: The integration test spawns vitest as a subprocess (execFileSync) with ~30s timeout, depending on vitest binary path and project config. Unit tests for isGatewayManagedCompatibleInference function exist, but no focused unit test directly verifies test.skipIf predicate behavior without process spawn.
  • Impact: Increased CI latency and potential flakiness from path resolution. The test provides end-to-end confidence but duplicates what a unit test could verify faster.
  • Recommended action: Add a focused unit test that directly tests the test.skipIf predicate: verify test.skipIf(isGatewayManagedCompatibleInference({NEMOCLAW_E2E_USE_HOSTED_INFERENCE: '1'})) returns early without calling onboard.from() or inserting iptables rules. Keep integration test as secondary coverage.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Run the integration test and measure duration; check if vitest.mjs path resolution is stable. Then verify a unit test can be added in the same file testing skipIf behavior directly.
  • Missing regression test: A unit test for test.skipIf predicate behavior that doesn't spawn vitest subprocess.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Run the integration test and measure duration; check if vitest.mjs path resolution is stable. Then verify a unit test can be added in the same file testing skipIf behavior directly.
  • Evidence: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:15-45 uses execFileSync to spawn vitest.mjs with --project e2e-scenarios-live.

PRA-9 Resolve/justify — Static string-match test for staleRebuildEnv fix is brittle

  • Location: test/e2e-script-workflow.test.ts:1273
  • Category: correctness
  • Problem: The test uses readFileSync + string contains checks to verify the staleRebuildEnv function signature and body, rather than importing and calling the function directly.
  • Impact: Test could pass while the function returns an incorrect env object (e.g., wrong endpoint URL, missing model, or stale ambient-wrong-model).
  • Recommended action: Replace with a unit test that imports and calls staleRebuildEnv directly with a fake URL, verifying the returned env object has correct NEMOCLAW_ENDPOINT_URL and no ambient-wrong-model.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check test/e2e-script-workflow.test.ts lines 1273-1285 — the test uses readFileSync + string contains checks instead of direct function invocation.
  • Missing regression test: A unit test importing staleRebuildEnv and asserting on the returned env object structure.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check test/e2e-script-workflow.test.ts lines 1273-1285 — the test uses readFileSync + string contains checks instead of direct function invocation.
  • Evidence: Test verifies: 'function staleRebuildEnv(sandboxName: string, fakeBaseUrl: string)', 'return onboardEnv(sandboxName, fakeBaseUrl);', 'env: staleRebuildEnv(SANDBOX_A, fake.baseUrl)', but not actual function behavior.

PRA-10 Improvement — Key classification logic assumes non-nvapi keys for non-public providers are gateway-managed

  • Location: test/e2e-scenario/fixtures/ci-compatible-inference.ts:8
  • Category: security
  • Problem: isGatewayManagedCompatibleInference returns true for any non-nvapi key when provider is not in PUBLIC_NVIDIA_PROVIDERS. This could misclassify custom keys as gateway-managed if they don't start with 'nvapi-'.
  • Impact: If production hosted inference keys use a different format, the skip gate could incorrectly activate or fail to activate, leading to false negatives or unnecessary test runs.
  • Suggested action: Add a comment explaining the threat model: why non-nvapi keys for non-public providers are assumed to be gateway-managed. Document the expected key format for NVIDIA internal hosted inference keys.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Review the key classification logic and confirm it matches the actual hosted inference key formats used in production.
  • Missing regression test: Test case with a custom non-nvapi key for provider=custom to verify gateway-managed classification.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Line 8: return key.length > 0 && !key.startsWith('nvapi-'); — treats any non-nvapi key as hosted-compatible for non-public providers.

PRA-11 Improvement — staleRebuildEnv function lacks direct unit test

  • Location: test/e2e-scenario/live/double-onboard.test.ts:63
  • Category: correctness
  • Problem: staleRebuildEnv now takes fakeBaseUrl parameter but the old signature (without parameter) is not tested for removal — the string-match test in e2e-script-workflow.test.ts only checks for new signature presence.
  • Impact: Function behavior (correct endpoint URL, correct model) is only indirectly tested via the heavyweight double-onboard integration test.
  • Suggested action: Add a unit test for staleRebuildEnv that verifies: (1) it returns onboardEnv with the provided fakeBaseUrl, (2) NEMOCLAW_MODEL is 'test-model' (not 'ambient-wrong-model'), (3) NEMOCLAW_ENDPOINT_URL matches fakeBaseUrl.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Check if staleRebuildEnv is exported and testable, or refactor to make it testable.
  • Missing regression test: Direct unit test for staleRebuildEnv function behavior.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Function at line 63: function staleRebuildEnv(sandboxName: string, fakeBaseUrl: string) { return onboardEnv(sandboxName, fakeBaseUrl); } — no direct unit test.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: double-onboard-vitest, issue-4434-tui-unreachable-inference-vitest, ubuntu-repo-cloud-langchain-deepagents-code

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No merge-blocking E2E is required: this PR is tests-only and does not change NemoClaw runtime/user-flow implementation. The listed jobs are optional validation for the changed E2E assets themselves.

Optional E2E

  • double-onboard-vitest (high): Useful to validate the changed live Vitest double-onboard stale rebuild recovery path against real OpenShell/Docker lifecycle behavior. Optional because the PR is tests-only.
  • issue-4434-tui-unreachable-inference-vitest (high): Useful to validate the changed hosted-compatible inference skip gate and the live TUI unreachable-inference repro wiring. Optional because the PR is tests-only and does not modify runtime inference code.
  • ubuntu-repo-cloud-langchain-deepagents-code (high): Useful to exercise the modified Deep Agents Code TUI startup check in its real cloud Deep Agents Code onboarding scenario, including sanitized marker artifact behavior. Optional because the PR changes E2E assets only.

New E2E recommendations

  • None.

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: double-onboard-vitest, issue-4434-tui-unreachable-inference-vitest
Optional Vitest E2E scenarios: gpu-double-onboard-vitest

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=double-onboard-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=issue-4434-tui-unreachable-inference-vitest

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • double-onboard-vitest: Focused free-standing Vitest job wired for changed live test test/e2e-scenario/live/double-onboard.test.ts.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=double-onboard-vitest
  • issue-4434-tui-unreachable-inference-vitest: Focused free-standing Vitest job wired for changed live test test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=issue-4434-tui-unreachable-inference-vitest

Optional Vitest E2E scenarios

  • gpu-double-onboard-vitest: Optional adjacent coverage for the double-onboard lifecycle on the GPU runner; useful if the stale rebuild recovery change should be validated on the special-runner variant.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=gpu-double-onboard-vitest

Relevant changed files

  • test/e2e-scenario/fixtures/ci-compatible-inference.ts
  • test/e2e-scenario/live/double-onboard.test.ts
  • test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts
  • test/e2e-scenario/support-tests/ci-compatible-inference.test.ts

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Changes requested

Merge posture: Do not merge yet
Primary next action: Resolve or justify PRA-1: Source-of-truth review needed: `test/e2e-scenario/fixtures/ci-compatible-inference.ts` mirrors legacy shell compatible-inference detection.
Open items: 0 required · 3 warnings · 0 suggestions · 8 test follow-ups
Since last review: 0 prior items resolved · 2 still apply · 0 new items found

Action checklist

  • PRA-1 Resolve or justify: Source-of-truth review needed: `test/e2e-scenario/fixtures/ci-compatible-inference.ts` mirrors legacy shell compatible-inference detection
  • PRA-2 Resolve or justify: Issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 assertions still do not prove structured TUI error details in test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:296
  • PRA-3 Resolve or justify: Nested Vitest invocation is overbuilt for the hosted-compatible skip contract in test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:24
  • PRA-T1 Add or justify test follow-up: Mocked behavioral coverage
  • PRA-T2 Add or justify test follow-up: Mocked behavioral coverage
  • PRA-T3 Add or justify test follow-up: Mocked behavioral coverage
  • PRA-T4 Add or justify test follow-up: Acceptance clause
  • PRA-T5 Add or justify test follow-up: Acceptance clause
  • PRA-T6 Add or justify test follow-up: Acceptance clause
  • PRA-T7 Add or justify test follow-up: Acceptance clause
  • PRA-T8 Add or justify test follow-up: Acceptance clause

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify architecture Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
PRA-2 Resolve/justify acceptance test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:296 Tighten `analyzeIssue4434TuiCapture` and the final expectations to require separate evidence for a concrete HTTP status or cause, gateway/upstream layer attribution, and a recovery hint, or add focused capture-analysis tests documenting the exact real output that satisfies each clause.
PRA-3 Resolve/justify architecture test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:24 Replace the nested `execFileSync(... vitest run ...)` case with direct predicate coverage and either a small source-level assertion that `test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED)` is registered before `requireHostedInferenceConfig`/iptables setup, or extract the live-test selection predicate into a pure helper and test that directly.
Review findings by urgency: 0 required fixes, 3 items to resolve/justify, 0 in-scope improvements

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

PRA-1 Resolve/justify — Source-of-truth review needed: `test/e2e-scenario/fixtures/ci-compatible-inference.ts` mirrors legacy shell compatible-inference detection

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: Direct predicate tests cover the sentinel, custom compatible key, public providers, and `nvapi-` key behavior; the before-setup skip proof is currently the nested Vitest test called out in the architecture finding.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: `isGatewayManagedCompatibleInference` matches `nemoclaw_e2e_using_compatible_inference`, but `support-tests/ci-compatible-inference.test.ts` proves live skip behavior by spawning Vitest instead of testing a shared selection contract.

PRA-2 Resolve/justify — Issue #4434 assertions still do not prove structured TUI error details

  • Location: test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:296
  • Category: acceptance
  • Problem: The linked issue requires the TUI to surface a structured error with a concrete HTTP status or cause, the layer that reported it, and a one-line recovery hint. The current capture analysis still accepts any broad visible-error token plus a final status line ending in `| error`, so a generic pane containing only `error` and a status bar of `| error` can pass.
  • Impact: The release-gate regression can pass while the user-facing failure mode regresses to an unactionable generic error, leaving the named issue clauses for cause/status, layer attribution, and recovery guidance unprotected.
  • Recommended action: Tighten `analyzeIssue4434TuiCapture` and the final expectations to require separate evidence for a concrete HTTP status or cause, gateway/upstream layer attribution, and a recovery hint, or add focused capture-analysis tests documenting the exact real output that satisfies each clause.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Read `VISIBLE_ERROR_RE`, `analyzeIssue4434TuiCapture`, and the final expectations; check whether a capture containing only `something error\n... | error` but no HTTP status/cause, no gateway/upstream attribution, and no recovery hint would still pass.
  • Missing regression test: Add a negative capture-analysis test that rejects generic final `| error` output without HTTP status or concrete cause, gateway/upstream layer attribution, and recovery guidance; add a positive capture fixture matching the actual TUI structured error and assert every named clause is detected independently.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Read `VISIBLE_ERROR_RE`, `analyzeIssue4434TuiCapture`, and the final expectations; check whether a capture containing only `something error\n... | error` but no HTTP status/cause, no gateway/upstream attribution, and no recovery hint would still pass.
  • Evidence: Issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 says `HTTP status or cause`, `Which layer reported it`, and `One-line recovery hint`; the changed scenario still records and asserts only `visibleError`, `lastStatusLine`, `finalStatusIsError`, `finalStatusIsConnectedSpinner`, and spinner-signature absence.

PRA-3 Resolve/justify — Nested Vitest invocation is overbuilt for the hosted-compatible skip contract

  • Location: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:24
  • Category: architecture
  • Problem: The support test launches `node_modules/vitest/vitest.mjs` from inside Vitest to prove the live issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 test is skipped. This adds a runner layer and broadly inherits ambient environment for a contract that can be checked with the pure predicate plus a small source-order or extracted selection-helper assertion.
  • Impact: The test becomes slower and more brittle, and the security-relevant guarantee that hosted-compatible inference skips before hosted config lookup, onboarding, and DOCKER-USER firewall mutation is proven indirectly through runner behavior instead of a local source-of-truth contract.
  • Recommended action: Replace the nested `execFileSync(... vitest run ...)` case with direct predicate coverage and either a small source-level assertion that `test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED)` is registered before `requireHostedInferenceConfig`/iptables setup, or extract the live-test selection predicate into a pure helper and test that directly.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect `test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:24-63` and confirm the skip proof shells out to Vitest rather than testing a pure helper or source-order contract.
  • Missing regression test: Keep behavior-level coverage that `NEMOCLAW_PROVIDER=custom` plus a non-`nvapi-` `NVIDIA_INFERENCE_API_KEY` selects skip before hosted config lookup, onboarding, and firewall mutation, but implement it without spawning a nested Vitest process.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect `test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:24-63` and confirm the skip proof shells out to Vitest rather than testing a pure helper or source-order contract.
  • Evidence: The test calls `execFileSync(process.execPath, [path.resolve("node_modules/vitest/vitest.mjs"), "run", "--project", "e2e-scenarios-live", ...])` while the same file already has direct predicate tests for explicit hosted sentinel, custom compatible key, public providers, and nvapi keys.

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

  • None.
Simplification opportunities: 1 possible cut, net -30 lines possible

These are safe simplification checks only. Do not remove validation, security controls, data-loss prevention, or required tests.

  • PRA-3 shrink (test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:24): The nested `execFileSync` Vitest run and JSON reporter parsing in the first parameterized test.
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Mocked behavioral coverage — Add `analyzeIssue4434TuiCapture rejects generic error status without concrete cause, layer, or recovery hint`.. Most changed harness behavior has focused helper or source-level tests. The remaining gaps are not broad runtime coverage: issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 needs focused capture-analysis tests for structured-error semantics, and the hosted-compatible skip contract should be proven without a nested runner layer.
  • PRA-T2 Mocked behavioral coverage — Add `analyzeIssue4434TuiCapture accepts representative structured upstream/gateway error with recovery hint and final error status`.. Most changed harness behavior has focused helper or source-level tests. The remaining gaps are not broad runtime coverage: issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 needs focused capture-analysis tests for structured-error semantics, and the hosted-compatible skip contract should be proven without a nested runner layer.
  • PRA-T3 Mocked behavioral coverage — Replace the nested Vitest support test with `hosted-compatible issue4434 selection skips before hosted config lookup, onboarding, and DOCKER-USER mutation` using a pure helper or source-order assertion.. Most changed harness behavior has focused helper or source-level tests. The remaining gaps are not broad runtime coverage: issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 needs focused capture-analysis tests for structured-error semantics, and the hosted-compatible skip contract should be proven without a nested runner layer.
  • PRA-T4 Acceptance clause — When the NVIDIA inference endpoint is unreachable (e.g. blocked by firewall), `openclaw tui` shows an indefinite spinner with "connected" status and never surfaces an error message. — add test evidence or identify existing coverage. The live scenario inserts DOCKER-USER DROP rules for the fixed NVIDIA endpoint IPs and asserts a sandbox `curl` to `https://inference-api.nvidia.com/v1/models\` fails, then checks visible error and spinner/status behavior.
  • PRA-T5 Acceptance clause — The user has zero actionability -- no HTTP status, no error cause, no recovery hint. — add test evidence or identify existing coverage. The scenario asserts `analysis.visibleError` but does not require HTTP status, concrete cause, or recovery hint evidence.
  • PRA-T6 Acceptance clause — TUI surfaces a structured error within the gateway timeout (180s) including: — add test evidence or identify existing coverage. `DEFAULT_TUI_TIMEOUT_SEC` is 180 and the expect command timeout is bounded by `(TUI_TIMEOUT_SEC + 30) * 1000`, but the capture analysis does not require structured multi-field error content.
  • PRA-T7 Acceptance clause — HTTP status or cause (e.g. "HTTP 503 from upstream" or "connection refused") — add test evidence or identify existing coverage. `VISIBLE_ERROR_RE` includes cause-like tokens such as `timeout`, `ECONN`, `upstream`, `connection`, and `refused`, but it also accepts generic `error` and does not require a concrete HTTP status or cause.
  • PRA-T8 Acceptance clause — Which layer reported it (gateway proxy / upstream API) — add test evidence or identify existing coverage. No field, regex, scenario-result entry, or expectation requires gateway proxy, upstream API, or equivalent layer attribution.
Since last review details

Current findings, using the urgency labels above:

PRA-1 Resolve/justify — Source-of-truth review needed: `test/e2e-scenario/fixtures/ci-compatible-inference.ts` mirrors legacy shell compatible-inference detection

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: Direct predicate tests cover the sentinel, custom compatible key, public providers, and `nvapi-` key behavior; the before-setup skip proof is currently the nested Vitest test called out in the architecture finding.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: `isGatewayManagedCompatibleInference` matches `nemoclaw_e2e_using_compatible_inference`, but `support-tests/ci-compatible-inference.test.ts` proves live skip behavior by spawning Vitest instead of testing a shared selection contract.

PRA-2 Resolve/justify — Issue #4434 assertions still do not prove structured TUI error details

  • Location: test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts:296
  • Category: acceptance
  • Problem: The linked issue requires the TUI to surface a structured error with a concrete HTTP status or cause, the layer that reported it, and a one-line recovery hint. The current capture analysis still accepts any broad visible-error token plus a final status line ending in `| error`, so a generic pane containing only `error` and a status bar of `| error` can pass.
  • Impact: The release-gate regression can pass while the user-facing failure mode regresses to an unactionable generic error, leaving the named issue clauses for cause/status, layer attribution, and recovery guidance unprotected.
  • Recommended action: Tighten `analyzeIssue4434TuiCapture` and the final expectations to require separate evidence for a concrete HTTP status or cause, gateway/upstream layer attribution, and a recovery hint, or add focused capture-analysis tests documenting the exact real output that satisfies each clause.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Read `VISIBLE_ERROR_RE`, `analyzeIssue4434TuiCapture`, and the final expectations; check whether a capture containing only `something error\n... | error` but no HTTP status/cause, no gateway/upstream attribution, and no recovery hint would still pass.
  • Missing regression test: Add a negative capture-analysis test that rejects generic final `| error` output without HTTP status or concrete cause, gateway/upstream layer attribution, and recovery guidance; add a positive capture fixture matching the actual TUI structured error and assert every named clause is detected independently.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Read `VISIBLE_ERROR_RE`, `analyzeIssue4434TuiCapture`, and the final expectations; check whether a capture containing only `something error\n... | error` but no HTTP status/cause, no gateway/upstream attribution, and no recovery hint would still pass.
  • Evidence: Issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 says `HTTP status or cause`, `Which layer reported it`, and `One-line recovery hint`; the changed scenario still records and asserts only `visibleError`, `lastStatusLine`, `finalStatusIsError`, `finalStatusIsConnectedSpinner`, and spinner-signature absence.

PRA-3 Resolve/justify — Nested Vitest invocation is overbuilt for the hosted-compatible skip contract

  • Location: test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:24
  • Category: architecture
  • Problem: The support test launches `node_modules/vitest/vitest.mjs` from inside Vitest to prove the live issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 test is skipped. This adds a runner layer and broadly inherits ambient environment for a contract that can be checked with the pure predicate plus a small source-order or extracted selection-helper assertion.
  • Impact: The test becomes slower and more brittle, and the security-relevant guarantee that hosted-compatible inference skips before hosted config lookup, onboarding, and DOCKER-USER firewall mutation is proven indirectly through runner behavior instead of a local source-of-truth contract.
  • Recommended action: Replace the nested `execFileSync(... vitest run ...)` case with direct predicate coverage and either a small source-level assertion that `test.skipIf(HOSTED_INFERENCE_IS_GATEWAY_MANAGED)` is registered before `requireHostedInferenceConfig`/iptables setup, or extract the live-test selection predicate into a pure helper and test that directly.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect `test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:24-63` and confirm the skip proof shells out to Vitest rather than testing a pure helper or source-order contract.
  • Missing regression test: Keep behavior-level coverage that `NEMOCLAW_PROVIDER=custom` plus a non-`nvapi-` `NVIDIA_INFERENCE_API_KEY` selects skip before hosted config lookup, onboarding, and firewall mutation, but implement it without spawning a nested Vitest process.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect `test/e2e-scenario/support-tests/ci-compatible-inference.test.ts:24-63` and confirm the skip proof shells out to Vitest rather than testing a pure helper or source-order contract.
  • Evidence: The test calls `execFileSync(process.execPath, [path.resolve("node_modules/vitest/vitest.mjs"), "run", "--project", "e2e-scenarios-live", ...])` while the same file already has direct predicate tests for explicit hosted sentinel, custom compatible key, public providers, and nvapi keys.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@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: 1

🧹 Nitpick comments (1)
test/langchain-deepagents-code-image.test.ts (1)

474-485: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Avoid source-text assertions for the marker-sidecar contract.

These checks lock the test to the shell script’s exact implementation and still do not prove the sidecar path works when executed. Prefer driving the harness through its boundary and asserting emitted artifacts / sanitized output instead. As per path instructions, "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions."

🤖 Prompt for 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.

In `@test/langchain-deepagents-code-image.test.ts` around lines 474 - 485, The
marker-sidecar test is asserting shell script source text instead of verifying
the contract through execution. Update the test in
langchain-deepagents-code-image.test.ts to drive the TUI harness via its public
boundary and assert the resulting artifacts/sanitized output from the marker
sidecar flow, rather than checking for exact strings like tuiStartupCheck or
append_marker in the script contents. Keep the focus on observable outcomes from
the executed harness, using the existing marker capture behavior and emitted
files as the validation point.

Source: Path instructions

🤖 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-script-workflow.test.ts`:
- Around line 1290-1304: The current test in e2e-script-workflow.test.ts is
locked to source text by comparing indexOf positions in
issue-4434-tui-unreachable-inference.test.ts, so replace it with a behavioral
assertion through the public boundary. Update the test to execute the scenario
with NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1 and verify the hosted skip outcome
while asserting the firewall mutation path is not reached, using the scenario
runner and the observable effects around requireHostedInferenceConfig and the
iptables mutation instead of inspecting file contents.

---

Nitpick comments:
In `@test/langchain-deepagents-code-image.test.ts`:
- Around line 474-485: The marker-sidecar test is asserting shell script source
text instead of verifying the contract through execution. Update the test in
langchain-deepagents-code-image.test.ts to drive the TUI harness via its public
boundary and assert the resulting artifacts/sanitized output from the marker
sidecar flow, rather than checking for exact strings like tuiStartupCheck or
append_marker in the script contents. Keep the focus on observable outcomes from
the executed harness, using the existing marker capture behavior and emitted
files as the validation point.
🪄 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: b28e3eae-1e5c-4309-bb7e-498e8d4f38b2

📥 Commits

Reviewing files that changed from the base of the PR and between 1c27f5b and 8e9c7ca.

📒 Files selected for processing (5)
  • test/deepagents-code-tui-startup-check.test.ts
  • test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts
  • test/e2e-script-workflow.test.ts
  • test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
  • test/langchain-deepagents-code-image.test.ts

Comment thread test/e2e-script-workflow.test.ts Outdated
Comment on lines +1290 to +1304
it("skips the issue #4434 sandbox-egress repro for gateway-managed hosted inference", () => {
const liveTest = readFileSync(
"test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts",
"utf8",
);
const hostedSkip = liveTest.indexOf('process.env.NEMOCLAW_E2E_USE_HOSTED_INFERENCE === "1"');
const hostedConfig = liveTest.indexOf("requireHostedInferenceConfig(secrets)");
const firewallMutation = liveTest.indexOf('["iptables", "-I", "DOCKER-USER"');

expect(hostedSkip).toBeGreaterThanOrEqual(0);
expect(liveTest).toContain(
"hosted compatible inference is gateway-managed; this repro only blocks sandbox egress",
);
expect(hostedSkip).toBeLessThan(hostedConfig);
expect(hostedSkip).toBeLessThan(firewallMutation);

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.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

This assertion is implementation-locked instead of behavioral.

Reading the scenario source and comparing indexOf(...) values only proves the current text layout, not that hosted mode actually exits before requireHostedInferenceConfig(secrets) or the iptables mutation runs. Please drive this through the public boundary instead—for example, execute the scenario with NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1 and assert the skip outcome while proving the mutation path is not reached. As per path instructions, "Prefer observable outcomes through the public boundary over source-text" and "Migration tests must prove the superseded path is unreachable or removed."

🤖 Prompt for 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.

In `@test/e2e-script-workflow.test.ts` around lines 1290 - 1304, The current test
in e2e-script-workflow.test.ts is locked to source text by comparing indexOf
positions in issue-4434-tui-unreachable-inference.test.ts, so replace it with a
behavioral assertion through the public boundary. Update the test to execute the
scenario with NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1 and verify the hosted skip
outcome while asserting the firewall mutation path is not reached, using the
scenario runner and the observable effects around requireHostedInferenceConfig
and the iptables mutation instead of inspecting file contents.

Source: Path instructions

cv added 3 commits June 27, 2026 14:27
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>

@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: 1

🤖 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-scenario/support-tests/ci-compatible-inference.test.ts`:
- Around line 31-37: The environment cleanup in the CI-compatible inference test
is using a conditional delete pattern that trips test-conditionals:scan. Update
the setup around the env merge in ci-compatible-inference.test.ts to build env
from a sanitized process.env snapshot up front, then merge hostedEnv without any
post-merge if/delete logic; use the existing hostedEnv and env initialization
block as the place to refactor this.
🪄 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: d820f870-b652-4889-845d-f8f3f12d1c12

📥 Commits

Reviewing files that changed from the base of the PR and between c6a63f7 and f0b9860.

📒 Files selected for processing (4)
  • test/e2e-scenario/fixtures/ci-compatible-inference.ts
  • test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts
  • test/e2e-scenario/support-tests/ci-compatible-inference.test.ts
  • test/e2e-script-workflow.test.ts
💤 Files with no reviewable changes (1)
  • test/e2e-script-workflow.test.ts

Comment thread test/e2e-scenario/support-tests/ci-compatible-inference.test.ts Outdated
@cv

cv commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Automated review follow-up for current head 363981802f39069445840088e1bc29f133f87e04:

  • The CodeRabbit conditional-cleanup finding is fixed by building the child environment from a sanitized process.env snapshot. The growth guardrail and focused support suite are green.
  • The issue [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 source boundary is intentional: this repro mutates sandbox DOCKER-USER egress, while hosted-compatible inference is routed by the OpenShell gateway and cannot be made unreachable by that mutation. The shared TypeScript predicate mirrors the legacy shell helper, covers both the explicit sentinel and provider/key-derived mode, and the runtime support test proves the actual live Vitest entrypoint skips before config lookup, onboarding, or firewall mutation.
  • The nested Vitest invocation is retained because it is the public-boundary behavioral coverage requested by CodeRabbit. It is secondary to seven fast pure-predicate cases, completes in about one second locally, uses the repository-pinned Vitest entrypoint, and runs without credentials.
  • Tightening the pre-existing public-inference [DGX Spark][CLI&UX] openclaw tui shows indefinite spinner with no error when inference endpoint is unreachable #4434 capture analyzer to require new structured-error clauses is outside this hosted-routing fix. Doing that safely needs a fresh public nvapi-* capture showing the current upstream TUI wording; guessing those clauses here could create a false release gate. The hosted job now exits cleanly because its sandbox-egress premise does not apply.
  • The double-onboard source contract pins the exact target-scoped endpoint wiring, while the dispatched live double-onboard-vitest job is the behavioral proof. Exporting a file-local live-scenario helper solely for a unit test would widen the test API without adding lifecycle evidence.
  • The marker-sidecar rationale is captured in the PR summary and exercised by the focused sanitization/cleanup tests: Expect owns the buffered raw PTY log, while lifecycle markers use a sidecar so the raw-log close cannot overwrite them.

No automated reviewer reports a required/security/correctness finding on the current head.

@cv
cv enabled auto-merge (squash) June 27, 2026 21:44
@cv
cv disabled auto-merge June 27, 2026 21:44
@cv
cv merged commit 798c19f into main Jun 27, 2026
45 checks passed
@cv
cv deleted the codex/fix-deepagents-tui-marker-sidecar branch June 27, 2026 21:44
@cv cv added the v0.0.69 label Jun 27, 2026
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Stabilizes the final residual release-gate harnesses uncovered by fresh
`main` validation. Deep Agents TUI evidence now uses a sidecar so
Expect's buffered `log_file` cannot overwrite lifecycle markers, the
issue NVIDIA#4434 sandbox-egress repro skips gateway-managed hosted inference
just as its legacy shell lane already does, and double-onboard stale
recovery receives its exact target-scoped custom endpoint.

## Changes
- Write Deep Agents prompt and lifecycle evidence to a separate marker
sidecar, fold it into the sanitized capture, and remove the sensitive
intermediate during cleanup.
- Preserve the actual prompt match alongside readiness and exit markers
so strict prompt/exit assertions remain intact.
- Skip the issue NVIDIA#4434 sandbox-egress firewall repro before onboarding
or mutation when either the explicit sentinel or hosted-compatible key
selects gateway-managed inference.
- Align double-onboard stale rebuild recovery with the legacy shell gate
by passing the target's fake endpoint instead of intentionally
mismatched ambient values.
- Extend helper, image-contract, workflow, and runtime support tests for
the new boundaries.

## Type of Change

- [x] 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
<!-- Check all that apply. For any "covered by existing tests", "not
applicable", or waiver entry, add a brief justification on the same line
or in the Changes section. -->
- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: release-gate harness behavior
only; no user-facing behavior changed.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: self-review of E2E-only
capture cleanup and firewall preconditions; the sidecar is sanitized
then deleted, and the hosted-mode guard executes before onboarding or
firewall mutation.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [x] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

Targeted verification:

```bash
npm test -- --run test/deepagents-code-tui-startup-check.test.ts test/langchain-deepagents-code-image.test.ts test/e2e-script-workflow.test.ts test/e2e-scenario/support-tests/ci-compatible-inference.test.ts
NEMOCLAW_RUN_E2E_SCENARIOS=1 NEMOCLAW_ISSUE_4434_LIVE=1 NEMOCLAW_E2E_USE_HOSTED_INFERENCE=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/issue-4434-tui-unreachable-inference.test.ts --silent=false --reporter=default
bash -n test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
npx prek run shfmt --files test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
npx prek run shellcheck --files test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
npm run typecheck:cli
```

---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: Carlos Villela <cvillela@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved TUI startup lifecycle verification by isolating and
preserving readiness/exit marker streams through sanitization, and
ensuring temporary marker artifacts are fully cleaned up.
* Updated the live issue-4434 scenario to skip when gateway-managed
hosted inference is detected.

* **Tests**
* Expanded Deep Agents Code TUI startup e2e coverage to validate marker
appending/concatenation and final capture content.
* Added CI-compatible inference detection fixture coverage (including
live gating assertions).
* Enhanced double-onboard rebuild coverage to use the provided fake base
URL and avoid the prior hardcoded invalid endpoint/model.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants