Skip to content

fix(openclaw): handle 2026.5.27 approval compatibility#4786

Merged
cv merged 2 commits into
mainfrom
fix/openclaw-2026-5-27-compat
Jun 4, 2026
Merged

fix(openclaw): handle 2026.5.27 approval compatibility#4786
cv merged 2 commits into
mainfrom
fix/openclaw-2026-5-27-compat

Conversation

@cv
Copy link
Copy Markdown
Collaborator

@cv cv commented Jun 4, 2026

Summary

This PR keeps the OpenClaw 2026.5.27 upgrade path unblocked by handling its changed device-approval behavior and preventing generated Jiti source cache from tripping Bedrock leak scans. It also narrows NemoClaw auto-pair approvals so follow-on operator.admin requests are not approved automatically.

Related Issue

Refs #4462, #4434

Changes

  • Disable Jiti filesystem caching in the OpenClaw base/runtime images and runtime shell environment to avoid /tmp/jiti generated-source residue in sandbox leak scans.
  • Teach the in-sandbox openclaw devices approve compatibility shim to treat a non-zero OpenClaw approve as success when the requested scopes were actually applied.
  • Add scope allowlisting to startup and connect-time auto-pair approval passes, and strip gateway URL/port/token consistently for connect-time approvals.
  • Update OpenClaw CLI scope-upgrade approval deadlocks and forces openclaw agent into embedded fallback #4462 E2E assertions to focus on operator.write/operator.read upgrades and fail if operator.admin is auto-approved.
  • Add unit coverage for Jiti cache hardening and admin-scope auto-pair rejection.

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

  • npx prek run --all-files passes
  • npm test passes
  • 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)

Additional verification run:

  • npm run typecheck:cli
  • npx prek run --files Dockerfile Dockerfile.base scripts/nemoclaw-start.sh src/lib/actions/sandbox/connect.ts test/e2e/test-issue-4462-scope-upgrade-approval.sh test/nemoclaw-start.test.ts test/runner.test.ts test/sandbox-connect-inference.test.ts
  • npm test -- --run test/nemoclaw-start.test.ts test/sandbox-connect-inference.test.ts test/fetch-guard-patch-regression.test.ts test/runner.test.ts
  • npm test was attempted locally but did not fully pass because test/install-preflight.test.ts hit an environment-specific Podman/CDI preflight expectation (Host preflight found issues...) on this host.

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

Summary by CodeRabbit

  • Security Improvements

    • Enforced scope allowlists for device approval requests, rejecting malformed or disallowed scope payloads.
    • Hardened approval flow to verify requested scopes before and after approval and to remove gateway-related environment variables during approval.
    • Disabled JITI filesystem caching in base and runtime images to avoid persisting sensitive artifacts.
  • Tests

    • Added and extended unit and end-to-end tests for scope allowlist validation, malformed payload rejection, disallowed admin scope rejection, and runtime cache hardening.

@cv cv self-assigned this Jun 4, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

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: e6b72082-1ec5-46a2-96e1-b0176f6d9ee0

📥 Commits

Reviewing files that changed from the base of the PR and between bd1bb85 and 159cec9.

📒 Files selected for processing (4)
  • scripts/nemoclaw-start.sh
  • src/lib/actions/sandbox/connect.ts
  • test/nemoclaw-start.test.ts
  • test/sandbox-connect-inference.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/sandbox-connect-inference.test.ts
  • scripts/nemoclaw-start.sh

📝 Walkthrough

Walkthrough

Adds a scope allowlist and validation to auto-approval paths, sanitizes approve subprocess environment, extends the sandbox approve wrapper with before/after reconciliation, disables Jiti filesystem caching in runtime/proxy layers, and updates tests/E2E to assert and validate these changes.

Changes

OpenClaw scope allowlist hardening and Jiti cache disabling

Layer / File(s) Summary
Jiti filesystem cache hardening across runtime
Dockerfile.base, Dockerfile, scripts/nemoclaw-start.sh, test/runner.test.ts
JITI_FS_CACHE=false added to base and runtime Dockerfiles and exported in generated proxy env; tests assert the presence of the setting across these files.
Scope allowlist enforcement in auto-pair watcher
scripts/nemoclaw-start.sh, test/nemoclaw-start.test.ts
Adds ALLOWED_SCOPES and requested_scopes() helper; watcher rejects malformed or disallowed requested scopes and logs rejections; unit tests cover malformed and admin-scope rejections.
Connect-time approval script hardening and env sanitization
src/lib/actions/sandbox/connect.ts, test/sandbox-connect-inference.test.ts
Embedded approval script gains allowlist/filtering and normalization of requested scopes; openclaw devices approve subprocess environment is sanitized to remove gateway-related vars (OPENCLAW_GATEWAY_URL, OPENCLAW_GATEWAY_PORT, OPENCLAW_GATEWAY_TOKEN).
OpenClaw approve guard wrapper before/after reconciliation
scripts/nemoclaw-start.sh
Wrapper captures request-specific before state from pending.json, probes paired-device state after approve, and treats observed scope application as success (compatibility marker). Adjusts set -e handling for safe probing.
Unit and E2E test coverage for scope allowlist enforcement
test/nemoclaw-start.test.ts, test/sandbox-connect-inference.test.ts, test/e2e/test-issue-4462-scope-upgrade-approval.sh
Unit tests validate malformed/disallowed scope rejection; sandbox connect tests assert env sanitization and scope-gating logic; E2E test tightened to detect unintended operator.admin approvals and require read/write presence.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#4573: Both PRs modify scripts/nemoclaw-start.sh's openclaw devices approve guard to unset gateway-related environment variables.
  • NVIDIA/NemoClaw#4652: Both PRs tighten sandbox auto-pair scope-approval logic and harden the openclaw devices approve subprocess environment by stripping gateway-related variables.

Suggested labels

Integration: OpenClaw, fix, Sandbox, E2E

Suggested reviewers

  • ericksoa

Poem

🐰 In sandbox glade the watcher tends the gate,

It checks each scope and keeps the admin late,
Jiti's crumbs are hidden, caches turned to none,
Before and after checks ensure what's done,
A hopping patch to keep the approvals straight.

🚥 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 summarizes the main change: implementing OpenClaw 2026.5.27 approval compatibility, which is the primary objective across all modified files.
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/openclaw-2026-5-27-compat

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

PR Review Advisor

Findings: 0 needs attention, 4 worth checking, 1 nice ideas
Since last review: 1 prior item resolved, 0 still apply, 3 new items found

Review findings

🛠️ Needs attention

  • None.

🔎 Worth checking

  • Source-of-truth review needed: Interactive `openclaw devices approve` nonzero-after-applied compatibility shim: 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: `scripts/nemoclaw-start.sh:2211` emits `"compatibility": "openclaw-approve-applied-after-nonzero"` after post-state validation.
  • Source-of-truth review needed: Jiti filesystem cache disablement: 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: `Dockerfile`, `Dockerfile.base`, and `scripts/nemoclaw-start.sh` set `JITI_FS_CACHE=false`; `test/runner.test.ts` checks source strings.
  • Fail closed when approval requests omit scopes (scripts/nemoclaw-start.sh:1773): The new allowlist rejects malformed scope payloads and disallowed scopes, but a pending request with neither `scopes` nor `requestedScopes` returns an empty set and is still approved if its spoofable `clientId` or `clientMode` is allowlisted. The same behavior exists in the connect-time approval pass. Because the surrounding code documents client identity fields as client-supplied and not a trust boundary, an absent scope list should not bypass the scope allowlist.
    • Recommendation: Treat missing scope metadata as invalid for automatic approval, or explicitly document and test a narrow legacy exception that proves it cannot grant privileges beyond `operator.pairing/read/write`.
    • Evidence: `requested_scopes()` returns `set()` when both scope fields are absent, and callers only reject `None` or non-allowlisted non-empty sets; see `scripts/nemoclaw-start.sh:1768-1859` and `src/lib/actions/sandbox/connect.ts:704-749`.
  • Cover the nonzero-approve compatibility shim with behavioral tests (scripts/nemoclaw-start.sh:2211): The interactive `openclaw devices approve` wrapper now converts a nonzero OpenClaw exit into success when local state indicates the requested scopes were applied. That is a useful compatibility path, but I found no direct test proving the positive case or the negative cases where the request remains pending, scopes are only partially applied, the paired device does not match, or a higher-privilege/admin request is involved.
    • Recommendation: Add shell-guard tests that simulate `pending.json` and `paired.json` before and after a failing approve: one test for nonzero-but-applied returning success, and negative tests for still-pending, partial/mismatched scopes, mismatched device, and admin/disallowed scopes not masking failure.
    • Evidence: The shim emits `"compatibility": "openclaw-approve-applied-after-nonzero"` at `scripts/nemoclaw-start.sh:2211`; grep of the changed tests found no assertion for that compatibility marker or the after-state failure branches.

🌱 Nice ideas

  • Add runtime proof for the Jiti cache workaround (Dockerfile:34): The Dockerfile and runtime shell changes set `JITI_FS_CACHE=false`, and the unit test checks only that the strings are present. For a leak-scan/cache workaround, source-shape coverage does not prove OpenClaw/Jiti actually avoids creating `/tmp/jiti` in the built sandbox/runtime environment.
    • Recommendation: Add or identify a targeted runtime validation that starts the relevant OpenClaw path with `JITI_FS_CACHE=false` and asserts no `/tmp/jiti` generated-source cache is created or included in leak-scan inputs.
    • Evidence: `Dockerfile`, `Dockerfile.base`, and `scripts/nemoclaw-start.sh` set `JITI_FS_CACHE=false`; `test/runner.test.ts` asserts those strings exist but does not exercise runtime cache behavior.
Consider writing more tests for
  • **Runtime validation** — Startup auto-pair rejects allowlisted CLI/webchat pending requests that omit both `scopes` and `requestedScopes`.. This PR changes sandbox startup, Docker image configuration, device-approval authorization, and connect-time host glue. Unit coverage improved for startup auto-pair rejection, but sensitive compatibility and runtime-cache behaviors still need behavioral validation beyond source-shape checks.
  • **Runtime validation** — Connect approval pass skips `operator.admin`, malformed scope payloads, and missing-scope pending requests when run against fake `devices list --json` output.. This PR changes sandbox startup, Docker image configuration, device-approval authorization, and connect-time host glue. Unit coverage improved for startup auto-pair rejection, but sensitive compatibility and runtime-cache behaviors still need behavioral validation beyond source-shape checks.
  • **Runtime validation** — Interactive `openclaw devices approve` wrapper returns success for nonzero approve only when the original request disappears and all requested scopes are present on the same paired device.. This PR changes sandbox startup, Docker image configuration, device-approval authorization, and connect-time host glue. Unit coverage improved for startup auto-pair rejection, but sensitive compatibility and runtime-cache behaviors still need behavioral validation beyond source-shape checks.
  • **Runtime validation** — Interactive `openclaw devices approve` wrapper preserves failure for still-pending requests, partial scope application, mismatched device IDs, and admin/disallowed scope requests.. This PR changes sandbox startup, Docker image configuration, device-approval authorization, and connect-time host glue. Unit coverage improved for startup auto-pair rejection, but sensitive compatibility and runtime-cache behaviors still need behavioral validation beyond source-shape checks.
  • **Runtime validation** — Runtime sandbox validation proves `JITI_FS_CACHE=false` prevents `/tmp/jiti` cache creation for the OpenClaw path that previously generated provider-marker residue.. This PR changes sandbox startup, Docker image configuration, device-approval authorization, and connect-time host glue. Unit coverage improved for startup auto-pair rejection, but sensitive compatibility and runtime-cache behaviors still need behavioral validation beyond source-shape checks.
  • **Cover the nonzero-approve compatibility shim with behavioral tests** — Add shell-guard tests that simulate `pending.json` and `paired.json` before and after a failing approve: one test for nonzero-but-applied returning success, and negative tests for still-pending, partial/mismatched scopes, mismatched device, and admin/disallowed scopes not masking failure.
  • **Add runtime proof for the Jiti cache workaround** — Add or identify a targeted runtime validation that starts the relevant OpenClaw path with `JITI_FS_CACHE=false` and asserts no `/tmp/jiti` generated-source cache is created or included in leak-scan inputs.
  • **Acceptance clause:** PR body: "Disable Jiti filesystem caching in the OpenClaw base/runtime images and runtime shell environment to avoid `/tmp/jiti` generated-source residue in sandbox leak scans." — add test evidence or identify existing coverage. `ENV JITI_FS_CACHE=false` is added to both Dockerfiles and runtime shell env exports `JITI_FS_CACHE="false"`; coverage is source-shape only and does not prove `/tmp/jiti` is absent at runtime.
Since last review details

Current findings:

  • Source-of-truth review needed: Interactive `openclaw devices approve` nonzero-after-applied compatibility shim: 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: `scripts/nemoclaw-start.sh:2211` emits `"compatibility": "openclaw-approve-applied-after-nonzero"` after post-state validation.
  • Source-of-truth review needed: Jiti filesystem cache disablement: 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: `Dockerfile`, `Dockerfile.base`, and `scripts/nemoclaw-start.sh` set `JITI_FS_CACHE=false`; `test/runner.test.ts` checks source strings.
  • Fail closed when approval requests omit scopes (scripts/nemoclaw-start.sh:1773): The new allowlist rejects malformed scope payloads and disallowed scopes, but a pending request with neither `scopes` nor `requestedScopes` returns an empty set and is still approved if its spoofable `clientId` or `clientMode` is allowlisted. The same behavior exists in the connect-time approval pass. Because the surrounding code documents client identity fields as client-supplied and not a trust boundary, an absent scope list should not bypass the scope allowlist.
    • Recommendation: Treat missing scope metadata as invalid for automatic approval, or explicitly document and test a narrow legacy exception that proves it cannot grant privileges beyond `operator.pairing/read/write`.
    • Evidence: `requested_scopes()` returns `set()` when both scope fields are absent, and callers only reject `None` or non-allowlisted non-empty sets; see `scripts/nemoclaw-start.sh:1768-1859` and `src/lib/actions/sandbox/connect.ts:704-749`.
  • Cover the nonzero-approve compatibility shim with behavioral tests (scripts/nemoclaw-start.sh:2211): The interactive `openclaw devices approve` wrapper now converts a nonzero OpenClaw exit into success when local state indicates the requested scopes were applied. That is a useful compatibility path, but I found no direct test proving the positive case or the negative cases where the request remains pending, scopes are only partially applied, the paired device does not match, or a higher-privilege/admin request is involved.
    • Recommendation: Add shell-guard tests that simulate `pending.json` and `paired.json` before and after a failing approve: one test for nonzero-but-applied returning success, and negative tests for still-pending, partial/mismatched scopes, mismatched device, and admin/disallowed scopes not masking failure.
    • Evidence: The shim emits `"compatibility": "openclaw-approve-applied-after-nonzero"` at `scripts/nemoclaw-start.sh:2211`; grep of the changed tests found no assertion for that compatibility marker or the after-state failure branches.
  • Add runtime proof for the Jiti cache workaround (Dockerfile:34): The Dockerfile and runtime shell changes set `JITI_FS_CACHE=false`, and the unit test checks only that the strings are present. For a leak-scan/cache workaround, source-shape coverage does not prove OpenClaw/Jiti actually avoids creating `/tmp/jiti` in the built sandbox/runtime environment.
    • Recommendation: Add or identify a targeted runtime validation that starts the relevant OpenClaw path with `JITI_FS_CACHE=false` and asserts no `/tmp/jiti` generated-source cache is created or included in leak-scan inputs.
    • Evidence: `Dockerfile`, `Dockerfile.base`, and `scripts/nemoclaw-start.sh` set `JITI_FS_CACHE=false`; `test/runner.test.ts` asserts those strings exist but does not exercise runtime cache behavior.

Workflow run details

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

E2E Advisor Recommendation

Required E2E: issue-4462-scope-upgrade-approval-e2e, test-e2e-sandbox, openclaw-onboard-security-posture-e2e
Optional E2E: issue-4462-gateway-pinned-approval-characterization-e2e, inference-routing-e2e, sandbox-operations-e2e

Dispatch hint: issue-4462-scope-upgrade-approval-e2e,openclaw-onboard-security-posture-e2e

Auto-dispatched E2E: issue-4462-scope-upgrade-approval-e2e, openclaw-onboard-security-posture-e2e via nightly-e2e.yaml at 159cec9a980096a2d83c14a3e69afa350646b2eenightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • issue-4462-scope-upgrade-approval-e2e (high): Directly covers the changed auto-pair/connect approval path in a real sandbox, including CLI scope-upgrade approval, gateway-mode agent execution, and the new no-operator.admin expectation.
  • test-e2e-sandbox (medium): Dockerfile and Dockerfile.base changes must be validated by building the production/test sandbox image and running the in-container OpenClaw/plugin/blueprint smoke suite against the resulting image.
  • openclaw-onboard-security-posture-e2e (high): The PR changes runtime shell environment export and security-sensitive cache/approval behavior; the OpenClaw security-posture E2E validates a full onboarded sandbox with runtime guard assertions on a non-root host path.

Optional E2E

  • issue-4462-gateway-pinned-approval-characterization-e2e (high): Useful diagnostic companion for the same OpenClaw CLI scope-upgrade approval deadlocks and forces openclaw agent into embedded fallback #4462 workaround boundary; it characterizes legacy gateway-pinned approval behavior and recovery, but the positive approval E2E is the merge-blocking check.
  • inference-routing-e2e (medium): Provides adjacent confidence that connect/startup environment changes do not break inference.local routing or provider-route health in a live sandbox.
  • sandbox-operations-e2e (high): Broad lifecycle/connect-shell coverage for changes in nemoclaw-start.sh and sandbox connect behavior, including exec/log/connect operations in a running sandbox.

New E2E recommendations

  • sandbox runtime cache hardening (high): Existing tests appear to assert JITI_FS_CACHE=false statically, but there is no focused live-sandbox E2E that runs OpenClaw/provider code and then verifies no /tmp/jiti cache or provider marker fragments persist in runtime snapshots.
    • Suggested test: Add a live sandbox JITI cache leak-scan E2E that runs an OpenClaw agent/provider path, inspects /tmp and runtime snapshot inputs, and fails if jiti cache files or provider marker names persist.
  • device approval scope allowlist (medium): The OpenClaw CLI scope-upgrade approval deadlocks and forces openclaw agent into embedded fallback #4462 E2E now guards the normal CLI scope-upgrade path, but a malicious or malformed pending request with operator.admin/non-list scopes is primarily covered by unit tests rather than a live gateway/device-state scenario.
    • Suggested test: Add a focused live device-approval hardening E2E that seeds or triggers pending CLI requests with malformed scopes and operator.admin, then proves auto-pair/connect approval passes leave them unapproved.

Dispatch hint

  • Workflow: E2E / Nightly
  • jobs input: issue-4462-scope-upgrade-approval-e2e,openclaw-onboard-security-posture-e2e

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

E2E Scenario Advisor Recommendation

Required scenario E2E: ubuntu-repo-cloud-openclaw
Optional scenario E2E: ubuntu-repo-cloud-hermes, wsl-repo-cloud-openclaw, gpu-repo-local-ollama-openclaw

Dispatch required scenario E2E:

  • gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required scenario E2E

  • ubuntu-repo-cloud-openclaw: Primary scenario coverage for repo-current Ubuntu Docker onboarding with the OpenClaw agent. The PR changes the sandbox runtime image, base image, startup script, and OpenClaw sandbox connect/auto-pair behavior; this scenario builds/starts the sandbox and exercises gateway health, sandbox shell, inference-local from inside the sandbox, credentials, and baseline onboarding paths.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Optional scenario E2E

  • ubuntu-repo-cloud-hermes: Adjacent Ubuntu repo-current Docker scenario using the same sandbox image/startup surface with the Hermes agent. Useful to catch regressions in shared sandbox startup or inference routing outside the primary OpenClaw-agent path.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-hermes
  • wsl-repo-cloud-openclaw: Optional special-runner coverage for the same repo-current OpenClaw Docker scenario on WSL, where shell/proxy/startup environment differences could expose issues from the Dockerfile and nemoclaw-start.sh changes.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=wsl-repo-cloud-openclaw
  • gpu-repo-local-ollama-openclaw: Optional special-runner coverage for the OpenClaw sandbox image/startup path with local Ollama/GPU inference, adjacent to the inference route and sandbox startup surfaces changed here.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=gpu-repo-local-ollama-openclaw

Relevant changed files

  • Dockerfile
  • Dockerfile.base
  • scripts/nemoclaw-start.sh
  • src/lib/actions/sandbox/connect.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Selective E2E Results — ✅ All requested jobs passed

Run: 26983678782
Target ref: fix/openclaw-2026-5-27-compat
Workflow ref: main
Requested jobs: bedrock-runtime-compatible-anthropic-e2e,issue-4462-scope-upgrade-approval-e2e,issue-4462-gateway-pinned-approval-characterization-e2e
Summary: 0 passed, 0 failed, 0 skipped

Job Result
bedrock-runtime-compatible-anthropic-e2e ⚠️ cancelled
issue-4462-gateway-pinned-approval-characterization-e2e ⚠️ cancelled
issue-4462-scope-upgrade-approval-e2e ⚠️ cancelled

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

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

Inline comments:
In `@scripts/nemoclaw-start.sh`:
- Around line 1768-1773: The current requested_scopes function returns an empty
set for malformed (non-list) scopes which allows bypassing allowlist checks;
change requested_scopes to treat non-list payloads as rejected by returning None
(or another explicit error sentinel) instead of set() and ensure callers treat
None as a fatal/malformed result and deny approval; apply the same fail-closed
change to the duplicated connect-time scope parsing/allowlist logic in the
connect.ts connect-time pass so that any non-list scopes/requestedScopes are
treated as malformed (returning None/error) and cause rejection rather than
silently allowing an empty set.

In `@src/lib/actions/sandbox/connect.ts`:
- Around line 704-709: requested_scopes currently returns an empty set for
non-list inputs which lets malformed payloads bypass allowlist checks; change
requested_scopes to fail closed by returning None (or raising a small custom
exception) when scopes is not a list instead of returning set(), and remove the
fallback to empty set in the comprehension; then update every caller of
requested_scopes (the connect-time allowlist checks and other occurrences of the
same pattern) to treat a None/exception result as a malformed payload and reject
the request rather than treating it as “no scopes.”
🪄 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: d5f5a33e-ea92-4722-87ae-eabd1d43308b

📥 Commits

Reviewing files that changed from the base of the PR and between 93adbc7 and bd1bb85.

📒 Files selected for processing (8)
  • Dockerfile
  • Dockerfile.base
  • scripts/nemoclaw-start.sh
  • src/lib/actions/sandbox/connect.ts
  • test/e2e/test-issue-4462-scope-upgrade-approval.sh
  • test/nemoclaw-start.test.ts
  • test/runner.test.ts
  • test/sandbox-connect-inference.test.ts

Comment thread scripts/nemoclaw-start.sh
Comment thread src/lib/actions/sandbox/connect.ts
@cv cv requested review from cjagwani and prekshivyas June 4, 2026 22:43
Copy link
Copy Markdown
Contributor

@cjagwani cjagwani left a comment

Choose a reason for hiding this comment

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

Lgtm

@cv
Copy link
Copy Markdown
Collaborator Author

cv commented Jun 4, 2026

Addressed CodeRabbit's malformed-scope feedback in 159cec9: both the startup auto-pair watcher and connect-time approval pass now fail closed when scopes/requestedScopes is present but not a list, and unit coverage was added for malformed CLI scope payload rejection.

Validation:

  • bash -n scripts/nemoclaw-start.sh
  • npm run build:cli
  • npm test -- --run test/nemoclaw-start.test.ts test/sandbox-connect-inference.test.ts
  • npx prek run --files scripts/nemoclaw-start.sh src/lib/actions/sandbox/connect.ts test/nemoclaw-start.test.ts test/sandbox-connect-inference.test.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Selective E2E Results — ✅ All requested jobs passed

Run: 26983801881
Target ref: bd1bb8578cb64cefe1fde743da9b41cb04fbb966
Workflow ref: main
Requested jobs: issue-4462-scope-upgrade-approval-e2e,sandbox-operations-e2e
Summary: 2 passed, 0 failed, 0 skipped

Job Result
issue-4462-scope-upgrade-approval-e2e ✅ success
sandbox-operations-e2e ✅ success

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Selective E2E Results — ✅ All requested jobs passed

Run: 26984503731
Target ref: 159cec9a980096a2d83c14a3e69afa350646b2ee
Workflow ref: main
Requested jobs: issue-4462-scope-upgrade-approval-e2e,openclaw-onboard-security-posture-e2e
Summary: 2 passed, 0 failed, 0 skipped

Job Result
issue-4462-scope-upgrade-approval-e2e ✅ success
openclaw-onboard-security-posture-e2e ✅ success

@cv cv merged commit 2246a4b into main Jun 4, 2026
33 of 34 checks passed
@cv cv deleted the fix/openclaw-2026-5-27-compat branch June 4, 2026 23:10
cv added a commit that referenced this pull request Jun 5, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Share the OpenClaw device approval allowlist/scope policy between the
startup auto-pair watcher and the connect-time approval pass. This keeps
the #4786 compatibility shim fail-closed in one place while still
injecting the helper into existing sandboxes during `connect`.

## Related Issue
Refs #4462, #4263. Stacked on #4786.

## Changes
- Add `scripts/lib/openclaw_device_approval_policy.py` as the shared
policy helper for allowed clients, modes, scopes, malformed scope
rejection, and gateway-env stripping.
- Load the helper from `nemoclaw-start.sh` and inject the same helper
into `/tmp` for the connect-time approval pass.
- Copy the helper into sandbox images and optimized build contexts.
- Update startup/connect/build-context tests around the shared policy
source.

## 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
- [ ] `npx prek run --all-files` passes
- [ ] `npm test` passes
- [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)

Additional focused checks run:
- `npm run build:cli`
- `npm run typecheck:cli`
- `npm test -- --run test/nemoclaw-start.test.ts
test/sandbox-connect-inference.test.ts
test/sandbox-build-context.test.ts`
- `python3 -m py_compile scripts/lib/openclaw_device_approval_policy.py`
- `bash -n scripts/nemoclaw-start.sh`

Skipped/blocked:
- `npx prek run --files ...` and `node_modules/.bin/prek --version` both
failed before hooks ran with `Error fetching release: self-signed
certificate in certificate chain`.
- `shellcheck scripts/nemoclaw-start.sh` was not available in this
environment (`shellcheck: command not found`).

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

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

* **New Features**
* Externalized device approval policy for OpenClaw pairing, driving
approval decisions from a pluggable policy module instead of embedded
allowlists.

* **Chores**
* Included the approval policy module in builds and runtime images, with
tightened file permissions and staging so it’s available where the
watcher runs.

* **Tests**
* Updated and expanded auto-pair and sandbox tests to exercise the new
policy-driven approval flow and related hardening.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
cv pushed a commit that referenced this pull request Jun 5, 2026
## Summary
- Add the v0.0.59 release notes from the GitHub announcement discussion.
- Refresh local inference and credential-storage guidance for the
current release behavior.
- Regenerate the user skills from the updated Fern docs.
- Tighten release-prep and docs review guidance for generated skills, PR
labels, and shared `$$nemoclaw` command placeholders.

## Verification
- `python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix
nemoclaw-user --doc-platform fern-mdx`
- `rg "permissive mode|shields down|shields up|shields status|config
rotate-token|rotate-token" --glob '*.{md,mdx}'`
- `git diff --check`
- `npm run docs` (rerun outside sandbox after sandbox-only `tsx` IPC
permission failure)
- `npm run typecheck:cli`
- Pre-commit hooks during commit passed, including markdownlint,
docs-to-skills verification, gitleaks, commitlint, and skills YAML
tests.

## Source Summary
- #3679, #4437, #4681, #4766, #4772, #4775, #4786 ->
`docs/about/release-notes.mdx`, `docs/reference/commands.mdx`,
`docs/reference/troubleshooting.mdx`: Summarize OpenClaw 2026.5.27
compatibility, runtime path pinning, plugin registry recovery, live
gateway reconciliation, and clearer host-alias/startup diagnostics.
- #4332, #4402, #4769, #4776, #4779 -> `docs/about/release-notes.mdx`,
`docs/inference/inference-options.mdx`,
`docs/inference/use-local-inference.mdx`,
`docs/inference/switch-inference-providers.mdx`: Document the release
inference changes covering Local NIM waits, Hermes Anthropic routing,
Nemotron 3 Ultra, the current Ollama starter fallback, and Spark
managed-vLLM context length.
- #4628, #4652, #4733, #4745 -> `docs/about/release-notes.mdx`,
`docs/security/credential-storage.mdx`,
`docs/manage-sandboxes/messaging-channels.mdx`,
`docs/reference/troubleshooting.mdx`: Capture permission healing,
gateway-stored credential reuse, cross-sandbox messaging credential
conflict checks, and CDI preflight diagnostics.
- #4728, #4737, #4743, #4744, #4782 -> `.agents/skills/nemoclaw-user-*`:
Regenerate the user skill references from the updated source docs.
- Follow-up maintenance ->
`.agents/skills/nemoclaw-contributor-update-docs/SKILL.md`,
`.coderabbit.yaml`: Add release-prep area labels for docs and skills
PRs, and teach docs review guidance that `$$nemoclaw` is the correct
shared command placeholder for examples that work across agent aliases.

Note: the `documentation` label was not present in the repository, so
this PR is labeled with `v0.0.59` only.

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

* **Documentation**
  * Updated default model for local Ollama inference setup to qwen3.5:9b
  * Added Nemotron 3 Ultra 550B as an NVIDIA Endpoints model option
* Clarified credential storage and reuse behavior for post-deployment
(day-two) operations
* Added v0.0.59 release notes covering OpenClaw compatibility, inference
options, Hermes messaging sync, and troubleshooting
* Clarified CLI selection guidance and updated OpenClaw version example
in status output
* Revised release-prep instructions and docs review guidance for CLI
alias usage
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants