Skip to content

test(e2e): tolerate preapproved scope upgrades - #5406

Merged
cv merged 3 commits into
mainfrom
fix/issue-4462-preapproved-scope-e2e
Jun 14, 2026
Merged

test(e2e): tolerate preapproved scope upgrades#5406
cv merged 3 commits into
mainfrom
fix/issue-4462-preapproved-scope-e2e

Conversation

@cv

@cv cv commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updates the #4462 scope-upgrade E2E to accept the current healthy state where onboard/finalization has already pre-approved the CLI operator.read/operator.write scopes without operator.admin. The full nightly run showed both #4462 jobs failing because they still required an intermediate low-scope CLI device even when the sandbox was already in the desired final scoped state.

Related Issue

Related to #4462.

Changes

  • Add a shared success-summary helper in test/e2e/test-issue-4462-scope-upgrade-approval.sh.
  • Treat an already paired CLI device with operator.read/operator.write and no operator.admin as a passing terminal state before pending-state characterization.
  • Reuse the summary helper for existing success exits.

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

Full nightly evidence:

  • issue-4462-scope-upgrade-approval-e2e and issue-4462-gateway-pinned-approval-characterization-e2e failed on main run 27483357918 with pending=0 paired=1 and approved scopes operator.pairing,operator.read,operator.write, which this PR now recognizes as the desired already-satisfied state.

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 flow with centralized success handling, clearer Total/Pass/Fail reporting, and consistent exit behavior.
    • Added validation for supported run modes, and enhanced logic to recognize when low-scope approval is already sufficient—skipping redundant checks and agent-trigger steps with dedicated messaging.
    • Refined later-phase gating so failures reliably stop with a summary, while successful runs emit an appropriate success message (including a distinct path for legacy-repro when preapproval was already satisfied).

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

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: 7db7e2c1-f3e2-4936-82f3-bfa519a0ff12

📥 Commits

Reviewing files that changed from the base of the PR and between 9d1c506 and d5c7ee7.

📒 Files selected for processing (1)
  • test/e2e/test-issue-4462-scope-upgrade-approval.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/test-issue-4462-scope-upgrade-approval.sh

📝 Walkthrough

Walkthrough

A new finish_success() helper consolidates success-exit handling by printing the aggregated Total/Pass/Fail summary and exiting 0. Mode validation restricts NEMOCLAW_4462_MODE to approval or legacy-repro. A SCOPE_UPGRADE_ALREADY_SATISFIED flag gates approval flow: Phase 3 detects whether the low-scope CLI device already has operator.read/operator.write without operator.admin, and when set, Phase 4 skips agent trigger and approval steps entirely. Phase 4 scope-upgrade handling is refactored to support legacy-repro characterization with FAIL branching. Phase 5 completes via the helper, guarded by a FAIL check.

Changes

finish_success() helper and already-satisfied approval gating

Layer / File(s) Summary
Helper and mode validation foundation
test/e2e/test-issue-4462-scope-upgrade-approval.sh
Adds finish_success() to print Total/Pass/Fail summary, echo the supplied result message, and exit 0. Adds NEMOCLAW_4462_MODE validation guard restricting mode to approval or legacy-repro, exiting 1 on invalid values. Initializes SCOPE_UPGRADE_ALREADY_SATISFIED flag to 0, controlling approval-flow gating throughout Phase 3–5.
Phase 3: Detect already-satisfied condition and validate conditionally
test/e2e/test-issue-4462-scope-upgrade-approval.sh
Phase 3 device state detects when low-scope CLI device has operator.read/operator.write without operator.admin and sets the flag to 1. Phase 3 post-approval validation then branches: when flag is set, skips re-checks and emits early pass; otherwise verifies the expected paired-without-write condition and fails on mismatch.
Phase 4: Conditional skipping and scope-upgrade handling
test/e2e/test-issue-4462-scope-upgrade-approval.sh
Phase 4 entry skips auto-pair watcher wait and entire trigger/approval sequence when already-satisfied flag is set. Phase 4 core logic polls for scope-upgrade pending state, logs trigger output, derives request ID when needed, characterizes legacy-repro behavior branching on FAIL > 0, and gates manual scope-upgrade approval on request ID presence. Phase 4 exit emits "already satisfied" pass when flag is set, otherwise emits standard approval-grants messaging.
Phase 5: Final completion with FAIL guard and finish_success()
test/e2e/test-issue-4462-scope-upgrade-approval.sh
Phase 5 gateway-path gate checks FAIL > 0: on failure, prints summary and exits 1; on success, calls finish_success() with result message. When legacy-repro and already-satisfied flag is set, uses specialized message indicating legacy characterization was skipped; otherwise uses standard gateway-path success message.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Suggested labels

nightly-e2e

Poem

🐇 A flag twirls to ask: "Already there?"
If yes, skip ahead—no approval to spare!
finish_success() hops in for the finale,
With Pass and Fail counts—a summary's regale-y.
One warren, one flow, now neatly ordained,
The rabbit's pleased—approval's well-trained! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the E2E test to handle pre-approved scope upgrades that are already satisfied.
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-preapproved-scope-e2e

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-preap... 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-preap... d5c7ee7 +/-
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-preap... 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-preap... d5c7ee7 +/-
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 01:59 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: issue-4462-scope-upgrade-approval-e2e, issue-4462-gateway-pinned-approval-characterization-e2e
Optional E2E: None

Dispatch hint: issue-4462-scope-upgrade-approval-e2e,issue-4462-gateway-pinned-approval-characterization-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • issue-4462-scope-upgrade-approval-e2e (high): This is the primary job backed by the modified script in approval mode. The diff changes the pass/fail logic for preapproved scope-upgrade states and final gateway-path verification, so the affected E2E should run to validate the updated CI coverage.
  • issue-4462-gateway-pinned-approval-characterization-e2e (high): The same modified script also contains legacy-repro mode changes, including handling of already-satisfied scope upgrades and summary behavior. Run the characterization job to ensure the legacy diagnostic path still behaves correctly.

Optional E2E

  • None.

New E2E recommendations

  • None.

Dispatch hint

  • Workflow: .github/workflows/nightly-e2e.yaml
  • jobs input: issue-4462-scope-upgrade-approval-e2e,issue-4462-gateway-pinned-approval-characterization-e2e

@github-actions

github-actions Bot commented Jun 14, 2026

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. The only changed file is under test/e2e/ and does not affect the Vitest scenario system under test/e2e-scenario/ or .github/workflows/e2e-vitest-scenarios.yaml.

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • None.

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 2 worth checking, 0 nice ideas
Since last review: 2 prior items resolved, 1 still applies, 0 new items found

Review findings

🛠️ Needs attention

  • None.

🔎 Worth checking

  • Source-of-truth review needed: Preapproved CLI scope-upgrade tolerance 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: SCOPE_UPGRADE_ALREADY_SATISFIED=1 is set for paired read/write/no-admin, Phase 4 skips trigger/approval, and the final result may say legacy characterization was skipped because the upgrade was already satisfied.
  • Preapproved scope-upgrade path can skip the approval transition this E2E is meant to guard (test/e2e/test-issue-4462-scope-upgrade-approval.sh:109): The new tolerated state accepts a CLI device that already has operator.read/operator.write without operator.admin, then skips the agent-trigger and devices-approve path. The script still verifies the final gateway agent path and no admin scope, which is useful, and invalid mode validation now happens early. However, on preapproved runs the security regression no longer proves the linked issue clauses where openclaw agent asks for broader scopes, the gateway creates a pending scope-upgrade request, and the fixed approve path clears it. The source-of-truth for why onboarding may preapprove these scopes, why that source cannot be made deterministic here, and when this tolerance can be removed is still not encoded.
    • Recommendation: Make the tolerated preapproved state an explicit contract: document the exact source boundary in code, why the source cannot be fixed in this PR, and the removal condition. Also keep or add a deterministic low-scope path/job that still exercises request creation plus fixed devices approve, so a preapproved final-state pass cannot be mistaken for approval-transition coverage.
    • Evidence: The comment says current onboard finalization may already approve operator.read/write (lines 109-116). When SCOPE_UPGRADE_ALREADY_SATISFIED=1, Phase 4 skips trigger/approval, then only verifies no pending request, read/write, no admin, and final gateway success (lines 942-1014, 1094-1095).

🌱 Nice ideas

  • None.
Consider writing more tests for
  • **Runtime validation** — Invalid NEMOCLAW_4462_MODE fails during preflight even when the CLI device would otherwise be preapproved with read/write scopes.. The changed file is itself an E2E harness, so unit tests are not the main gap. Because it gates security-sensitive device authorization and gateway fallback behavior, runtime validation of both the normal low-scope path and the new preapproved branch would improve confidence.
  • **Runtime validation** — Preapproved CLI read/write/no-admin state skips trigger/approval but still runs Phase 5 and fails if final agent output contains embedded fallback or pairing markers.. The changed file is itself an E2E harness, so unit tests are not the main gap. Because it gates security-sensitive device authorization and gateway fallback behavior, runtime validation of both the normal low-scope path and the new preapproved branch would improve confidence.
  • **Runtime validation** — Preapproved CLI state with any operator.admin paired device fails before final success.. The changed file is itself an E2E harness, so unit tests are not the main gap. Because it gates security-sensitive device authorization and gateway fallback behavior, runtime validation of both the normal low-scope path and the new preapproved branch would improve confidence.
  • **Runtime validation** — Low-scope CLI state still triggers a pending scope-upgrade request, approves it with the fixed proxy-env guard, verifies the pending request is gone, and proves final gateway-mode agent success.. The changed file is itself an E2E harness, so unit tests are not the main gap. Because it gates security-sensitive device authorization and gateway fallback behavior, runtime validation of both the normal low-scope path and the new preapproved branch would improve confidence.
  • **Runtime validation** — legacy-repro with preapproved read/write/no-pending state reports characterization skipped and does not claim legacy gateway-pinned approve behavior was characterized.. The changed file is itself an E2E harness, so unit tests are not the main gap. Because it gates security-sensitive device authorization and gateway fallback behavior, runtime validation of both the normal low-scope path and the new preapproved branch would improve confidence.
  • **Acceptance clause:** NemoClaw/OpenClaw appears to auto-pair the CLI device with a minimal operator.pairing scope. In that state, openclaw devices list --json works and shows the CLI under paired, but only with operator.pairing. — add test evidence or identify existing coverage. The normal path still runs openclaw devices list --json and accepts a pending low-scope request or select_cli_paired_without_write, then asserts operator.pairing without operator.write. The new preapproved path accepts operator.read/operator.write already present, so this clause is not proven on every run.
  • **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 normal path still runs openclaw agent in Phase 4 and waits for a scope-upgrade request or auto-approved read/write. If SCOPE_UPGRADE_ALREADY_SATISFIED=1, the script skips the trigger because the scopes are already present.
  • **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 normal path still checks select_cli_request scope-upgrade or an auto-approved read/write device after the trigger. The preapproved path does not create or observe a pending request because it starts from the final scoped state.
Since last review details

Current findings:

  • Source-of-truth review needed: Preapproved CLI scope-upgrade tolerance 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: SCOPE_UPGRADE_ALREADY_SATISFIED=1 is set for paired read/write/no-admin, Phase 4 skips trigger/approval, and the final result may say legacy characterization was skipped because the upgrade was already satisfied.
  • Preapproved scope-upgrade path can skip the approval transition this E2E is meant to guard (test/e2e/test-issue-4462-scope-upgrade-approval.sh:109): The new tolerated state accepts a CLI device that already has operator.read/operator.write without operator.admin, then skips the agent-trigger and devices-approve path. The script still verifies the final gateway agent path and no admin scope, which is useful, and invalid mode validation now happens early. However, on preapproved runs the security regression no longer proves the linked issue clauses where openclaw agent asks for broader scopes, the gateway creates a pending scope-upgrade request, and the fixed approve path clears it. The source-of-truth for why onboarding may preapprove these scopes, why that source cannot be made deterministic here, and when this tolerance can be removed is still not encoded.
    • Recommendation: Make the tolerated preapproved state an explicit contract: document the exact source boundary in code, why the source cannot be fixed in this PR, and the removal condition. Also keep or add a deterministic low-scope path/job that still exercises request creation plus fixed devices approve, so a preapproved final-state pass cannot be mistaken for approval-transition coverage.
    • Evidence: The comment says current onboard finalization may already approve operator.read/write (lines 109-116). When SCOPE_UPGRADE_ALREADY_SATISFIED=1, Phase 4 skips trigger/approval, then only verifies no pending request, read/write, no admin, and final gateway success (lines 942-1014, 1094-1095).

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

cv added 2 commits June 13, 2026 17:58
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 27485432496
Target ref: fix/issue-4462-preapproved-scope-e2e
Requested jobs: issue-4462-scope-upgrade-approval-e2e,issue-4462-gateway-pinned-approval-characterization-e2e
Summary: 2 passed, 0 failed, 0 cancelled, 0 skipped

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

@cv
cv merged commit 9f604d1 into main Jun 14, 2026
115 checks passed
@cv
cv deleted the fix/issue-4462-preapproved-scope-e2e branch June 14, 2026 02:11
cv added a commit that referenced this pull request Jun 14, 2026
## Summary
Changes the hosted inference E2E preflight from an authenticated chat
completion to a lightweight HTTP reachability probe. This avoids
spending model requests and tripping HTTP 429 during full parallel
nightly runs before the scenario reaches the behavior under test.

## Related Issue
Related to #5406 nightly follow-up.

## Changes
- Update `test/e2e/lib/ci-compatible-inference.sh` so
`nemoclaw_e2e_probe_hosted_inference` checks network/TLS reachability
only and accepts any non-000 HTTP response.
- Add support-test coverage proving the probe does not call
`/chat/completions`.

## 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)

## Verification
- [ ] 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] Tests added or updated for new or changed behavior
- [x] 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](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:
- `npx biome check --write
test/e2e-scenario/support-tests/hosted-inference.test.ts`
- `bash -n test/e2e/lib/ci-compatible-inference.sh`
- `npx vitest run --project cli
test/e2e-scenario/support-tests/hosted-inference.test.ts`

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

Note: local broad hooks still fail in unrelated runtime recovery preload
tests because temp preload files are seen as group-writable
(`mode=664`), matching prior local hook failures. Targeted changed tests
passed.

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

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

* **Tests**
* Added end-to-end coverage for hosted inference probe validation,
including lightweight reachability assertions and negative cases when
connectivity fails or the probe reports errors.

* **Refactor**
* Updated the hosted inference probe to run a lightweight network/TLS
connectivity check only, avoiding authenticated requests and preventing
inference/auth-related endpoints from being called.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@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