fix(agent): reject ambiguous timeout argv - #9075
Conversation
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe agent timeout parser now requires the ChangesAgent timeout parsing
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to This localized timeout-argument handling change is merge-ready after normal checks and review; no actionable merge-blocking risk remains. Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Security review receipt for the commit under review ( NemoClaw derives a host deadline only from an exact Evidence: base SHA This verdict covers security only. All other repository gates remain authoritative. |
|
🌿 Preview your docs: https://nvidia-preview-pr-9075.docs.buildwithfern.com/nemoclaw |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
1 terminology difference from the second opinionAdvisory only. These are normalized differences from the primary terminology receipt.
2 additional E2E selections from the second opinionAdvisory only. The primary lane did not select these E2E jobs or targets.
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite for the commit under review. Recommended E2E: None Manual-only E2E: 1 optional E2E recommendation
1 warning · 0 suggestionsWarningsWarnings do not block.
|
<!-- markdownlint-disable MD041 --> ## Summary <!-- 1-3 plain sentences: what changes and why. Describe before-and-after behavior when it applies. Follow the NemoClaw Writing Guide: https://github.com/NVIDIA/NemoClaw/blob/main/WRITING.md. Do not add unrelated prose cleanup. --> Adds regression coverage for the exact `openclaw agent` command prefix enforced by the timeout parser merged in [#9075](#9075). The tests address [advisor warning PRA-1](#9075 (comment)) by proving that timeout-looking arguments on another executable or OpenClaw subcommand do not authorize a host deadline. ## Changes <!-- List concrete changes. If this adds an abstraction, configuration, fallback, migration, or compatibility path, name its current requirement and consumer, explain why a direct change is insufficient, and identify the test that protects it. --> - Assert that `other agent --timeout 30` does not produce an inferred timeout. - Assert that `openclaw exec --timeout 30` does not produce an inferred timeout. - Leave the merged parser implementation and user documentation unchanged. ## 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) ## Quality Gates <!-- Check one tests line and one docs line. Check other lines when applicable. Add every requested justification or approval reference. --> - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: this test-only follow-up changes no user-facing behavior; #9075 already documents the parser contract. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Codex Desktop reviewed exact commit `ece3ca732`; PASS with no findings because the five-line diff adds denial assertions only and changes no runtime code, configuration, dependencies, credentials, or cryptography. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review <!-- Required for code and documentation changes after the changes and applicable validation are complete. Keep one review checkbox and one instance of each visible or hidden field. For Evidence, list changed documentation paths. For documentation-only changes, also state that the writing rules and documentation style were reviewed. For other results, explain why no documentation change is needed or why the review is blocked. For Agent, use a consistent product and surface name, such as Codex Desktop, Codex CLI, Claude Code, or Cursor. After committing all review changes, put `git rev-parse --short HEAD` and `git rev-parse --short HEAD:AGENTS.md` in the hidden metadata below. Rerun the review and refresh that metadata after any new commit. This receipt is advisory during the data-collection pilot. --> - [x] Documentation writer subagent reviewed the completed changes - Result: `no-docs-needed` - Evidence: No documentation paths changed. The exact diff adds regression assertions for behavior already documented by #9075 and changes no user-facing behavior. - Agent: Codex Desktop <!-- docs-review-head-sha: ece3ca7 --> <!-- docs-review-agents-blob-sha: e30afb2 --> ## DGX Station Hardware Evidence <!-- Required only when scripts/prepare-dgx-station-host.sh changes. Maintainers must review the linked evidence before approving or merging. This is human-reviewed evidence, not authenticated hardware provenance. Exceptional bypasses use existing repository governance and must be documented on the PR. --> - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification <!-- Check each applicable item only when supported by the requested evidence. Run targeted tests once per relevant change set and rerun after later edits or hook autofixes that can affect the tested behavior. Do not rerun hook-covered checks. --> - [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 validate:pr` passed after refreshing `origin/main` 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 --project cli src/lib/actions/sandbox/agent/passthrough-dispatch.test.ts` passed 35/35 tests at `ece3ca732`. - [ ] 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 a five-line regression-test addition with no runtime or test-harness changes. - [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) - [ ] 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) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Added coverage to ensure timeout options are recognized only for commands beginning with the exact `openclaw agent` prefix. * Confirmed timeout options in unrelated commands or executables are ignored. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Post-merge follow-up complete: #9076 adds the requested negative coverage for timeout-looking arguments on another executable and on the |
<!-- markdownlint-disable MD041 --> ## Summary Portable onboarding resume now reconstructs its rootless Podman authority from a versioned checkpoint instead of inheriting process-local runtime selectors. Resume restores the recorded portable profile before admission, requalifies the canonical current-user socket and configuration under the onboarding lock, and fails closed on legacy, tampered, unsafe, or drifting authority. Live status: **PARTIAL PASS / BLOCKED DOWNSTREAM BY #9068**. The live lane proved #9035 authority reconstruction and socket requalification from an active v4 checkpoint with a pre-existing Ready sandbox; it did not reach the policy boundary, 8/8 completion, chat, completed-resume, or full live acceptance. ## Related Issue Fixes #9035 Parent: #9006 Downstream blocker: #9068 ## Changes - Store checkpoint schema 4 portable intent and secret-free current-user Podman authority, with exact cross-field validation and intentional active schema 1–3 resume refusal. - Pre-read only the resume profile classification, re-read the exact session under the lifecycle lock, permit one bounded race retry, then prepare and requalify portable authority before resumed runtime consumers. - Recompute canonical current-user home, configuration, runtime, socket, and managed configuration settings while rejecting profile, UID, path, type, owner, symlink, endpoint, runtime-kind, or authority drift. - Clear ambient Docker, Podman, XDG, inference, and policy selectors during scoped execution and restore their exact prior presence and values on every return, throw, and handled exit. - Preserve upstream #8992 gateway-database recovery semantics: portable incompatible-state recovery prints the explicit portable `--fresh` command, while default recovery prints `--resume`, in both guidance branches. - Preserve upstream #9075's timeout-argument parsing source, tests, and command reference byte-for-byte while integrating the current `main` history. - Document portable resume, fail-closed recovery, canonical roots, and the active legacy-checkpoint compatibility break. The live resume accepted a reboot-like socket inode rotation while preserving the exact endpoint, owner, mode, immutable authority digest, session identity, Ready sandbox/container identity, and registry identity. After #9035-owned qualification, the run entered #9068's Docker GPU-patch/recreation path and unexpectedly attempted to stop the forward for unrelated sandbox `my-assistant`; that is downstream behavior, not expected or normalized #9035 behavior. The preserved lane was not patched, migrated, retried around the boundary, or claimed as full acceptance. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [x] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: maintainer task `019f5e28-0f70-7313-92ef-40a3233f796e` approved the schema, lock ordering, environment transaction, security review, scoped live waiver, final diff, and publication. - [ ] 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: Independently reviewed signed automatic merge head `52d026093f15dcb75b82c65f61f5ba01c8e63e4e` from #9035 parent `338493906f3ac2abc96e2049b2e124c1314897da` and upstream parent `267abe79856c96fcf74477bd3ce803a942f286fd`. Exact-head validation passed: base-aware Vitest 326 files/4,209 tests; focused #9035 resume/security 8 files/122 tests; upstream Jetson/OpenShell/MCP boundary 3 files/34 tests; CLI typecheck; repository checks (1,698 files/5,205 edges/0 cycles); conditionals; docs CLI parity 84/84, starter, variants, and routes; onboard growth +59/-62; and diff checks. The exported exact HEAD source-shape scan passed with 0 new cases, 0 invalid exceptions, and 119 approved exceptions. The composed command reference preserves portable resume/fresh recovery and upstream destroy-identity documentation. - Agent: Codex Desktop <!-- docs-review-head-sha: 52d0260 --> <!-- docs-review-agents-blob-sha: e30afb2 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: Not applicable; `scripts/prepare-dgx-station-host.sh` is unchanged. - Station profile/scenario: Not applicable. - Result: Not applicable. - Supporting evidence: Not applicable. ## 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, except the maintainer-approved root source-shape hook skip caused by unrelated untracked nested repositories. The exact committed tree passed the same source-shape check with 0 new cases, 0 invalid exceptions, and 119 approved existing exceptions. - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — focused #9035 resume/security: 8 files/122 tests; upstream Jetson/OpenShell/MCP boundary: 3 files/34 tests. - [x] Applicable broad gate passed — base-aware Vitest against `upstream/main`: 326 files/4,209 tests; `npm run typecheck:cli`; `npm run checks:repository`. - [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) - [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) The final merge commit used: ```sh PREK_SKIP='tmp/llama-cpp-priority-profiles,tmp/sagecove-llamacpp-poc-full,.:source-shape-test-budget' git commit -S -s -m 'merge(main): integrate upstream changes' ``` Merge and auto-merge are not authorized. This scoped publication waiver does not claim merge readiness while #9068 blocks protected downstream acceptance. --- Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved onboarding resume support with checkpoint validation, profile compatibility checks, and portable runtime restoration. * Added safer portable runtime handling, including filesystem, socket, ownership, and permission validation. * Added clearer recovery guidance with separate resume and fresh-onboarding commands. * **Bug Fixes** * Prevented unsafe environment settings from affecting portable onboarding. * Added bounded retry handling for resume conflicts and restored environment state after failures. * Older checkpoint schemas now require fresh onboarding instead of automatic migration. * **Documentation** * Expanded guidance for portable profiles, checkpoint compatibility, runtime authority validation, and recovery. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
Summary
NemoClaw now infers the host-side OpenShell deadline only when it can parse the complete forwarded OpenClaw option sequence without ambiguity. Unknown options and positional tokens leave the host wait unbounded instead of treating a later
--timeouttoken as an OpenClaw deadline.Related Issue
Follow-up to #9056. Addresses the delayed PR Review Advisor finding.
Changes
--timeout.--.--unknown --timeout 30sequence.Type of Change
Quality Gates
4aaaf7c3with no actionable findings. Unknown or ambiguous argv does not authorize an inferred deadline, and forwarded arguments remain an argv array without shell interpretation.Documentation Writer Review
docs-updateddocs/reference/commands.mdxnow lists an unrecognized option before--timeoutamong the conditions that leave the OpenShell wait unbounded. The implementation and regression test enforce the same condition.DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpm run validate:prpassed, including repository checks, secret scanning, commit checks, and CLI type checkingnpm run docsbuilds without warnings (doc changes only) — build passed with 0 errors; Fern reported two existing repository warningsSigned-off-by: Apurv Kumaria akumaria@nvidia.com
Summary by CodeRabbit
Bug Fixes
agentcommand, including boolean and equals-form options.--timeoutleaves the wait unbounded.Tests