fix(policy): allow the resolved claude-code npm launcher in the preset (#7579) - #7581
Conversation
#7579) The claude-code preset allowlisted the npm shim /tmp/npm-global/bin/claude, but OpenShell enforces on the kernel-trusted /proc/<pid>/exe. For a global npm install (the bundled Claude Code skill uses `npm install -g --prefix /tmp/npm-global`), that resolves to /tmp/npm-global/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe — a path the preset did not list — so every request to api.anthropic.com was denied, including the initial OAuth login. The shipped preset thus contradicted the shipped skill. Add the resolved launcher path to the preset's binaries. Extend the effective- policy contract test to compose the real claude-code preset through the policy loader and assert the resolved path appears in the effective binaries. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe ChangesClaude Code policy
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit a405c1d in the TypeScript / code-coverage/cliThe overall coverage in commit a405c1d in the Show a code coverage summary of the most impacted files.
Updated |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
prekshivyas
left a comment
There was a problem hiding this comment.
Approved at exact head a405c1d against base 0b18549. The change narrowly adds the resolved Claude Code npm launcher path and a contract assertion without broadening hosts, methods, paths, credentials, or supported scope. Focused validation, builds, typechecks, check:diff, all exact-head CI, and trusted E2E run 30240660013 passed; live-probes evidence recorded passed=1, skipped=0. Documentation writer review passed with no docs needed, the primary advisor recommends merge_as_is, all commits are GitHub Verified, and there are no unresolved review threads.
<!-- markdownlint-disable MD041 --> ## Summary `docs/changelog/2026-07-25.mdx` now includes the user-facing fixes that merged after #7607 and before the v0.0.96 tag. The follow-up covers safer bulk backup and clone restore behavior, policy and inference repairs, cleaner onboarding diagnostics, and OpenClaw base-image validation while leaving test-only and maintainer-internal merges out of the release entry. ## Changes - Document the Shields-safe `backup-all` flow from #7557 and the clone-specific restore pairing publication from #7608. - Record the Claude Code resolved-launcher policy repair from #7581, Hermes namespaced-model handling from #7604, and persisted Ollama proxy-token reuse from #7620. - Record OpenClaw immutable base-inventory validation from #7606, hidden route-only reservations from #7621, and clean invalid gateway-management errors from #7630. - Link the gateway lifecycle and snapshot authorities, retain #7622's already-merged Docker Engine wording, and exclude internal or test-only merges from the release entry. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: This PR changes release-entry prose only. The changelog contract test and Fern validation cover the dated entry, published routes, and rendering requirements. - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: At exact PR head `29316da26`, a Codex Desktop documentation writer reviewed `docs/changelog/2026-07-25.mdx` against `AGENTS.md`, `WRITING.md`, and `docs/CONTRIBUTING.md`. The review confirmed that the full entry accurately reflects the merged user-visible behavior, retains #7622's existing wording, appropriately excludes internal and test-only PRs, and uses conforming terminology, structure, links, and release classification. It also confirmed that the review follow-ups use active third-person release-entry voice, name the actor and recovery requirement directly, and accurately preserve the trusted-backup, cached-release refresh, and local-build fallback constraints. The changelog test passed 6/6, and the docs build completed with 0 errors and 2 pre-existing hidden warnings. - Agent: Codex Desktop <!-- docs-review-head-sha: 29316da --> <!-- docs-review-agents-blob-sha: be20a09 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: `npx vitest run test/changelog-docs.test.ts` passed 6/6 tests after the final review fix. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Not applicable to this prose-only changelog change. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) — exited 0 with 0 errors and 2 pre-existing hidden warnings after the final review fix. - [x] 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) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Expanded the changelog to clarify persistent `policy exclude`/`policy restore` behavior across rebuilds and snapshot restores, including reporting on removed endpoints and exclusion consistency. * Updated `claude-code` preset guidance to allow the npm-installed OpenShell launcher path while maintaining endpoint/HTTP method scope. * Documented hardened handling for invalid gateway-management declarations, improved gateway/agent-version diagnostics scope, and clarified onboarding/restore credential and reasoning precedence. * Tightened bulk backup/restore guidance (safety windows, approval limits, and failure recovery) and refined OpenClaw base selection to avoid incompatible cached releases and `:latest` fallback. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
The bundled
claude-codenetwork-policy preset allowlisted the npm shim/tmp/npm-global/bin/claude, but OpenShell enforces on the kernel-trusted/proc/<pid>/exe. For the global npm install documented by the bundled ClaudeCode skill, that resolves to
/tmp/npm-global/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe.The preset did not list that path, so it denied requests to
api.anthropic.com,including the initial login request.
This PR adds the resolved launcher path without changing the preset's hosts,
methods, paths, or schema. The later request to allow
platform.claude.comis aseparate endpoint-expansion decision and is outside this PR.
Related Issue
Fixes #7579
Changes
/tmp/npm-global/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exeto the
claude-codepreset's binary allowlist.the resolved launcher path.
Regression Evidence
resolved
/proc/<pid>/exepath.method, and wildcard scope but did not check the resolved npm launcher.
the existing endpoint and method assertions.
Type of Change
Quality Gates
fc690c629found no remaining security issue. The change adds one exact binary path and does not broaden endpoint, method, path, credential, dependency, or runtime scope.Documentation Writer Review
no-docs-neededplatform.claude.comis not added. Exact-head validation passed:validate:configs48/48, focused effective-policy/schema/blueprint tests 121/121, CLI and plugin builds, CLI and plugin typechecks, andnpm run check:diff.DGX Station Hardware Evidence
scripts/prepare-dgx-station-host.shis unchanged.Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablea405c1d95,npm run validate:configspassed all 48 shipped configurations. The focused effective-policy, schema, and blueprint suite passed 3 files / 121 tests. CLI and plugin builds and typechecks passed, andnpm run check:diffpassed the normal pre-commit, commitlint, and pre-push checks.a405c1d95; trusted E2E run 30240660013 passed zero-presets, inference-routing, and live-probes with complete evidence.npm run docsbuilds without warnings (doc changes only)E2E Gate History
7f60e4f1bgate failed before product tests ran because the controller rejected GitHub's canonical check URL and could not cancel the unauthorized child run. PR fix(e2e): accept canonical controller check URLs #7599 fixed that controller defect.fc690c629incorporates PR fix(e2e): accept canonical controller check URLs #7599 and creates a new PR SHA and base SHA for fresh controller evidence. The terminal old SHA was not retried.3a742b8, the hosted runner could not reach Docker Hub or the custom inference endpoint, so live-probes recorded one skipped test and the controller correctly rejected incomplete evidence.a405c1d95created a new exact head without changing the semantic diff. Trusted E2E then passed all selected jobs; live-probes recorded one passed test and zero skipped tests.Signed-off-by: Jason Ma jama@nvidia.com
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests