Skip to content

test(e2e): handle satisfied 4462 legacy repro - #5412

Merged
cv merged 1 commit into
mainfrom
fix/issue-4462-legacy-no-pending
Jun 14, 2026
Merged

test(e2e): handle satisfied 4462 legacy repro#5412
cv merged 1 commit into
mainfrom
fix/issue-4462-legacy-no-pending

Conversation

@cv

@cv cv commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stabilizes the #4462 legacy characterization E2E when the modern sandbox no longer reproduces a pending gateway-pinned scope-upgrade failure. If the trigger agent completes through gateway mode without fallback markers and no pending request appears, the script now treats that as an explicit non-repro/satisfied outcome, still verifies no operator.admin grant, and continues to the final gateway-path agent proof.

Related Issue

Related to #4462.

Changes

  • Add a LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED state for test/e2e/test-issue-4462-scope-upgrade-approval.sh.
  • In legacy-repro mode, accept a trigger-agent success with preserved gateway URL and no fallback/pairing markers as a non-reproducible legacy condition.
  • Keep pending-request and operator.admin assertions, and still run the final gateway-mode agent verification before success.
  • Emit a distinct final result message when legacy characterization is skipped because no pending scope-upgrade was produced.

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)

Verification

  • 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)
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • 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:

  • bash -n test/e2e/test-issue-4462-scope-upgrade-approval.sh

Nightly evidence motivating this patch:

  • Full nightly run 27486208320 failed issue-4462-gateway-pinned-approval-characterization-e2e because the legacy trigger agent completed successfully through gateway mode without producing a pending scope-upgrade request to characterize.

Docs review: no user-facing docs changes needed; this is E2E harness stabilization only.


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

Summary by CodeRabbit

  • Tests
    • Improved end-to-end test suite for scope-upgrade approval scenarios with enhanced handling of legacy-repro cases and better distinction between different completion paths, ensuring more accurate validation across scenarios.

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

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The E2E test script for issue #4462 gains a LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED flag. It is set in Phase 4 when the trigger agent completes via gateway mode without leaving a pending scope-upgrade request. The flag relaxes a post-approval paired-device validation and routes the test to a dedicated success message and finish_success branch.

Changes

Legacy scope-upgrade gateway-mode handling

Layer / File(s) Summary
Flag declaration and gateway-mode detection
test/e2e/test-issue-4462-scope-upgrade-approval.sh
Declares LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED alongside SCOPE_UPGRADE_ALREADY_SATISFIED (lines 114–119), then adds a Phase 4 branch (lines 991–1002) that sets the flag when trigger_output matches gateway-mode URL/rc markers and excludes embedded/fallback/pending signatures, instead of treating the absent pending request as a hard failure.
Post-approval validation and success reporting
test/e2e/test-issue-4462-scope-upgrade-approval.sh
Relaxes the empty paired_with_agent_scopes failure check to skip when LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED=1 (line 1035), adds a dedicated legacy success message (lines 1045–1046), and appends a finish_success branch that reports gateway-path verification for the not-reproduced outcome (lines 1107–1109).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • NVIDIA/NemoClaw#5406: Modifies the same E2E script (test/e2e/test-issue-4462-scope-upgrade-approval.sh) with overlapping legacy-repro gateway-path branching and success/failure handling logic around scope-upgrade characterization.

Suggested labels

nightly-e2e, area: onboarding

Poem

🐇 Hop, hop! The trigger ran through the gate,
No pending request left — but that's okay, mate!
A flag now remembers: "not reproduced today,"
The validation relaxes and lets it pass — hooray!
The gateway path verified, the test hops away. 🌟

🚥 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 'test(e2e): handle satisfied 4462 legacy repro' is directly related to the main change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/issue-4462-legacy-no-pending

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

@github-code-quality

github-code-quality Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the fix/issue-4462-legac... 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 fix/issue-4462-legac... 165c9e2 +/-
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 fix/issue-4462-legac... branch is 44%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main fix/issue-4462-legac... 165c9e2 +/-
src/lib/state/o...oard-session.ts 90%
src/lib/inference/local.ts 77%
src/lib/sandbox/config.ts 72%
src/lib/inference/nim.ts 72%
src/lib/onboard/preflight.ts 64%
src/lib/state/sandbox.ts 55%
src/lib/onboard...er-gpu-patch.ts 50%
src/lib/actions...licy-channel.ts 49%
src/lib/policy/index.ts 48%
src/lib/onboard.ts 17%

Updated June 14, 2026 03:17 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: test/e2e/test-issue-4462-scope-upgrade-approval.sh

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None.

Optional E2E

  • test/e2e/test-issue-4462-scope-upgrade-approval.sh (high): Optional validation of the edited E2E script itself, especially the legacy-repro branch and scope-upgrade-not-reproduced handling. This is not merge-blocking because only test code changed.

New E2E recommendations

  • None.

@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: None
Optional Vitest E2E scenarios: None

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • None. This PR only changes a shell E2E test under test/e2e/, outside the Vitest scenario system. It does not affect test/e2e-scenario fixtures, live Vitest scenario wiring, registry metadata, runtime support, or .github/workflows/e2e-vitest-scenarios.yaml, so there is no Vitest scenario dispatch to recommend.

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • None.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 3 worth checking, 0 nice ideas
Top item: Constrain the legacy non-repro skip path

Review findings

🛠️ Needs attention

  • None.

🔎 Worth checking

  • Source-of-truth review needed: LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED compatibility branch in test/e2e/test-issue-4462-scope-upgrade-approval.sh: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Evidence: The new comments and final result message state that characterization is skipped when the trigger completes without a pending scope-upgrade, but they do not define when that skip should be removed.
  • Legacy non-repro path weakens the authorization assertion (test/e2e/test-issue-4462-scope-upgrade-approval.sh:991): In legacy-repro mode, the new branch treats a successful trigger agent run with a ws:// gateway marker and no known fallback strings as enough to skip the pending scope-upgrade characterization. The later state check also skips requiring a paired CLI device with operator.read/operator.write when LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED=1, leaving only the no-operator.admin assertion plus final agent success. This is not a production auth bypass, but it reduces the E2E's ability to catch regressions in the scope-upgrade authorization state transition.
    • Recommendation: Either keep verifying the expected paired operator.read/operator.write state before declaring the non-repro path satisfied, or document why final gateway-agent success is the intended replacement authorization proof and make the final result clearly diagnostic rather than equivalent to the characterization path.
    • Evidence: The new branch sets LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED=1 when __TRIGGER_AGENT_RC__=0 and no fallback markers are present; later the script bypasses the paired_with_agent_scopes failure with `[ -z "$paired_with_agent_scopes" ] && [ "$LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED" != "1" ]`.
  • Document the source and removal condition for the legacy compatibility path (test/e2e/test-issue-4462-scope-upgrade-approval.sh:114): This is a localized tolerance path for a legacy repro that may no longer create a pending scope-upgrade request. The code explains the symptom, but it does not record the source boundary, why the pending-request source cannot be made deterministic here, what regression signal should keep the branch valid, or when this compatibility branch should be removed. Without that, the harness can drift from a characterization test into a broad success path as the surrounding OpenClaw pairing behavior continues to change.
    • Recommendation: Add an in-code note near LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED that identifies the upstream/current sandbox state that creates the no-pending condition, why this E2E must tolerate it instead of fixing the source, the regression signal that still fails the test, and the condition for removing the branch.
    • Evidence: The new comments say a trigger that succeeds without producing a pending upgrade leaves no gateway-pinned approve request to characterize, and the final result says characterization was skipped, but no removal condition or source-boundary rationale is encoded.

🌱 Nice ideas

  • None.
Consider writing more tests for
  • **Acceptance clause:** NemoClaw/OpenClaw appears to auto-pair the CLI device with a minimal operator.pairing scope. — add test evidence or identify existing coverage. The existing script still checks for a low-scope paired CLI device unless SCOPE_UPGRADE_ALREADY_SATISFIED=1; this PR adds an additional legacy-repro tolerance when no pending upgrade is produced after the trigger.
  • **Acceptance clause:** When openclaw agent runs, the CLI asks the gateway for broader operator scopes such as operator.read and operator.write. — add test evidence or identify existing coverage. The existing pending-request path still looks for a scope-upgrade request, but the new legacy-repro branch allows success when the trigger agent completes without producing a pending request.
  • **Acceptance clause:** The gateway correctly creates a pending scope-upgrade request and rejects the connection until that upgrade is approved. — add test evidence or identify existing coverage. The prior behavior is still covered when scope_request_id is found. The new branch intentionally treats absence of a pending request as a non-repro/satisfied outcome in legacy-repro mode.
  • **Acceptance clause:** However, trying to approve the request with openclaw devices approve <requestId> fails because the approve command itself appears to connect using the broader unapproved scope set, causing the same scope upgrade pending approval error. — add test evidence or identify existing coverage. legacy_gateway_pinned_approval_characterization remains unchanged for cases with a request id, but the PR skips it when LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED=1.
  • **Acceptance clause:** This creates a deadlock: the CLI has enough permission to see the pending request, but not enough to approve it, and the approval command cannot complete because it requires the very scope upgrade it is trying to approve. — add test evidence or identify existing coverage. The deadlock characterization remains in the pending-request path only. The new non-repro path explicitly reports that there was no pending scope-upgrade to characterize.
  • **LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED compatibility branch in test/e2e/test-issue-4462-scope-upgrade-approval.sh** — The existing final Phase 5 gateway-agent proof and no-operator.admin assertion still run, but there is no small branch-level regression test for the new no-pending compatibility path.. The new comments and final result message state that characterization is skipped when the trigger completes without a pending scope-upgrade, but they do not define when that skip should be removed.

Workflow run details

This is an automated advisory review. 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/e2e/test-issue-4462-scope-upgrade-approval.sh (1)

1002-1014: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don't exit the reproduced legacy path before Phase 5.

This branch still calls finish_success immediately after characterization, so the legacy-repro path that does reproduce the pending failure never executes the final gateway-path agent check. That lets this mode pass without the verification the PR description says is preserved.

Suggested change
   if [ "$TEST_MODE" = "legacy-repro" ] && [ "$LEGACY_SCOPE_UPGRADE_NOT_REPRODUCED" != "1" ]; then
     legacy_gateway_pinned_approval_characterization "$scope_request_id" || exit 1
     if [ "$FAIL" -gt 0 ]; then
       section "Summary"
       echo ""
       printf '  Total: %d | \033[32mPass: %d\033[0m | \033[31mFail: %d\033[0m\n' \
         "$TOTAL" "$PASS" "$FAIL"
       echo ""
       echo "RESULT: FAILED - ${FAIL} test(s) failed"
       exit 1
     fi
-    finish_success "RESULT: PASSED - `#4462` legacy gateway-pinned approval behavior characterized and final state handled"
+    info "Legacy gateway-pinned approval behavior characterized; continuing to final gateway-path verification"
   fi

Based on PR objectives, this path is still supposed to run the final gateway-mode agent verification before reporting success.

🤖 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/test-issue-4462-scope-upgrade-approval.sh` around lines 1002 - 1014,
The issue is that the legacy-repro path calls finish_success immediately after
the characterization phase, which causes an early exit and prevents Phase 5 (the
final gateway-path agent verification) from executing. To fix this, remove the
finish_success call from within the legacy-repro conditional block so that
control flow continues to execute Phase 5. The finish_success call for the
legacy-repro path should either be moved to after Phase 5 completes or
restructured so that the legacy-repro verification logic does not exit
prematurely but allows the subsequent gateway-mode agent check to run before
reporting success.
🤖 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.

Outside diff comments:
In `@test/e2e/test-issue-4462-scope-upgrade-approval.sh`:
- Around line 1002-1014: The issue is that the legacy-repro path calls
finish_success immediately after the characterization phase, which causes an
early exit and prevents Phase 5 (the final gateway-path agent verification) from
executing. To fix this, remove the finish_success call from within the
legacy-repro conditional block so that control flow continues to execute Phase
5. The finish_success call for the legacy-repro path should either be moved to
after Phase 5 completes or restructured so that the legacy-repro verification
logic does not exit prematurely but allows the subsequent gateway-mode agent
check to run before reporting success.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: de6a20c3-972d-47ff-9bcf-8f6105fa356f

📥 Commits

Reviewing files that changed from the base of the PR and between 129717f and 165c9e2.

📒 Files selected for processing (1)
  • test/e2e/test-issue-4462-scope-upgrade-approval.sh

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 27486841808
Target ref: fix/issue-4462-legacy-no-pending
Requested jobs: issue-4462-gateway-pinned-approval-characterization-e2e
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
issue-4462-gateway-pinned-approval-characterization-e2e ✅ success

@cv
cv merged commit 1f75d03 into main Jun 14, 2026
117 checks passed
@cv
cv deleted the fix/issue-4462-legacy-no-pending branch June 14, 2026 03:36
@cv cv added the v0.0.65 label Jun 15, 2026
jyaunches added a commit that referenced this pull request Jun 25, 2026
## Summary
Restore the Kimi-specific issue #5800 parity work for package `P0-D`;
existing recovery and scope-upgrade package rows are explicitly mapped
as pre-existing coverage and revalidated context, but not changed
acceptance scope in this PR.

## Related Issues
Refs #5800
Refs #5098
Refs #5342
Refs #5401
Refs #5406
Refs #5412
Refs #5413
Refs #5625
Refs #5760

## Scope gate
- Package: `P0-D — Recovery, Kimi, and scope-upgrade parity`
- Included PRs all merged and touched `test/e2e`: yes
- Changed acceptance scope in this PR: Kimi public-NVIDIA/mock parity
(`D2`, `D3`)
- Existing package rows revalidated without diff changes: recovery
(`D1`) and scope-upgrade (`D4`)
- Out of scope: unmerged/non-bash PRs; shell lane retirement / PR #5756
cleanup

## Parity map
| ID | Source PR | Contract | Inference classification | Vitest
assertion / waiver | Status |
| --- | --- | --- | --- | --- | --- |
| D1 | #5342, #5401 | Recovery proxy env sourcing, missing proxy-env
warning, guard retention, ciao/networkInterfaces preload, and crash-loop
stability are pre-existing package coverage. | `hermetic-default` |
Existing
`test/e2e-scenario/live/issue-2478-crash-loop-recovery.test.ts`,
`test/e2e-scenario/support-tests/e2e-recovery-helpers.test.ts`;
selective run `28186561267` job `issue-2478-crash-loop-recovery-vitest`
passed. No diff changes here. | existing / revalidated context |
| D2 | #5401 | Kimi remains a public-NVIDIA model/provider contract when
run in trusted selective CI, while retaining mock fallback for
local/untrusted validation. | `public-nvidia required` |
`.github/workflows/e2e-vitest-scenarios.yaml`,
`test/e2e-scenario/live/kimi-inference-compat.test.ts`,
`test/e2e-scenario/support-tests/kimi-inference-compat-helpers.test.ts`,
`test/e2e-script-workflow.test.ts` | covered / changed |
| D3 | #5413, #5625 | Kimi multiturn tool calls split `hostname; date;
uptime`, preserve tool-result flow, reject abandoned/continue traces,
and normalize final punctuation. | `public-nvidia required` with mock
fallback | `test/e2e-scenario/live/kimi-inference-compat-helpers.ts`
trajectory assertions; selective run `28190216767` job
`kimi-inference-compat-vitest` passed on the previous head; latest run
`28193896380` passed on `f36fef6da`. | covered / changed |
| D4 | #5406, #5412, #5760 | Scope-upgrade approval tolerates
preapproved / not-reproduced states, denies `operator.admin` leakage,
stays on gateway/no embedded fallback, and accepts whitespace-normalized
`42`; this is pre-existing package coverage. | `hosted-compatible
capable` | Existing
`test/e2e-scenario/live/issue-4462-scope-upgrade-approval.test.ts`;
selective run `28186561267` job
`issue-4462-scope-upgrade-approval-vitest` passed. No diff changes here.
| existing / revalidated context |

## Inference mode support
- Default mode for touched live target: Kimi `mock` unless workflow
selects `public-nvidia`.
- Real inference support preserved: yes for Kimi public NVIDIA; yes for
existing scope-upgrade hosted-compatible; not required for recovery.
- Modes validated in this PR: Kimi public NVIDIA via selective workflows
`28188683830`, `28190216767`; latest follow-up validation `28193896380`
is running for head `f36fef6da`. Kimi helper/mock behavior via local
support tests.
- Source-of-truth contract: `NEMOCLAW_E2E_INFERENCE_MODE` is the
canonical selector; absent selector defaults to mock for local/untrusted
validation; unknown explicit values now fail closed; legacy
`NEMOCLAW_KIMI_USE_MOCK=0` remains only as a temporary shell-lane
compatibility alias until shell retirement.
- Secret boundary: public Kimi workflow passes only `NVIDIA_API_KEY`;
helper probe envs are secret-free by default; raw public NVIDIA key
handoff is limited to onboard; sandbox `openclaw agent` now runs with a
secret-free env and uses the configured `nvidia-prod` route.

## Validation
- [x] `npx vitest run --project e2e-vitest-support
test/e2e-scenario/support-tests/kimi-inference-compat-helpers.test.ts`
- [x] `npx vitest run test/e2e-script-workflow.test.ts`
- [x] `npm run typecheck:cli`
- [x] `npm run test-conditionals:scan -- --top 25`
- [x] `npx prek run --all-files --stage pre-push --skip tsc-plugin
--skip tsc-js --skip tsc-cli --skip version-tag-sync --skip test-cli
--skip test-plugin --skip source-shape-test-budget --skip
test-file-size-budget --skip test-skills-yaml`
- [x] `git diff --check`
- [x] Kimi selective E2E / Vitest Scenarios on previous head:
https://github.com/NVIDIA/NemoClaw/actions/runs/28190216767
- [x] Kimi selective E2E / Vitest Scenarios after review-gap fixes:
https://github.com/NVIDIA/NemoClaw/actions/runs/28193896380
- [x] Existing recovery/scope rows revalidated in selective run:
https://github.com/NVIDIA/NemoClaw/actions/runs/28186561267
(`issue-2478-crash-loop-recovery-vitest` ✅,
`issue-4462-scope-upgrade-approval-vitest` ✅; Kimi in that stale run was
superseded)
- [ ] Local live mock Kimi: attempted but blocked by local Docker daemon
unavailable (`Cannot connect to the Docker daemon at
unix:///Users/jyaunches/.docker/run/docker.sock`). CI selective run is
the live validation path for this head.

## Follow-ups / waivers
- None.


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

## Summary by CodeRabbit

* **New Features**
* Added support for running Kimi compatibility e2e checks in either mock
or public NVIDIA mode.
* The live scenario now adapts its setup, redaction, and traffic
validation based on the selected mode.

* **Bug Fixes**
* Improved handling of API key propagation so public NVIDIA runs use the
expected credentials without exposing secrets in other paths.

* **Tests**
* Added coverage for mode selection, API key validation, workflow
environment wiring, and the new public NVIDIA Vitest lane.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary
Restore the Kimi-specific issue NVIDIA#5800 parity work for package `P0-D`;
existing recovery and scope-upgrade package rows are explicitly mapped
as pre-existing coverage and revalidated context, but not changed
acceptance scope in this PR.

## Related Issues
Refs NVIDIA#5800
Refs NVIDIA#5098
Refs NVIDIA#5342
Refs NVIDIA#5401
Refs NVIDIA#5406
Refs NVIDIA#5412
Refs NVIDIA#5413
Refs NVIDIA#5625
Refs NVIDIA#5760

## Scope gate
- Package: `P0-D — Recovery, Kimi, and scope-upgrade parity`
- Included PRs all merged and touched `test/e2e`: yes
- Changed acceptance scope in this PR: Kimi public-NVIDIA/mock parity
(`D2`, `D3`)
- Existing package rows revalidated without diff changes: recovery
(`D1`) and scope-upgrade (`D4`)
- Out of scope: unmerged/non-bash PRs; shell lane retirement / PR NVIDIA#5756
cleanup

## Parity map
| ID | Source PR | Contract | Inference classification | Vitest
assertion / waiver | Status |
| --- | --- | --- | --- | --- | --- |
| D1 | NVIDIA#5342, NVIDIA#5401 | Recovery proxy env sourcing, missing proxy-env
warning, guard retention, ciao/networkInterfaces preload, and crash-loop
stability are pre-existing package coverage. | `hermetic-default` |
Existing
`test/e2e-scenario/live/issue-2478-crash-loop-recovery.test.ts`,
`test/e2e-scenario/support-tests/e2e-recovery-helpers.test.ts`;
selective run `28186561267` job `issue-2478-crash-loop-recovery-vitest`
passed. No diff changes here. | existing / revalidated context |
| D2 | NVIDIA#5401 | Kimi remains a public-NVIDIA model/provider contract when
run in trusted selective CI, while retaining mock fallback for
local/untrusted validation. | `public-nvidia required` |
`.github/workflows/e2e-vitest-scenarios.yaml`,
`test/e2e-scenario/live/kimi-inference-compat.test.ts`,
`test/e2e-scenario/support-tests/kimi-inference-compat-helpers.test.ts`,
`test/e2e-script-workflow.test.ts` | covered / changed |
| D3 | NVIDIA#5413, NVIDIA#5625 | Kimi multiturn tool calls split `hostname; date;
uptime`, preserve tool-result flow, reject abandoned/continue traces,
and normalize final punctuation. | `public-nvidia required` with mock
fallback | `test/e2e-scenario/live/kimi-inference-compat-helpers.ts`
trajectory assertions; selective run `28190216767` job
`kimi-inference-compat-vitest` passed on the previous head; latest run
`28193896380` passed on `f36fef6da`. | covered / changed |
| D4 | NVIDIA#5406, NVIDIA#5412, NVIDIA#5760 | Scope-upgrade approval tolerates
preapproved / not-reproduced states, denies `operator.admin` leakage,
stays on gateway/no embedded fallback, and accepts whitespace-normalized
`42`; this is pre-existing package coverage. | `hosted-compatible
capable` | Existing
`test/e2e-scenario/live/issue-4462-scope-upgrade-approval.test.ts`;
selective run `28186561267` job
`issue-4462-scope-upgrade-approval-vitest` passed. No diff changes here.
| existing / revalidated context |

## Inference mode support
- Default mode for touched live target: Kimi `mock` unless workflow
selects `public-nvidia`.
- Real inference support preserved: yes for Kimi public NVIDIA; yes for
existing scope-upgrade hosted-compatible; not required for recovery.
- Modes validated in this PR: Kimi public NVIDIA via selective workflows
`28188683830`, `28190216767`; latest follow-up validation `28193896380`
is running for head `f36fef6da`. Kimi helper/mock behavior via local
support tests.
- Source-of-truth contract: `NEMOCLAW_E2E_INFERENCE_MODE` is the
canonical selector; absent selector defaults to mock for local/untrusted
validation; unknown explicit values now fail closed; legacy
`NEMOCLAW_KIMI_USE_MOCK=0` remains only as a temporary shell-lane
compatibility alias until shell retirement.
- Secret boundary: public Kimi workflow passes only `NVIDIA_API_KEY`;
helper probe envs are secret-free by default; raw public NVIDIA key
handoff is limited to onboard; sandbox `openclaw agent` now runs with a
secret-free env and uses the configured `nvidia-prod` route.

## Validation
- [x] `npx vitest run --project e2e-vitest-support
test/e2e-scenario/support-tests/kimi-inference-compat-helpers.test.ts`
- [x] `npx vitest run test/e2e-script-workflow.test.ts`
- [x] `npm run typecheck:cli`
- [x] `npm run test-conditionals:scan -- --top 25`
- [x] `npx prek run --all-files --stage pre-push --skip tsc-plugin
--skip tsc-js --skip tsc-cli --skip version-tag-sync --skip test-cli
--skip test-plugin --skip source-shape-test-budget --skip
test-file-size-budget --skip test-skills-yaml`
- [x] `git diff --check`
- [x] Kimi selective E2E / Vitest Scenarios on previous head:
https://github.com/NVIDIA/NemoClaw/actions/runs/28190216767
- [x] Kimi selective E2E / Vitest Scenarios after review-gap fixes:
https://github.com/NVIDIA/NemoClaw/actions/runs/28193896380
- [x] Existing recovery/scope rows revalidated in selective run:
https://github.com/NVIDIA/NemoClaw/actions/runs/28186561267
(`issue-2478-crash-loop-recovery-vitest` ✅,
`issue-4462-scope-upgrade-approval-vitest` ✅; Kimi in that stale run was
superseded)
- [ ] Local live mock Kimi: attempted but blocked by local Docker daemon
unavailable (`Cannot connect to the Docker daemon at
unix:///Users/jyaunches/.docker/run/docker.sock`). CI selective run is
the live validation path for this head.

## Follow-ups / waivers
- None.


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

## Summary by CodeRabbit

* **New Features**
* Added support for running Kimi compatibility e2e checks in either mock
or public NVIDIA mode.
* The live scenario now adapts its setup, redaction, and traffic
validation based on the selected mode.

* **Bug Fixes**
* Improved handling of API key propagation so public NVIDIA runs use the
expected credentials without exposing secrets in other paths.

* **Tests**
* Added coverage for mode selection, API key validation, workflow
environment wiring, and the new public NVIDIA Vitest lane.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure chore Build, CI, dependency, or tooling maintenance 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 chore Build, CI, dependency, or tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants