Skip to content

fix(cli): gateway call honors local --port - #119046

Merged
steipete merged 1 commit into
mainfrom
codex/qa-97-gateway-call-port
Aug 4, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-97-gateway-call-port

Conversation

@steipete

@steipete steipete commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Closes #119036

What Problem This Solves

Fixes an issue where operators targeting a foreground local Gateway on a non-default port could pass the accepted parent gateway --port option to gateway call, but the command silently ignored it and contacted the default/configured target instead. The child help also offered only --url, whose explicit-credential requirement is intentionally stricter.

Why This Change Was Made

gateway call now advertises --port and routes direct or parent-inherited values through the existing local-port resolver already used by gateway health. That resolver selects loopback, overrides environment URL/port state, preserves local config credentials, and rejects --url plus --port. The URL-override credential boundary is unchanged.

The tests share one local-port projection assertion across health and call so the two CLI surfaces cannot drift. The macOS foreground-Gateway smoke command now uses the safe local-port form instead of an unauthenticated URL override.

User Impact

Operators and scripts can call any Gateway RPC on a custom local port with either:

openclaw gateway call health --port 18999 --json
openclaw gateway --port 18999 call health --json

Local configured credentials are reused without putting a token or password on the command line. Wrong ports still fail, and --url cannot be combined with --port.

Evidence

  • node scripts/run-vitest.mjs src/cli/gateway-cli/register.option-collisions.test.ts — 15 passed
  • full changed gate — passed all core/core-test/docs lanes in https://github.com/openclaw/openclaw/actions/runs/30867000002 before a later source-blind harness cwd mistake; the code/check stages were green
  • exact hash-verified full build — passed on Blacksmith Testbox tbx_01kz559c978pqt1w49s38gm2tq, https://github.com/openclaw/openclaw/actions/runs/30868054765
  • source-blind built-CLI contract from a private neutral directory — 5/5 passed on the same Testbox:
    • help exposes --port
    • direct gateway call ... --port returns health JSON
    • inherited gateway --port ... call returns health JSON
    • unused port exits nonzero
    • --url plus --port exits nonzero with the actionable conflict error
  • auth-none follow-up probe: existing gateway health --port and the new generic call both returned health JSON with exit 0; the earlier cold-run timeout did not reproduce and was not counted as a separate problem
  • final Codex autoreview — clean, no accepted/actionable findings, confidence 0.99
  • git diff --check — passed
  • public model identifier gate — PASS; no model identifiers added or changed

Risk is low. Production delta is +2/-1, there is no config/schema/protocol change, and the existing URL credential-exfiltration protection is untouched.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: macos App: macos cli CLI command changes size: S maintainer Maintainer-authored PR labels Aug 4, 2026
@steipete
steipete marked this pull request as ready for review August 4, 2026 01:24
@steipete
steipete merged commit 25e3b6c into main Aug 4, 2026
249 of 256 checks passed
@steipete
steipete deleted the codex/qa-97-gateway-call-port branch August 4, 2026 01:50
@steipete

steipete commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 4, 2026
* origin/main:
  fix(cli): honor local port in gateway call (#119046)
  fix(gateway): honor external status target context (#119015)
  test(xai): cover playback mark overflow
  fix(xai): bound realtime playback marks
vincentkoc added a commit that referenced this pull request Aug 4, 2026
* commit '25e3b6c9b79dadb912195d86fbff968602d58798': (54 commits)
  fix(cli): honor local port in gateway call (#119046)
  fix(gateway): honor external status target context (#119015)
  test(qa): cover agent session streaming (#119028)
  test(qa): cover sandbox workspace isolation (#119038)
  test(qa): cover progress followthrough evidence (#119039)
  fix(auth): cooldown inline api key billing failures (#88709)
  chore(gateway): cover update and setup RPCs
  test(qa): prove ClawHub catalog discovery (#118934)
  chore(qa): cover plugin testing harness contracts (#118933)
  test(xai): cover playback mark overflow
  fix(xai): bound realtime playback marks
  test(qa): prove failure recovery visibility (#119034)
  test(qa): cover direct tool invocation (#119025)
  test(qa): close external app SDK proof gaps (#118978)
  test(qa): prove container health endpoints (#119012)
  test(qa): claim sessionless heartbeat coverage (#119027)
  fix(gateway): keep plugin model allowlists static (#118854)
  fix(plugins): refresh bundled channel skills (#119020)
  test(qa): cover ClawHub package compatibility (#118985)
  test(qa): cover agent session reconnect dedupe (#119013)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
* origin/main:
  test(qa): prove agent tool approval controls (#119029)
  docs(agents): require exact-head ClawSweeper re-review after post-review pushes (#119069)
  fix(qa): provision ffmpeg for Playwright scenarios (#119064)
  test(qa): repair scenario catalog baselines (#119062)
  test(qa): prove agent session scope continuity (#119032)
  test(qa): prove workspace mutation tools (#119021)
  fix(cli): honor local port in gateway call (#119046)
  test(xai): cover playback mark overflow
  fix(xai): bound realtime playback marks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
* origin/main:
  test(qa): prove agent tool approval controls (openclaw#119029)
  docs(agents): require exact-head ClawSweeper re-review after post-review pushes (openclaw#119069)
  fix(qa): provision ffmpeg for Playwright scenarios (openclaw#119064)
  test(qa): repair scenario catalog baselines (openclaw#119062)
  test(qa): prove agent session scope continuity (openclaw#119032)
  test(qa): prove workspace mutation tools (openclaw#119021)
  fix(cli): honor local port in gateway call (openclaw#119046)
  test(xai): cover playback mark overflow
  fix(xai): bound realtime playback marks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gateway call ignores accepted local --port override

1 participant