Repository navigation
fix(cli): honor inherited tasks options - #117528
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 9:08 PM ET / August 20, 2026, 01:08 UTC. ClawSweeper reviewWhat this changesThe PR extracts task and TaskFlow CLI registration into a dedicated module and makes supported parent options work consistently on nested task commands. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessThis maintainer-authored PR remains necessary: current main’s nested TaskFlow leaves read only leaf-local options, while this patch centralizes bounded ancestor resolution and rejects unsupported inherited flags before an owner action runs. The branch is mergeable but exact-head checks are still running. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe CLI registrar turns operator command lines into task and TaskFlow owner calls. It must preserve supported output and filter options while rejecting unsupported inherited options before a potentially mutating owner handler runs. flowchart LR
Operator[Operator command] --> Tasks[Tasks command tree]
Tasks --> Parse[Option-source resolution]
Parse --> Policy[Leaf support policy]
Policy -->|supported| Owner[Task or TaskFlow owner]
Policy -->|unsupported| Error[CLI error before action]
Owner --> Output[Operator output]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +57, Tests +196, Other -1. Total +252 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one source-aware task registration boundary that forwards only documented compatible options and fails before any incompatible maintenance or cancellation action. Do we have a high-confidence way to reproduce the issue? Yes—source inspection shows current main’s nested TaskFlow leaves only read local options, while the new parser matrix exercises parent, child, and root placements. This read-only review did not execute the reproduction. Is this the best way to solve the issue? Yes—the extracted registrar uses the existing bounded inheritance helper with one per-leaf support matrix, avoiding duplicate parent-option reads and preventing incompatible filters from reaching owner actions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against af3b86091f4b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (11 earlier review cycles; latest 8 shown)
|
fa3bd15 to
322ccf7
Compare
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review The requested current-registration transplant and built CLI proof are complete. This head also broadens the same owner-boundary repair to source-aware inherited-option support and pre-mutation rejection, so a fresh exact-head review is warranted. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready proof for exact head
Latest completed ClawSweeper rank-up moves were applied: the narrow parent-JSON repair was transplanted onto current registration, and real built-CLI proof was repeated on the rebased head. A fresh exact-head ClawSweeper review is currently running because this repair broadens the same owner boundary; a queued or late publisher refresh is not being treated as a merge blocker. Effective LOC after discounting moved code: production |
|
ClawSweeper pre-merge move disposition:
|
|
Merged via squash.
|
* fix(cli): honor inherited tasks options * test(cli): classify task flow JSON support
What Problem This Solves
Fixes an issue where users placed documented
--json,--runtime, or--statusoptions on the parentopenclaw taskscommand and nested leaves silently lost them. In the worst case,openclaw tasks --json flow listexited 0 with empty stdout while writing human output elsewhere, and list-only filters could accompany a real maintenance or cancellation mutation even though that leaf could not honor them.Why This Change Was Made
The root cause was split Commander ownership: direct task leaves read only their immediate parent, nested Task Flow leaves never traversed both ancestors, and unsupported inherited options had no shared pre-action policy. This extracts task registration from the oversized status/session registrar into concept-owned
register.tasks.ts, defines one source-aware leaf support matrix, and resolves supported options through at most two ancestors. Task Flow status stays leaf-local so task and flow status vocabularies cannot cross.Unsupported inherited options now fail before task or flow owner modules load, so a rejected filter cannot be followed by maintenance or cancellation. Commander strings are validated and narrowed at the CLI boundary; the closed task audit owner types remain unchanged.
The split removes the old registrar's max-lines suppression, reduces it from 821 to 574 lines, and lowers its assertion-safety baseline from 41 to 29. It supersedes the earlier narrow parent-JSON forwarding patch on this PR with the complete owner-boundary repair requested by the latest review.
User Impact
Supported placements now behave consistently:
--json/--runtime/--statusbefore or afterlist--jsonon a supported root, parent, or leaf position--statusafterflow list--statusor--runtimeon a Task Flow leafBare
openclaw tasks, ordinary maintenance, leaf-local filters, and the documented JSON payload bytes remain unchanged.Evidence
node scripts/run-vitest.mjs src/cli/program/register.tasks.test.ts— 52/52 registration cases passed.src/cli/program/root-command-descriptions.test.ts— 4/4 command-description contract cases passed after removing the staletasks flowJSON-N/A inventory entry reported by exact-head CI.core + coreTests + toolingpassed, including both type graphs, formatting/lint, dead exports, max-lines/assertion ratchets, dependency/plugin boundaries, database-first checks, and import cycles.pnpm check:architecturepassed.pnpm buildpassed on the rebased head, including CLI bootstrap imports and built-module verification.git diff --checkpassed.Effective LOC after discounting moved code: production
+306/-249(net+57), tests+336/-141, tooling baselines+1/-2(net-1). The production growth is the single CLI ownership matrix, bounded two-ancestor resolution, and pre-owner mutation safety boundary; the former duplicate registration path is removed.AI-assisted: yes. I understand the change and verified the parser, owner, built CLI, and architecture boundaries above.