Repository navigation
fix(cli): accept --port across automation commands - #125474
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 8:34 PM ET / August 18, 2026, 00:34 UTC. ClawSweeper reviewWhat this changesThe PR adds shared Gateway connection flags to automation commands, accepts them before or after every leaf command, and makes an explicit local port override a configured remote Gateway target. Merge readinessKeep this PR open: current main still lacks automation-level Priority: P2 Review scores
Verification
How this fits togetherAutomation CLI commands send schedule-management requests to the Gateway. Their connection flags are parsed by the CLI, then the shared Gateway client selects the endpoint and appropriate authentication surface before sending the request. flowchart LR
A[Automation command] --> B[Shared connection flags]
B --> C[Parent and leaf option parsing]
C --> D[Gateway client runtime]
D --> E[Local or remote target resolution]
E --> F[Automation Gateway request]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +30, Tests +128, Docs +5. Total +163 across 13 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: current main omits Is this the best way to solve the issue? Yes. The patch fixes parsing at the shared option owner and resolves local-port selection in the canonical Gateway client path rather than preserving the prior per-command config rewrite. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7e998a367f6a. 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
|
|
Land-ready verification for
ClawSweeper skip state: the latest comment is still the |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users targeting a non-default local Gateway port from
openclaw automationswould getOpenClaw does not recognize option "--port", even though the automation commands are Gateway-backed and sibling Gateway commands support local port selection. Shared connection flags also only worked after the leaf subcommand, so parent placement such asautomations --token ... listwas rejected.Why This Change Was Made
The shared Gateway CLI option owner now registers and projects
--port, while thecron|automationsparent declares the same connection options as every Gateway-backed leaf and inherits only non-default parent values. The canonical Gateway connection resolver now treats an explicit local port as authoritative over configured remote URLs and local auth selection, which allowed removal of the older Gateway CLI workaround that rewrote config into local mode.User Impact
Operators can place
--port,--url,--token,--password,--timeout, and--expect-finalbefore or after every automation leaf command.--port <port>reliably selects that local Gateway even when the active profile is configured for a remote Gateway; combining--urland--portfails explicitly.Evidence
openclaw automations add ... --port 65267 --jsonexited 1 withOpenClaw does not recognize option "--port".localPortOverride: 19082incorrectly selectedwss://gateway.example/wsbefore the fix; it now selectsws://127.0.0.1:19082.automations --port 1 statusandautomations status --port 1reachedws://127.0.0.1:1and reportedECONNREFUSED, rather than an unknown-option or configured-remote error.--urlplus--portreturned the explicit conflict error. No automation state changed.OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/check-changed.mjs -- <13 changed paths>passed the full core/coreTests/docs plan.pnpm docs:check-mdxpassed 776 files;pnpm docs:check-linkschecked 6,518 internal links with 0 broken..claude/skills/autoreview/scripts/autoreview --mode uncommittedreported clean with no accepted/actionable findings.