Skip to content

CLI: clarify gateway url override auth hints - #54692

Closed
gmays wants to merge 3 commits into
openclaw:mainfrom
gmays:codex/cli-url-override-auth-hints
Closed

gmays wants to merge 3 commits into
openclaw:mainfrom
gmays:codex/cli-url-override-auth-hints

Conversation

@gmays

@gmays gmays commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Gateway URL overrides deliberately refuse implicit configuration/device credentials, but the generic error did not tell users how recovery differs between CLI --url and OPENCLAW_GATEWAY_URL. This made a correct security boundary look like a broken token lookup in CLI, TUI, container, and SSH-tunnel workflows.

Why This Change Was Made

Keep the existing authentication decisions unchanged and add source-specific recovery text inside the existing guard. CLI overrides explain both explicit --token/--password and removing --url for the configured local/tunneled target. Environment overrides name the paired environment credentials and state that config credentials are intentionally not reused.

User Impact

The failure remains fail-closed, but now points directly to the safe fix for the override source. No credential precedence, fallback, configuration, or protocol behavior changes.

Evidence

  • Blacksmith Testbox tbx_01kwsk3hcn6vvycz4w38neampv, run 28747758963: gateway matrix 468/468 passed; TUI gateway 29/29 passed.
  • Same Testbox: corepack pnpm check:changed passed for the exact three-file core/coreTests scope.
  • Live tmux proof on Testbox tbx_01kwsjkjbed1es2qrvgym31y8d: real gateway health --url, env URL override, and tui --url commands each rendered the correct source-specific recovery text; combined build + live run exited 0.
  • Fresh autoreview: no accepted/actionable findings; correctness confidence 0.98.
  • git diff --check passed.

Release note: Improved Gateway URL override authentication errors with direct recovery guidance for CLI and environment-based targets.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Mar 25, 2026
@greptile-apps

greptile-apps Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR improves the error messages in ensureExplicitGatewayAuth to provide source-specific, actionable follow-up hints when a gateway URL override is rejected due to missing credentials. The core security behavior is unchanged.

  • Source-specific hints added: CLI --url users are told to remove --url if connecting to a default local/SSH-tunneled gateway; OPENCLAW_GATEWAY_URL env users are told to also set OPENCLAW_GATEWAY_TOKEN or OPENCLAW_GATEWAY_PASSWORD
  • Error hint clarified: The generic fix string in callGatewayWithScopes is updated to say "with --url" to make the --url pairing requirement explicit
  • Tests updated: Both call.test.ts and gateway-chat.test.ts are updated from literal substring assertions to regex matches targeting the new, more specific hint text

Confidence Score: 5/5

  • Safe to merge — security behavior is unchanged, only error message wording is improved, and tests are updated accordingly.
  • The PR is a pure UX/messaging improvement with no change to auth logic. The followupHint is correctly guarded behind the error-throw path (only surfaces when the function is about to throw), the filter(Boolean) correctly handles the undefined fallthrough case for unknown urlOverrideSource values, both changed call sites in tests now use regex assertions that correctly match the new hint strings, and no other tests in the codebase were found asserting the old "explicit credentials" message text in a way that would silently break.
  • No files require special attention.

Reviews (1): Last reviewed commit: "CLI: clarify gateway url override auth h..." | Re-trigger Greptile

@clawsweeper

clawsweeper Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open, but the current head is not merge-ready: the intended gateway hint fix is useful, yet the branch now carries a broad unrelated 214-file diff that must be narrowed before review can pass.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

Do we have a high-confidence way to reproduce the issue?

Yes for the review blocker: comparing current main to the PR head shows the broad 214-file diff, while current main source still has the generic gateway URL override auth message.

Is this the best way to solve the issue?

No for the current head. The shared gateway guard is the right layer for source-specific recovery text, but the best fix is the narrow gateway/TUI patch rather than this broad scope-expanded branch.

Security review:

Security review cleared: No concrete security or supply-chain regression was found in the intended gateway hint change; the broad scripts/provider/app scope is tracked as merge risk rather than a specific security defect.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-03-25T20:29:37Z, is older than 30 days, and the latest review rated it F.
  • proof blocker: real behavior proof is insufficient and proof tier is D, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • steipete: Assigned to the PR, authored the current head commits, and previously adjusted TUI gateway URL override auth behavior. (role: current PR assignee and recent area contributor; confidence: high; commits: e4c25bdf9112, 24d89e603cad, dca24fdb3ecc; files: src/gateway/call.ts, src/gateway/call.test.ts, src/tui/gateway-chat.test.ts)
  • gumadeiras: Authored the merged gateway credential-exfiltration hardening change that established the explicit-auth URL override boundary this PR clarifies. (role: original boundary contributor; confidence: high; commits: a13ff55bd9da; files: src/gateway/call.ts, src/gateway/call.test.ts, src/tui/gateway-chat.ts)
  • joshavant: Substantially reworked shared gateway auth resolution in the same call helper and test surface used by URL override credential decisions. (role: adjacent auth-resolution contributor; confidence: medium; commits: 25252ab5ab15; files: src/gateway/call.ts, src/gateway/call.test.ts)
  • vincentkoc: Current-main blame and history show recent merged work carrying the gateway call helper and tests that contain this auth guard. (role: recent main carrier; confidence: medium; commits: c3bcbf59b152, 935bd6de7fcb; files: src/gateway/call.ts, src/gateway/call.test.ts, src/tui/gateway-chat.ts)

Codex review notes: model internal, reasoning high; reviewed against f04d18a39464.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 19, 2026
@clawsweeper clawsweeper Bot added the P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. label May 19, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 9, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 9, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 10, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 14, 2026
@steipete steipete self-assigned this Jul 5, 2026
@steipete
steipete force-pushed the codex/cli-url-override-auth-hints branch from 97c3e3d to dca24fd Compare July 5, 2026 16:56
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 5, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 5, 2026
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Maintainer follow-up complete at dca24fdb3ecc4072e57020031d32bd331fa41d87.

The patch now keeps the existing explicit-auth boundary and gives source-specific recovery: CLI --url points to --token / --password or removal of the override; OPENCLAW_GATEWAY_URL points to the matching environment credential. No credential fallback or auth behavior changed.

Proof:

  • Testbox tbx_01kwsk3hcn6vvycz4w38neampv: 468 gateway matrix tests, 29 TUI tests, and the exact three-file check:changed core/coreTests gate passed.
  • Live Testbox/tmux tbx_01kwsjkjbed1es2qrvgym31y8d: built OpenClaw and exercised real gateway health --url, environment URL override, and tui --url; each rendered the intended source-specific hint and exited cleanly.
  • Fresh autoreview: no actionable findings (confidence 0.98).
  • Hosted CI: exact head green; no current failing or pending required checks.

No known proof gaps. Ready to land.

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios app: web-ui App: web-ui scripts Repository scripts size: XL and removed size: XS labels Jul 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24d89e603c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CHANGELOG.md

### Changes

- **Control UI message context:** reveal per-message token, context, and model details from the timestamp on hover or activation instead of showing a separate Context button.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep root changelog release-generated

AGENTS.md under Docs / Changelog says CHANGELOG.md is release-only and that release generation owns it. Adding Unreleased entries in this normal commit can be overwritten or duplicated by the release generator, so please remove the root changelog edits here and keep the release-note context in the commit/PR body instead.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 5, 2026
@steipete
steipete requested a review from a team as a code owner July 5, 2026 18:19
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: zalo Channel integration: zalo app: android App: android extensions: memory-core Extension: memory-core cli CLI command changes commands Command implementations agents Agent runtime and tooling extensions: openai extensions: qa-lab extensions: codex extensions: google labels Jul 5, 2026
@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Thanks @gmays for the original report and patch direction. Final-base synchronization exposed accumulated rebase history, and this fork branch no longer allows maintainer edits, so I could not replace it with the reviewed clean head.

The same fix is now preserved as one three-file maintainer commit in #100418, including your Co-authored-by credit and the completed Testbox/live-TUI evidence. Closing this widened branch in favor of that canonical replacement. Enabling Allow edits by maintainers on future pull requests lets us update the contributor branch directly instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: ios App: ios app: web-ui App: web-ui channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: zalo Channel integration: zalo cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: codex extensions: google extensions: memory-core Extension: memory-core extensions: openai extensions: qa-lab gateway Gateway runtime merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants