Repository navigation
fix(auth): decouple plugin synthetic-auth from profile fallback for gateway attempts (#110103) - #110179
fix(auth): decouple plugin synthetic-auth from profile fallback for gateway attempts (#110103)#110179stantheman0128 wants to merge 11 commits into
Conversation
|
Codex review: blocked before merge. Reviewed September 24, 2026, 10:05 AM ET / 14:05 UTC (Revision 32). ClawSweeper reviewWhat this changesGateway model calls can use plugin-provided synthetic credentials, such as Google Application Default Credentials, while keeping stored-profile fallback disabled; the branch also updates auth tests and supporting test and UI translation fixtures. Merge readiness⛔ Blocked before merge - 5 items remain This PR remains necessary: current main still couples plugin synthetic credentials to stored-profile fallback, and an independent Docker check showed the Gateway failure and a successful reply after the targeted auth change. The remaining blocker is whether the new prepared-lookup requirement preserves supported installs when plugin metadata is incomplete; the exact head also needs conflict resolution and the required auth-path owner review. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway prepares credentials before sending an agent's model request to a provider. The auth resolver combines the selected model, stored profiles, plugin metadata, and provider hooks to decide which credential reaches that request. flowchart LR
A[Gateway model request] --> B[Prepared auth route]
C[Stored profiles] --> B
D[Plugin metadata] --> E[Credential eligibility]
B --> E
E --> F[Provider auth hook]
F --> G[Model request]
Decision needed
Why: The restriction protects provider scope but may leave supported existing installs unable to authenticate; choosing that compatibility boundary requires owner judgment and upgrade evidence. Before merge
Agent review detailsSecurityNone. PR surfaceSource +98, Tests +458, Other +3. Total +559 across 24 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Let Gateway direct attempts use provider-scoped plugin credentials while excluding unrelated stored profiles and unresolved managed secrets, with verified fresh-install and upgrade behavior across complete and incomplete plugin metadata. Do we have a high-confidence way to reproduce the issue? Yes. The reported ADC-only Docker setup produced a working local call and a failing Gateway call, and the current-main auth line still supports that failure path; this review did not execute the setup. Is this the best way to solve the issue? Yes for separating plugin credentials from stored-profile fallback at the auth owner. The prepared lookup's behavior on incomplete metadata still needs an upgrade-safe decision and proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 749b11e54300. 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
HistoryReview history (31 earlier review cycles; latest 8 shown)
|
44b2b98 to
49d080c
Compare
|
Pushed a23f36a881 to fix the CI mock gap in Updated the PR body with local 334-pass evidence for the auth-related suite. ADC-only gateway proof is still blocked here: this machine has no Google ADC ( @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Pushed a CI fix for the two red jobs on this PR. What broke
Fix (
Local verify
|
|
Pushed What changed
Local verify
ADC live proof @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
ADC / Vertex proof status (2026-07-21 refresh)Still blocked on this machine. I will not invent gateway logs. Current probes: Earlier session note (still the product blocker once ADC refreshes): Vertex AI API Code/CI side of this PR is unchanged by this note. Unblock path: Stan refreshes ADC + enables Vertex AI API on the quota project, then I re-run local + gateway infer and post redacted Evidence + |
ADC-only local + gateway proof (2026-07-21)Posted redacted after-fix Evidence on the PR body. Auth path (what this PR fixes): both
Honest remaining gap for a text completion: GCP project billing is not linked ( @clawsweeper re-review |
ADC-only local + gateway proof (2026-07-21, post-billing)Billing is now linked on the ADC quota project ( Auth path (what this PR fixes): both Also cleared for this run: Anthropic publisher data sharing for
Honest remaining gap for a text completion: Service Usage shows empty/zero effective limits for Anthropic @clawsweeper re-review |
…ateway attempts (openclaw#110103) A gateway-isolated direct attempt resolves auth with an empty profile store and allowAuthProfileFallback: false. That flag also gated provider plugin synthetic-auth, so a provider whose only credential source is a plugin hook (anthropic-vertex ADC) failed with "No API key found" on the gateway path while local execution and the plugin itself resolved fine. Give plugin synthetic-auth its own flag (default unchanged: it tracks allowAuthProfileFallback) and thread it through getApiKeyForModelCore and resolveApiKeyForProviderCore. The isolated planner attempt and embedded prepared direct attempts opt in with a prepared RuntimeProviderAuthLookup so eligibility stays scoped in core. The ordinary embedded profile path passes neither the flag nor the lookup, keeping its pre-existing unrestricted behavior; new controller tests pin both directions. Co-authored-by: Cursor <[email protected]>
Independent reproduction + fix verification (2026-09-01)We're a production deployment blocked by this exact bug ( 1. Bug reproduces cleanly on current
|
| Path | Result |
|---|---|
openclaw infer model run --local --model anthropic-vertex/claude-haiku-4-5 |
✅ succeeds |
openclaw infer model run --gateway --model anthropic-vertex/claude-haiku-4-5 |
❌ No API key found for provider "anthropic-vertex" (missing-provider-auth) |
Confirms this isn't limited to the 2026.7.2-beta.x line originally reported against — it's still present in the current stable release.
2. Control: Gemini via google-vertex (same project, same ADC, same gateway) — unaffected
| Path | Result |
|---|---|
--local |
✅ |
--gateway |
✅ |
This isolates the defect to providers that depend on the plugin resolveSyntheticAuth hook specifically (i.e. third-party plugins like anthropic-vertex), not core-owned auth (google-vertex) — consistent with the root cause described in this PR.
3. Applying this PR's fix resolves it
Patched the installed bundle directly (equivalent of model-auth-provider.ts):
- allowPluginSyntheticAuth: params.allowAuthProfileFallback !== false
+ allowPluginSyntheticAuth: params.allowPluginSyntheticAuth !== falseSame container, only that one line changed:
| Path (patched) | Result |
|---|---|
--gateway |
✅ "Hi! 👋 How can I help you today?" |
Before/after, same config, same ADC, only that line differs.
Ask
@vincentkoc @stantheman0128 — given the review is already at 🐚 platinum hermit / proof:sufficient with no correctness findings, and this now has independent confirmation that the fix works end-to-end, could this get a maintainer merge? Any ADC-only anthropic-vertex deployment (the plugin's only supported auth mode) is completely unusable through any real channel (Google Chat, Control UI, etc.) until this lands — it's been broken for weeks with a ready fix sitting idle.
|
Thanks for the independent Docker check on 2026.8.1. The From our side this is waiting on a maintainer. Happy to rebase onto current main if someone asks. |
Co-authored-by: Cursor <[email protected]>
|
Pushed a follow-up for the incomplete prepared lookup P1.
Evidence:
I did not re-run live ADC gateway proof. |
Co-authored-by: Cursor <[email protected]>
|
Pushed a follow-up for the required oxlint max-lines failures on this PR.
The
Those files are untouched here. Evidence: The two failures are Windows |
Rename the test harness so knip production unused-file scan ignores it. Collapse resolveApiKeyForCandidate to an expression body. Co-authored-by: Cursor <[email protected]>
|
Pushed another follow-up for the remaining lint and knip reds on 397d6e4.
|
Still blocked, ~2 months after opening — requesting maintainer attentionWe've been tracking this fix since it was opened on 2026-07-19. It's now 2026-09-14 and it's still unmerged. Re-verified today directly against current For context on our side: this blocks using Vertex AI (GCP Agent Platform) with OpenClaw entirely for any real channel dispatch (Google Chat, and presumably any other gateway-routed integration) — The fix itself has had @clawsweeper re-review @steipete could you or someone with merge rights take a look? Happy to provide any further evidence needed. |
…lback Integrate the contributor fix with current embedded auth state, apply prepared synthetic-auth scope before both readiness hooks, and preserve cancellation and managed-secret ownership. Add regressions for the gateway isolation path. Co-authored-by: Po-Han Shih <[email protected]>
Security-sensitive guard clearedThis PR no longer has blocked security-sensitive file changes. A future security-sensitive change requires a fresh
|
Reuse unchanged published fixes 0c4b3a0 and 729eb63 for ADC integration. No UI budget or auth behavior changes. Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit cbec858)
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
1 similar comment
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Closing due to inactivity. |
Closes #110103
What Problem This Solves
Fixes “No API key found” on Gateway-routed model calls when a provider uses only Google Application Default Credentials (ADC), although the same credentials work locally.
User Impact
ADC-only providers can authenticate through the Gateway without enabling unrelated stored-profile fallback. No new configuration or migration is required. Explicit managed-secret failures remain terminal; incomplete prepared plugin lookups cannot widen credential discovery.
Why This Change Was Made
Plugin synthetic credentials and stored-profile fallback were controlled by one flag. This separates them and scopes isolated attempts to their prepared provider lookup. The current-main integration applies that scope before both synchronous and asynchronous plugin hooks, preserves cancellation and completed lookup results, and adapts the embedded controller to its current auth state.
The original contributor branch and commit ancestry are preserved. Original implementation: @stantheman0128 (Po-Han Shih).
Evidence
a7ca21a3d9c586405c142318f80477fe1db99ed0. The previously reported UI budget, Slack cycle/callback, cold-checkout source-closure, and Qwen clock defects are repaired using published canonical corrections. Startup JS is 362,471 bytes against the unchanged 362,588-byte limit; no assertion or baseline was widened. The Slack and wrapper-manifest corrections now exactly match landed main (fix(discord): rejoin threads on unarchive to restore MESSAGE_CREATE events #111148 and fix: restore initialization in fresh PR wrappers #150453), with no remaining PR delta in those paths.NEEDS DISCUSSION. Actual listed security-owner involvement is still pending on the existing review request. No merge has been attempted.Original author disclosure
The original contribution was written with Claude; the contributor reported reviewing the diff and running local tests. The current-main integration adds the scoped regression evidence above.