Skip to content

fix(gateway): clarify URL override auth recovery - #100418

Merged
steipete merged 1 commit into
mainfrom
codex/pr-54692-clean
Jul 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/pr-54692-clean

Conversation

@steipete

@steipete steipete commented Jul 5, 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.

This is the clean maintainer replacement for #54692. The contributor branch could no longer be updated after final-base drift; this branch preserves Gabriel A. Mays's authorship with Co-authored-by and carries only the reviewed three-file fix.

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.

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

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.

No config, protocol, dependency, or storage surface changes.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Jul 5, 2026
@clawsweeper

clawsweeper Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 2:59 PM ET / 18:59 UTC.

Summary
The branch adds source-specific Gateway URL override auth recovery hints for CLI and OPENCLAW_GATEWAY_URL failures and updates the matching Gateway/TUI tests.

PR surface: Source +7, Tests +2. Total +9 across 3 files.

Reproducibility: yes. from source inspection: current main throws only the generic URL override explicit-credentials message in the Gateway and TUI tests, while the existing docs/credential resolver already define distinct CLI and env recovery paths. I did not run local tests because this review is read-only.

Review metrics: none identified.

Root-cause cluster
Relationship: canonical
Canonical: #100418
Summary: This PR is the current canonical narrow replacement for the same Gateway URL override auth-hint work from the widened closed contributor PR.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No ClawSweeper repair job is needed because the PR branch already contains the focused fix; remaining work is ordinary protected maintainer landing and check completion.

Security
Cleared: No concrete security or supply-chain regression found; the diff changes Gateway recovery text and tests without changing credential precedence, dependencies, workflows, lockfiles, or secret handling.

Review details

Best possible solution:

Land the narrow shared-guard error-message change once the protected maintainer landing path and required checks are satisfied, preserving existing credential precedence and fail-closed behavior.

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

Yes from source inspection: current main throws only the generic URL override explicit-credentials message in the Gateway and TUI tests, while the existing docs/credential resolver already define distinct CLI and env recovery paths. I did not run local tests because this review is read-only.

Is this the best way to solve the issue?

Yes. The shared ensureExplicitGatewayAuth guard is the right layer because both Gateway call paths and the TUI CLI override path use it, and the patch changes only recovery text plus focused assertions rather than credential precedence.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a normal-priority Gateway UX/auth-recovery bugfix with limited blast radius and focused tests.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up comment cite live Testbox/tmux CLI, environment URL, and TUI URL override runs showing the changed recovery text; the repository proof gate also recognized the author as maintainer-team context.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and follow-up comment cite live Testbox/tmux CLI, environment URL, and TUI URL override runs showing the changed recovery text; the repository proof gate also recognized the author as maintainer-team context.

Label justifications:

  • P2: This is a normal-priority Gateway UX/auth-recovery bugfix with limited blast radius and focused tests.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and follow-up comment cite live Testbox/tmux CLI, environment URL, and TUI URL override runs showing the changed recovery text; the repository proof gate also recognized the author as maintainer-team context.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up comment cite live Testbox/tmux CLI, environment URL, and TUI URL override runs showing the changed recovery text; the repository proof gate also recognized the author as maintainer-team context.
Evidence reviewed

PR surface:

Source +7, Tests +2. Total +9 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 8 1 +7
Tests 2 5 3 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 13 4 +9

What I checked:

  • Current main generic error: Current main builds the URL override auth failure from the generic text plus the caller-provided hint, without source-specific CLI or environment recovery guidance. (src/gateway/call.ts:619, c730d8f1f1bb)
  • Credential contract already distinguishes CLI and env overrides: The current docs state that CLI --url does not reuse implicit credentials, while OPENCLAW_GATEWAY_URL may use only OPENCLAW_GATEWAY_TOKEN or OPENCLAW_GATEWAY_PASSWORD, so the PR is aligning the thrown recovery text with the existing contract. Public docs: docs/gateway/remote.md. (docs/gateway/remote.md:93, c730d8f1f1bb)
  • Resolver behavior remains unchanged: Current credential resolution already returns no config credentials for CLI URL overrides and env-only credentials for OPENCLAW_GATEWAY_URL overrides; the PR diff does not alter this resolver path. (src/gateway/credentials.ts:281, c730d8f1f1bb)
  • PR diff is scoped to shared guard text and assertions: The patch only adds sourceHint text in ensureExplicitGatewayAuth, clarifies the callGatewayWithScopes error hint, and updates the two matching Gateway/TUI tests. (src/gateway/call.ts:616, 5eb062446025)
  • TUI caller uses the same guard: resolveGatewayConnection calls ensureExplicitGatewayAuth with urlOverrideSource "cli", so putting the CLI recovery text in the shared guard covers both Gateway CLI calls and the TUI --url path. (src/tui/gateway-chat.ts:344, c730d8f1f1bb)
  • Related widened PR was superseded: The earlier contributor PR is closed unmerged after widening to 214 files; its final maintainer comment points to this PR as the one-commit, three-file canonical replacement with co-author credit preserved. (e4c25bdf9112)

Likely related people:

  • gumadeiras: Auth-boundary history shows commit a13ff55 added ensureExplicitGatewayAuth and the original Gateway/TUI URL override explicit-auth tests 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: Commit 25252ab substantially reworked shared Gateway credential and secret-ref resolution around the same urlOverrideSource contract. (role: adjacent auth-resolution contributor; confidence: medium; commits: 25252ab5ab15; files: src/gateway/call.ts, src/gateway/call.test.ts)
  • vincentkoc: Recent Gateway history shows merged work on callGateway auth/device-scope behavior and adjacent tests in the same helper and test file. (role: recent Gateway call maintainer; confidence: medium; commits: 16865d58ca1f; files: src/gateway/call.ts, src/gateway/call.test.ts)
  • steipete: In addition to authoring this replacement branch, recent merged history shows adjacent TUI/Gateway work and co-authorship on the Gateway call auth surface. (role: recent adjacent contributor; confidence: medium; commits: cd305b3b0cb9, 1b8d83767445, 16865d58ca1f; files: src/tui/gateway-chat.ts, src/tui/gateway-chat.test.ts, src/gateway/call.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

steipete commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready on exact head 5eb06244602507ee84b2ec580aa150b9a37f133e.

  • Clean maintainer replacement for CLI: clarify gateway url override auth hints #54692: one commit, three files, contributor preserved with Co-authored-by.
  • Blacksmith Testbox tbx_01kwsk3hcn6vvycz4w38neampv / run 28747758963: 468 Gateway tests + 29 TUI Gateway tests; exact check:changed passed.
  • Live Testbox/tmux tbx_01kwsjkjbed1es2qrvgym31y8d: real CLI URL, environment URL, and TUI URL override paths rendered the source-specific recovery text.
  • Fresh autoreview: no accepted/actionable findings (confidence 0.98).
  • Hosted CI/Testbox for this exact replacement head is green; no known proof gaps.

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios app: macos App: macos scripts Repository scripts size: XL and removed size: XS labels Jul 5, 2026
@steipete
steipete force-pushed the codex/pr-54692-clean branch from 0373543 to 5eb0624 Compare July 5, 2026 18:54
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed app: ios App: ios app: macos App: macos scripts Repository scripts size: XL labels Jul 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 5, 2026
@steipete
steipete merged commit bbda36e into main Jul 5, 2026
136 of 145 checks passed
@steipete
steipete deleted the codex/pr-54692-clean branch July 5, 2026 19:09
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant