Commit 124c65c
authored
fix(agent): reject ambiguous timeout argv (#9075)
## 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 `--timeout` token as an OpenClaw deadline.
## Related Issue
Follow-up to #9056. Addresses the delayed [PR Review Advisor
finding](#9056 (comment)).
## Changes
- Recognize the documented separated, equals-form, boolean, and JSON
option forms before `--timeout`.
- Leave the host wait unbounded for unknown flags, positional tokens,
consumed values, malformed timeout values, and tokens after `--`.
- Document the unknown-option condition in the command reference.
- Add regression coverage for the ambiguous `--unknown --timeout 30`
sequence.
## 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: an exact nine-category
security review passed at `4aaaf7c3` with no actionable findings.
Unknown or ambiguous argv does not authorize an inferred deadline, and
forwarded arguments remain an argv array without shell interpretation.
- [ ] 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: `docs/reference/commands.mdx` now lists an unrecognized
option before `--timeout` among the conditions that leave the OpenShell
wait unbounded. The implementation and regression test enforce the same
condition.
- Agent: Codex Desktop
<!-- docs-review-head-sha: 4aaaf7c -->
<!-- docs-review-agents-blob-sha: e30afb2 -->
## 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 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 — four focused agent-dispatch suites,
129 tests passed
- [x] Applicable broad gate passed — `npm run validate:pr` passed,
including repository checks, secret scanning, commit checks, and CLI
type checking
- [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) — build
passed with 0 errors; Fern reported two existing repository warnings
- [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: Apurv Kumaria <akumaria@nvidia.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved timeout option parsing for the `agent` command, including
boolean and equals-form options.
* Prevented unrecognized options from incorrectly creating a dispatch
deadline.
* Clarified that an unrecognized option before `--timeout` leaves the
wait unbounded.
* **Tests**
* Added coverage for supported option formats and unknown-option
handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>1 parent 5bb69ed commit 124c65c
3 files changed
Lines changed: 33 additions & 1 deletion
File tree
- docs/reference
- src/lib/actions/sandbox/agent
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1310 | 1310 | | |
1311 | 1311 | | |
1312 | 1312 | | |
| 1313 | + | |
1313 | 1314 | | |
1314 | 1315 | | |
1315 | 1316 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
179 | 187 | | |
180 | 188 | | |
181 | 189 | | |
| |||
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
195 | 209 | | |
196 | 210 | | |
197 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
| 335 | + | |
335 | 336 | | |
336 | 337 | | |
337 | 338 | | |
| |||
340 | 341 | | |
341 | 342 | | |
342 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
343 | 360 | | |
344 | 361 | | |
345 | 362 | | |
| |||
0 commit comments