fix(advisor): complete local review on macOS - #11500
Conversation
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe local review bootstrap now uses trusted executable paths and resolved implementation paths. Temporary-directory cleanup adjusts permissions only for internally owned roots. Tests cover symlinked entrypoints, ChangesLocal review hardening
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Outcome Each locally owned Advisor gateway now uses a process-local in-memory database. Repeated reviews can register the `advisor` provider without colliding with a previous review or a host database. ## Reason Local review of #11495 still failed after #11500 merged. On trusted `main` commit `05796cf4e47b717aa80b2d9c603946e0ec5aad0b`, the gateway became healthy, then `openshell provider create` failed with `provider already exists`. The gateway had inherited the default persistent database while the runner assumed a fresh provider namespace. ### Related issues Relates to #11495. Follows #11500. ## Changes - Set `OPENSHELL_DB_URL=sqlite::memory:?cache=shared` only for an owned gateway process. The existing SQLite backend provides isolation without adding a database-directory lifecycle or deleting host state. - Keep non-owned gateway configuration unchanged. The merge-conflict-fixer regression test protects this sibling path. - Extend the Advisor credential-boundary test to reject an inherited database URL and preserve the caller environment. - Document local gateway database lifetime. ## Verification - `TMPDIR=/private/tmp npx vitest run --project integration test/automation/pull-requests/pr-review-advisor-openshell.test.ts test/automation/pull-requests/pr-merge-conflict-fixer.test.ts --maxWorkers 1` — 61 passed. - Two consecutive real owned-gateway lifecycles using OpenShell 0.0.106, Docker Desktop 28.3.2, a temporary HOME, and an inert provider credential — both registered `advisor`, configured an unverified inert model, and stopped successfully. No model requests or sandboxes were created. The temporary diagnostic files were removed and neither gateway listener remained. - Normal pre-commit and commit-message hooks — passed. - `NODE_OPTIONS=--max-old-space-size=5120 npm run validate:pr` — passed against canonical `main` `05796cf4e47b717aa80b2d9c603946e0ec5aad0b`; validation and hook execution code were unchanged from that base. - Diff inspection — no secrets, API keys, credentials, or unrelated changes are included. ## Review notes Repository: NVIDIA/NemoClaw. Reviewed commit: `8a0d8d7d0a0ef20e3ef3a4843c05909ca9f5bc71`. Self-review covered the runtime credential boundary, process ownership, inherited configuration, gateway failure cleanup, and the owning Advisor README. Provider data is disposable only for locally owned gateways; existing databases and non-owned behavior remain unchanged. Full local Advisor clearance is not claimed: its trusted implementation comes from `main`, where the reproduced provider collision remains. This draft is for independent review and CI, not approval or merge. The initial review evidence consists of the focused tests, real process diagnostic, and direct diff review. --- Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Locally owned inference gateways now use an isolated in-memory database. - Database records created during a local gateway session are discarded when the gateway stops. - Existing database configuration is ignored for locally owned gateways, preventing unintended use of another gateway’s database. - Externally managed gateways continue using their existing environment configuration. - **Documentation** - Local-run guidance now explains gateway database isolation, lifecycle, and configuration behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Outcome An explicitly configured NemoClaw-managed OpenClaw heartbeat runs in a dedicated heartbeat session. Managed-image checks reject a main-session heartbeat, a different cadence, or a stale configuration hash. ## Reason NemoClaw previously set only `agents.defaults.heartbeat.every`, leaving heartbeat turns in the ordinary main session. Main-session activity could make liveness appear current without a scheduled heartbeat turn. ### Related issues Fixes #10262. Relates to #10244. Advisor dependency #11500 and main test repair #11503 have merged and are incorporated. ## Changes - Set `isolatedSession: true` with explicitly configured heartbeat cadences, including `0m`, without adding a public setting. - Qualify the managed-image fixture with `2m`, its generated configuration hash, and the `120000` ms startup interval. The sandbox probe verifies the built image beyond generator-only assertions. - Exercise the actual probe with valid, main-session, wrong-cadence, and stale-hash fixtures. Resolve the test hash executable through `PATH` and quote shell inputs literally, including paths that contain quotes and shell metacharacters. - Document dedicated heartbeat sessions and accepted duration syntax. The restore-merger defect in #10244 remains separate scope. ## Verification - Generator and managed-runtime contract suites: 197 tests passed. - Managed-startup environment suite: 41 tests passed. - Final probe contract suite with shell metacharacters in the temporary path: 48 tests passed. - Maintainer focused review rerun: 238 tests passed across the generator, managed-startup mapping, and protected runtime contracts. - CLI and plugin builds passed. - `npm run validate:pr` passed against canonical main `fa97e069a0b1ae8922f112e7260a9cbc9e6d7c7f`, including CLI type-checking. - The incorporated main test repair passes all 88 live export tests. - Required GitHub checks pass on candidate `df172e751692babe739d9b38d936fe0c0903b81b`. - CodeRabbit completed a full review of the candidate with no actionable findings and minimal merge risk. - Repository checks and signed-commit hooks passed. The diff contains no secrets, API keys, or credentials. - Documentation validation passed on the candidate. ## Review notes Candidate: `df172e751692babe739d9b38d936fe0c0903b81b` in `NVIDIA/NemoClaw`. Sensitive paths are the config generator and managed-image qualification scripts. Full diff review covered correctness, shell quoting, credential-safe diagnostics, test coverage, and deterministic risk selection. The maintainer review approved this candidate. The bounded cross-issue sweep found no adjacent fix or contradiction. The complete PR Review Advisor report remains unavailable because the Advisor service is failing before specialist execution, so merge remains blocked on that evidence. Both OpenClaw MCP discovery passes now succeed on the candidate. The second pass succeeded when rerun after its external Cloudflare tunnel process exited before readiness on all three bounded attempts. The deterministic risk plan requires `managed-image-multiarch-startup` and `managed-image-protected-runtime`. These manual qualifications have not been dispatched. Merge remains separate from automated evaluation. --- Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Agent heartbeats now run in dedicated, isolated sessions. * Configured heartbeat intervals automatically enable isolated-session behavior. * Managed OpenClaw environments use a validated two-minute heartbeat interval. * **Documentation** * Updated heartbeat documentation to explain periodic isolated-session turns. * **Bug Fixes** * Improved validation of heartbeat settings, startup behavior, and configuration integrity in managed environments. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Outcome
Local PR review now starts reliably from macOS temporary directories, finds Homebrew-installed tools, and removes its owned temporary root after success or failure. Previously, the trusted bootstrap could exit silently through a symlinked
TMPDIR, omitrgfrom its constrained path, or leave immutable Advisor input behind.Reason
PR #11487 cannot complete its required local review because the Advisor bootstrap and cleanup fail on a standard macOS checkout. These failures also reproduce on canonical
main.Related issues
Relates to #11487.
Changes
/varthrough/private/var; the bootstrap is the consumer, and string comparison alone cannot establish direct execution through that alias. The bootstrap-isolation regression test uses a synthetic symlinked temporary root./opt/homebrew/binto the constrained host tool path so the Advisor can invoke its requiredrgexecutable on Apple Silicon Homebrew installations. Keeping the fixed allowlist preserves the existing trust boundary.Verification
npx vitest run --project integration test/automation/pull-requests/pr-review-advisor-local.test.ts -t 'installs trusted dependencies|removes its temporary root' --reporter=dot— 3 passed, 15 skipped.npm run checks:repository— passed.npm run build:cli && npm --prefix nemoclaw run build— passed after the final base integration.NODE_OPTIONS=--max-old-space-size=5120 npm run validate:pr— passed against canonicalmain79c09d969ab4d3c2d5446c8b985fc0e513c9054bafter the final base integration.main— confirmed the silent canonical-path exit, missing Homebrewrg, and immutable-directory cleanup failure.Review notes
Sensitive paths:
tools/pr-review-advisor/local-review.mtsandtools/pr-review-advisor/local-review-implementation.mts. RepositoryNVIDIA/NemoClaw, commit64b54ea1ee7269f2f488c3eaefcdca5ac681be0f, reviewed locally through focused regression tests, repository checks, canonical builds, full PR validation, and manual diff/security-boundary inspection; no candidate-owned findings remain. Independent local Advisor clearance is unavailable because the trusted bootstrap deliberately loads its implementation from canonicalmain, which is the defect this PR repairs. The PR remains draft for independent review and hosted checks.Signed-off-by: Julie Yaunches jyaunches@nvidia.com
Summary by CodeRabbit