Repository navigation
fix(cli): drop unsupported --non-interactive flag from openclaw agents delete - #5663
Conversation
…s delete nemoclaw <name> agents apply invoked openclaw agents delete <id> --force --non-interactive, but OpenClaw 2026.5.27 agents delete does not accept --non-interactive (only agents add does). The delete exited 1 and the orphan agent was left in place (#5656). Drop the flag; --force already makes delete non-interactive. Extract buildOpenclawAgentAddArgs / buildOpenclawAgentDeleteArgs as pure, unit-tested helpers so the per-verb flag contract is guarded against regression. Fixes #5656 Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Jason Ma <[email protected]>
|
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 (2)
📝 WalkthroughWalkthroughTwo exported helper functions, OpenClaw agent argv fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: None Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision. |
|
Fixes #5656. Credit to @abhi-0906 for the confirmed root-cause diagnosis ( Change: drop Host verification (aarch64, OpenClaw 2026.5.27): onboarded a sandbox with a CI is green and CodeRabbit reported no actionable comments. |
Vitest E2E Scenario Results — ✅ All requested jobs passedRun: 28043313034
|
jyaunches
left a comment
There was a problem hiding this comment.
Approved: CI is green, required sessions-agents-cli-vitest passed on current HEAD, and the PR Review Advisor has no blocking findings.
## Summary
- harden `agents apply` parsing of `openclaw agents list --json` output
- tolerate leading warning/banner text before the JSON payload
- accept both the current bare array shape and a future `{ "agents":
[...] }` wrapper while preserving existing id filtering
## Related Issue
Related to #5656 follow-up discussion: the main delete-path bug is
covered by #5663; this PR handles the parser hardening that was
explicitly left for a separate change.
## Verification
- [x] `npm test -- src/lib/actions/sandbox/agents/apply.test.ts`
- [x] `npm run lint -- src/lib/actions/sandbox/agents/apply.ts
src/lib/actions/sandbox/agents/apply.test.ts` (passes; existing
unrelated `child-exit-tracker.test.ts` unused suppression warning
remains)
- [x] `npm run build:cli`
- [x] `npm run typecheck:cli`
- [x] `git diff --check`
Signed-off-by: WilliamK112
<[email protected]>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved robustness of agent list retrieval to handle responses with
leading text and various JSON formats.
* **Tests**
* Added comprehensive test suite verifying agent list parsing handles
edge cases and multiple response formats.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: WilliamK112 <[email protected]>
Co-authored-by: cjagwani <[email protected]>
## Summary
- harden `agents apply` parsing of `openclaw agents list --json` output
- tolerate leading warning/banner text before the JSON payload
- accept both the current bare array shape and a future `{ "agents":
[...] }` wrapper while preserving existing id filtering
## Related Issue
Related to NVIDIA#5656 follow-up discussion: the main delete-path bug is
covered by NVIDIA#5663; this PR handles the parser hardening that was
explicitly left for a separate change.
## Verification
- [x] `npm test -- src/lib/actions/sandbox/agents/apply.test.ts`
- [x] `npm run lint -- src/lib/actions/sandbox/agents/apply.ts
src/lib/actions/sandbox/agents/apply.test.ts` (passes; existing
unrelated `child-exit-tracker.test.ts` unused suppression warning
remains)
- [x] `npm run build:cli`
- [x] `npm run typecheck:cli`
- [x] `git diff --check`
Signed-off-by: WilliamK112
<[email protected]>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved robustness of agent list retrieval to handle responses with
leading text and various JSON formats.
* **Tests**
* Added comprehensive test suite verifying agent list parsing handles
edge cases and multiple response formats.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: WilliamK112 <[email protected]>
Co-authored-by: cjagwani <[email protected]>
Summary
openclaw agents deletein OpenClaw 2026.5.27 does not accept--non-interactive(onlyagents adddoes), sonemoclaw <name> agents applyfailed to remove agents absent from the manifest: the diff/plan was correct ("1 to delete") but the delete invocation exited 1 (OpenClaw does not recognize option "--non-interactive") and the orphan agent was left in place. This drops the unsupported flag from the delete path —--forcealready makes the delete non-interactive — and extracts the add/delete argv into unit-tested helpers so the per-verb flag contract can't regress.Related Issue
Fixes #5656
Changes
src/lib/actions/sandbox/agents/apply.ts: new pure helpersbuildOpenclawAgentAddArgs(keeps--non-interactive, accepted byagents add) andbuildOpenclawAgentDeleteArgs(uses--forceonly, drops--non-interactive);defaultAddAgent/defaultDeleteAgentnow use them.src/lib/actions/sandbox/agents/apply.test.ts: regression tests asserting the delete argv is["openclaw","agents","delete",<id>,"--force"]and never contains--non-interactive, and that the add argv is unchanged.logs-readersub-agent, confirmed the oldopenclaw agents delete --non-interactiveis rejected, thennemoclaw <name> agents apply -f empty.yaml --yesdeletedlogs-reader(finalagents listshows onlymain).Type of Change
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Signed-off-by: Jason Ma [email protected]
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests