test(macos): cover root command dispatch#93705
Conversation
|
Codex review: needs changes before merge. Reviewed June 16, 2026, 1:52 PM ET / 17:52 UTC. Summary PR surface: Other +66. Total +66 across 2 files. Reproducibility: yes. Current-main source inspection shows the private parser and root dispatch switch with no focused root parser/action tests, and the live macos-swift check reproduces the submitted patch's formatting failure. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land a single narrow root parser/dispatch coverage path after SwiftFormat passes; if the overlapping PR becomes the chosen path, close or retarget this PR after that path merges. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source inspection shows the private parser and root dispatch switch with no focused root parser/action tests, and the live macos-swift check reproduces the submitted patch's formatting failure. Is this the best way to solve the issue? No as submitted. The helper-and-tests approach is a narrow maintainable fix, but the branch needs SwiftFormat repair before it is a mergeable solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 070685f765ae. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Other +66. Total +66 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
cc869d7 to
7818029
Compare
|
Maintainer repair and verification complete.
|
* test(macos): cover root command dispatch * chore(macos): format root command coverage --------- Co-authored-by: markoub <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
* test(macos): cover root command dispatch * chore(macos): format root command coverage --------- Co-authored-by: markoub <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
Summary
openclaw-macroot command parser and dispatch decision.RootCommandActionhelper so the behavior can be tested without spawning a process or interceptingexit(1).Linked context
Closes #83879
Related #83879
Was this requested by a maintainer or owner?
Real behavior proof (required for external PRs)
parseRootCommandand the root command-dispatch switch inOpenClawMacCLI.main()had no focused tests.swift test --package-path apps/macos --filter RootCommandParserTests.swift test --package-path apps/macos --filter RootCommandParserTestsopenclaw-macexecutable manually, and I did not validate command-specific option parsing beyond preserving the trailing args handed to each command.swift test --package-path apps/macos --filter OpenClawIPCTestscurrently fails in unrelatedExecApprovalsStoreRefactorTests.ensure file migrates default approvals into custom state direxpectations; the newRootCommandParserTestspass in that broader run before the unrelated suite failure.EntryPoint.swift, andparseRootCommandwas private to the entry point.Tests and validation
swift test --package-path apps/macos --filter RootCommandParserTestspassed.git diff --check origin/main...HEADpassed.codex review --base origin/mainreported no actionable correctness issues and confirmed dispatch behavior appears equivalent to the base implementation.swift test --package-path apps/macos --filter OpenClawIPCTestsfailed due an unrelated existingExecApprovalsStoreRefactorTestsmigration expectation, not in files touched by this PR.Regression coverage added:
apps/macos/Tests/OpenClawIPCTests/RootCommandParserTests.swiftcovers the parser split and dispatch action mapping described in No tests cover parseRootCommand or the command-dispatch switch in main() #83879.Risk checklist
Did user-visible behavior change? (
Yes/No)Did config, environment, or migration behavior change? (
Yes/No)Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)What is the highest-risk area?
How is that risk mitigated?
RootCommandActionmapping mirrors the previous switch cases, and the focused tests assert the existing behavior for empty args, help aliases, known commands, unknown command exit action, and case sensitivity.Current review state
What is the next action?
What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?