Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
After updating to v2026.6.5, custom providers in models.json that use apiKey: "secretref-managed" (non-env SecretRef backed by openclaw-config-secrets.json) fail with 503 auth_unavailable: no auth available (providers=codex, model=gpt-5.5). This makes all agents using custom providers with openai-responses API completely non-functional — every request returns the "Something went wrong" error to end users.
Steps to reproduce
- Configure a custom provider in
models.jsonwithapi: "openai-responses"andapiKey: "secretref-managed"(file-backed SecretRef fromopenclaw-config-secrets.json). - Set the corresponding provider API key in
~/.openclaw/credentials/openclaw-config-secrets.jsonunderopenclaw.models.providers.<providerId>.apiKey. - Run
openclaw updateto update to v2026.6.5. - Restart the gateway.
- Send a request to an agent that uses this custom provider.
Expected behavior
The gateway's secrets runtime resolves the file-backed SecretRef at startup and makes the actual API key available to the auth resolution path. Custom providers with openai-responses API should work the same as they did before the update.
Actual behavior
The request fails with:
503 auth_unavailable: no auth available (providers=codex, model=gpt-5.5)
Gateway log shows:
{
"subsystem": "openai-transport",
"message": "[responses] error provider=cliproxyapi api=openai-responses model=gpt-5.5 name=Error status=503 code=internal_server_error type=server_error message=503 auth_unavailable: no auth available (providers=codex, model=gpt-5.5)"
}The resolveUsableCustomProviderApiKey() function in src/agents/model-auth.ts returns null for non-env secretref-managed markers. The fallback resolveProviderSyntheticRuntimeAuth() also returns undefined for custom providers without matching plugins (no resolveSyntheticAuth hook). The runtime config snapshot that contains the resolved values is never consulted for these providers.
Root cause analysis
The auth resolution chain in resolveApiKeyForProvider() (model-auth.ts) has a gap:
-
resolveUsableCustomProviderApiKey()— forapiKey: "secretref-managed",isNonSecretApiKeyMarker()returnstrue, and the function returnsnull. It does NOT check the runtime config snapshot where the secrets runtime has already resolved the actual value. -
resolveProviderSyntheticRuntimeAuth()— for custom providers without a matching plugin,resolveProviderSyntheticAuthWithPlugin()returnsundefined. The function then returns{}at the!directAuthcheck, never reaching thegetRuntimeConfigSnapshot()fallback that would have the resolved value. -
The gateway's secrets runtime (
prepareSecretsRuntimeSnapshot) correctly resolves file-backed SecretRefs and stores actual values in the runtime snapshot viasetRuntimeConfigSnapshot(). But the auth resolution path for custom providers never consults this snapshot.
This is a regression — before v2026.6.5, the openai-responses API path resolved auth through a different code path that successfully read the resolved snapshot. The v2026.6.5 routing changes (likely related to OpenAI provider unification / codex routing) changed the auth resolution flow, introducing this gap.
Workaround
Replace apiKey: "secretref-managed" in models.json with the environment variable name that exists in gateway.systemd.env:
{
"cliproxyapi": {
"apiKey": "CLIPROXYAPI_API_KEY",
...
}
}Env var references are resolved by resolveUsableCustomProviderApiKey() via process.env and work correctly.
OpenClaw version
2026.6.5 (5181e4f)
Operating system
Ubuntu 22.04 LTS (Linux 5.15.0-131-generic)
Install method
npm global install (openclaw update)
Model
cliproxyapi/gpt-5.5 (custom provider, openai-responses API)
Provider / routing chain
cliproxyapi → openai-responses API → codex transport subsystem → 503 auth_unavailable
Related issues
- Installer writes gateway auth token as literal string, causing token mismatch with env-configured CLI #83330 — Gateway token written as literal string (same
openclaw updateclass of regression) - [Bug]: Doctor reports Gateway auth SecretRef unavailable even when the SecretRef resolves #77687 — Doctor reports SecretRef unavailable even when it resolves (related SecretRef resolution gap)
- secrets audit misclassifies $VAR shorthand and inactive surfaces #90774 — Secrets audit misclassifies
$VARshorthand and inactive surfaces
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 11, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 11, 2026, 12:00 PM ET / 16:00 UTC.
Summary
Codex review failed: retryable codex transport failure (exit 1).
Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.
Ways to help us reproduce this
Next step
Review did not complete, so no work-lane recommendation was made.
Review details
Best possible solution:
Retry the Codex review after fixing the execution failure.
Do we have a high-confidence way to reproduce the issue?
Unclear. The review failed before ClawSweeper could establish a reproduction path.
Is this the best way to solve the issue?
Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.
AGENTS.md: unclear because the file could not be read completely.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 3d6252a51772.
Label changes
Label changes:
issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.clawsweeper:needs-info: Current issue advisory state selects this label.P1: Current review triage priority is none.clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.clawsweeper:queueable-fix: Current issue advisory state no longer selects this label.clawsweeper:source-repro: Current issue advisory state no longer selects this label.impact:auth-provider: Current review selected no impact labels.issue-rating: 🦞 diamond lobster: Current issue advisory state no longer selects this label.Evidence reviewed
What I checked:
Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.wangmiao0668000666 commentedon Jun 11, 2026
I'd like to work on this.
The root cause is clearly identified in the issue: returns at the check without consulting , which contains the resolved SecretRef value for custom providers with . I'll implement the fix in and add a regression test.
wangmiao0668000666 commentedon Jun 11, 2026
I'd like to work on this. I've identified the root cause in
resolveProviderSyntheticRuntimeAuthand opened PR #92113 with a fix and regression test.fix(model-auth): scope runtime snapshot reuse to source config
fix(model-auth): use canonical isManagedSecretRefApiKeyMarker for sou…
joshavant commentedon Jun 12, 2026
Thanks @LINSUISHENG034 for the detailed report and root-cause notes.
This is fixed by #92235, merged as 9386d62. The failure was that custom provider entries with managed non-env SecretRefs could remain as
secretref-managedin the source config, while the auth resolver did not bridge that marker to the already-resolved runtime config snapshot. That made affected custom providers look unauthenticated and produced the503 auth_unavailablepath you reported.The merged fix resolves explicit managed provider SecretRefs from the matching runtime snapshot, keeps explicit provider credentials ahead of ambient profile/env auth, and prevents synthetic local/plugin auth from shadowing those configured credentials. We also verified the exact merged-head behavior with Crabbox: file-backed SecretRef custom providers reached upstream with Authorization present, and marker-only config without a resolved runtime value failed before making a request.
Closing as fixed. Thanks again for the clear report.