Repository navigation
Conversation
NVIDIA#12510) refresh_hermes_provider_placeholders discarded the status of the guard call because validate_hermes_env_secret_boundary was the last command. Return the guard status. The guard validated its candidate .env by writing a temp file and running the boundary validator's env-file subcommand, which the installed validator refuses for any path other than /sandbox/.hermes/.env. Add an env-text subcommand that validates stdin with no path check, sharing the content checks with env-file, and pass the candidate on stdin. Update the pinned validator SHA-256. Signed-off-by: drakeo338 <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA/NemoClaw/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe Hermes environment validator accepts candidate ChangesHermes environment validation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change lets Hermes provider-placeholder refresh succeed after a restart, and a failed guard now stops startup with a failure status. No merge-blocking risk was found. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
## Outcome Hermes rebuilds reapply manifest-owned messaging configuration after restoring the agent home and before the native restart. Provider-placeholder refresh validates candidate env content through stdin and propagates failures. Private mutable Hermes homes require the image-owned runtime-topology check. **Author scope decision:** ordinary rebuild exit status and recovery retention are explicitly excluded. The cleanup finding predates this PR; it is documented below as an inherited limitation requiring separate ownership, not a requested implementation change here. ## Reason Restoring the agent home can overwrite Teams configuration baked into the replacement image. Placeholder refresh also used a temporary path rejected by the installed validator's canonical-path restriction. ### Related issues Fixes #12510. Fixes #12264. The placeholder fix reuses #12512 at `d2881011e4c45c5228fc0e5cc9252a0b7b2a0252`. NVIDIA inference policy, authentication, provider ownership and probe repairs remain separate. ## Changes - Validate bounded candidate env content through stdin before writes; propagate guard failures from startup. - Reapply the matching Hermes messaging plan before restart. Preserve unrelated configuration and disabled channels; reject mismatched plans and failed reads. Reapply failures retain the existing stop/cron behavior and omit raw parser errors from logs. - Preserve the legacy `3770` contract; accept private `0700` only with the guard's non-root topology attestation. Keep ownership, file-mode, link and metadata-drift checks; reject immutable or append-only config directories and files using their open descriptors. Report failed mutable-config verification with bounded, redacted diagnostics and a retry command. ## Verification Source: `29bef1af7fd7b902e22b8021bb0a63a1524099a5`. Recorded PR base: `5f765a1318a2338114a1f6865de3113d9083b405`. - [CI run 37909519940](https://github.com/NVIDIA/NemoClaw/actions/runs/37909519940) passed for parent `576a3f5161`, which GitHub reports as Verified. CI, GitHub verification and review for `29bef1af7f` await publication. - The inode-flag repair passed 70 focused tests, CLI typecheck, lint, formatting, 11 selected repository checks and seven growth checks. The two added cases failed on the parent probe. Tests supply flag metadata while retaining real file I/O; no independent Linux/macOS reproduction with actual blocking flags was run. - The test-only consolidation in `576a3f5161` removes one file and 30 net lines by reusing the existing shell harness and extractor. The same startup failure case and assertions remain. All 45 tests in the consolidated file, CLI typecheck, lint, formatting, project membership and seven growth checks passed; committed contents match the validated hash. That consolidation did not change production code. - The logging repair passed 58 post-restore tests, CLI typecheck, lint, formatting, repository checks and seven growth checks. Post-commit source hashes matched the validated contents. - The hash investigation ran two temporary local component cases: an untouched baseline and a real Teams manifest reapply. Both reached the launch observation with valid active hashes; details and limits are below. No additional test or documentation file is included in the PR for this investigation. - Live Teams message delivery is not verified. Earlier combined experiments with NVIDIA repairs do not establish a live pass for this PR. The separate NVIDIA baseline work remains deferred. The reviewed diff contains no real credentials. ## Review notes Parent `576a3f5161` received an approving review with a non-blocking [inode-flag finding](#12841 (comment)). [Advisor run 37911564231](https://github.com/NVIDIA/NemoClaw/actions/runs/37911564231) completed all nine specialists with no findings. Those results do not approve the new repair commit. The repair reads blocking flags through the existing descriptors and includes ctime in metadata stability checks. For `ENOTTY`, `EOPNOTSUPP` or `EINVAL`, the probe skips the flag check; other flag-read errors fail verification. The probe remains read-only. The prior cleanup and hash dispositions below remain unchanged; inherited cleanup is not fixed or waived. ### Cleanup recovery: inherited and explicitly outside scope `F-operability-recovery-3feccd81e6fb10a68f98` reports behavior already present in base `5f765a1`. The [current cleanup branch](https://github.com/NVIDIA/NemoClaw/blob/0aa02cf7e9b1e9aa79df1d8fde0857924066c062/src/lib/actions/sandbox/rebuild-pipeline.ts#L1016-L1028) is identical to the [base branch](https://github.com/NVIDIA/NemoClaw/blob/5f765a1318a2338114a1f6865de3113d9083b405/src/lib/actions/sandbox/rebuild-pipeline.ts#L1016-L1028); this PR does not change that file. The [base regression test](https://github.com/NVIDIA/NemoClaw/blob/5f765a1318a2338114a1f6865de3113d9083b405/src/lib/actions/sandbox/rebuild-post-restore-phase.test.ts#L826-L841) explicitly expects `{ mutableConfigPermissionsVerified: false }` without `bail`. **Disposition requested: inherited, out of scope for this messaging repair.** The author explicitly excludes changes to ordinary rebuild exit status and recovery retention. This follows the repository's [inherited-finding rule](https://github.com/NVIDIA/NemoClaw/blob/5f765a1318a2338114a1f6865de3113d9083b405/.agents/skills/_shared/pr-follow-up.md#decide): leave the candidate unchanged and preserve the base evidence. Any lifecycle repair requires a separate scope decision. This is a real limitation: an ordinary rebuild can continue into cleanup after unsuccessful mutable-config verification. The disposition does not declare it harmless, fix it, or waive a review gate. ### Hash finding: existing non-root restart refresh confirmed `F-architecture-standard-work-51d6a4be1557f2501c17` assumes the restart consumes manifest changes without updating integrity state. The [native non-root relaunch](https://github.com/NVIDIA/NemoClaw/blob/0aa02cf7e9b1e9aa79df1d8fde0857924066c062/agents/hermes/start.sh#L3241-L3251) calls [runtime preparation](https://github.com/NVIDIA/NemoClaw/blob/0aa02cf7e9b1e9aa79df1d8fde0857924066c062/agents/hermes/start.sh#L2883-L2899), which invokes the existing guard to refresh the active compatibility hash before launch. The hash writer remains owned by the runtime guard. A local experiment on Linux x86_64 at `0aa02cf7e9` used the real Teams planner/applier, shell file writes, startup preparation and Python guard. The untouched baseline retained its valid hash. Reapply changed both files and made the old hash invalid; startup preparation then refreshed it. Independent `sha256sum --check` passed at the gateway-launch observation. Hash generation and validation were not mocked. For the tested non-root path, existing startup preparation refreshed the active compatibility hash before launch. The experiment did not reproduce the reported missing-refresh failure. The experiment replaced OpenShell transport with local temporary-file I/O and observed the launch boundary without starting a live daemon. It does not qualify installed identity attestation, root/legacy topologies, inference or Teams delivery. The temporary probe was retained as local evidence and removed from the source tree. --- Signed-off-by: Hung Le <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Messaging settings are now restored before OpenClaw or Hermes starts after a sandbox rebuild. Hermes Teams settings are preserved without adding credentials, and disabled Teams remains disabled. - Failed configuration checks now stop startup or restoration safely, without exposing sensitive configuration details in logs. - Hermes environment validation now rejects oversized or invalid content and checks configuration permissions and runtime conditions before changes are made. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Hung Le <[email protected]>
Outcome
Provider placeholder refresh works after a sandbox restart, and a guard failure now fails startup.
Reason
The guard validated a temp file with
env-file, which only accepts/sandbox/.hermes/.env, so refresh always failed, andrefresh_hermes_provider_placeholdersreturned the later boundary check's status, hiding it.Related issues
Fixes #12510
Changes
start.sh: return the guard's status.validate-env-secret-boundary.py: add anenv-textsubcommand that validates stdin with the same content checks.runtime-config-guard.py: pass the candidate on stdin; Dockerfile SHA-256 updated.hermes-start-placeholder-refresh.test.tsandhermes-runtime-config-guard.test.ts.Verification
npx vitest run test/agents/hermes/hermes-start-placeholder-refresh.test.ts— fails onmain(status=0), passes with the fixnpx vitest runon that file,hermes-start.test.tsandhermes-runtime-config-guard.test.ts— 75 passedpre-commit run --from-ref origin/main --to-ref HEAD— all passed except hadolint (not installed locally)Review notes
Written with AI assistance (Claude Code) and reviewed by me.
Signed-off-by: drakeo338 [email protected]
Summary by CodeRabbit