Repository navigation
fix(auth): classify and explain model-route credential mismatches - #197737
Conversation
Honor provider-declared auth requirements when deciding whether profiles are incompatible with a model route. Preserve explicit identity-only inference denials and distinguish unavailable compatible accounts from wrong-route authentication. Explain rejected route/account class combinations without exposing account identifiers or credentials. Add focused selector, availability, and runtime auth preparation regressions. Related: openclaw#185064
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
✅ Maintainer security changes approvedA maintainer approved this revision with an explicit security approval comment.
A later push requires a fresh approval comment for an external contributor's PR. |
|
Codex review: blocked before merge. What this changesClassify credential compatibility using provider-declared requirements and explain known model-route authentication mismatches. Example: A ChatGPT OAuth account is selected for an openai-responses API-key route.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains This PR repairs a current auth-classification inconsistency without actionable correctness findings; the broader linked execution problem remains unresolved. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherProvider policy supplies credential requirements to the shared route/auth selector, whose decisions feed runtime preparation, model availability, admission, and Doctor. flowchart TD
A[Provider credential policy] --> C[Route and auth selector]
B[Profiles and model routes] --> C
C --> D[Runtime preparation and diagnostics]
C --> E[Model availability]
E --> F[Model admission and Doctor]
Technical reviewBest possible solution: Keep compatibility classification and actionable mismatch guidance in the existing selector while preserving credential selection and inference denials. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the mismatch between storage-mode classification and provider-declared requirements; the author reports base-failing and head-passing regressions, which were inspected but not executed during this read-only review. Is this the best way to solve the issue? The patch restores the existing provider contract at its shared owner, and its reused diagnostic helper covers three rejection paths without adding state or a competing selector. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5d6a026e4375. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +28, Tests +98. Total +126 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 12, 2026, 9:48 AM ET / 14:48 UTC (Revision 2). |
|
Added the requested real CLI/Gateway behavior evidence to the PR description at unchanged head The captures show the actual local CLI mismatch error, unpinned Gateway spawn admission for an expired token-sharing account on the canonical public Responses route followed by the same run's ordinary authentication failure, and identity-only denial during subscription-route model preflight. They use the actual bundled OpenAI provider and canonical credential store, with synthetic profiles and no mocked policy/dispatch functions. Commands, redacted output, setup, cleanup, and the network-observation limits are in the PR body. The source and prior successful CI head are unchanged; #185064 remains open. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer security review requested for head The second ClawSweeper review accepted the real CLI/Gateway evidence and reported no actionable findings. Main CI, CodeQL security, and Critical Quality passed on this unchanged head; the PR body contains the receipts and runtime captures. The change honors provider-declared authentication requirements in the existing compatibility selector and improves mismatch diagnostics. Identity-only inference denial and account selection are preserved. This remains a bounded contribution related to #185064, which stays open. Could an upstream maintainer review this revision and provide the approval required by the current-head security notice, if satisfied? Maintainer edits are enabled. Thank you. |
|
/allow-security-sensitive-change |
Honor provider-declared credential contracts, preserving identity-only denial and distinguishing incompatibility from temporary unreadiness. Report credential classes without disclosing account identity or tokens. Original regression has 7 failures; all 83 focused tests pass after repair. Targeted types/lint/format pass. (cherry picked from commit fe9694b) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Backport fe9694b. Honor provider-declared authentication contracts, keep identity-only inference denial explicit, and distinguish route incompatibility from unavailable compatible credentials without exposing account identifiers. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
…enclaw#197737) Honor provider-declared auth requirements when deciding whether profiles are incompatible with a model route. Preserve explicit identity-only inference denials and distinguish unavailable compatible accounts from wrong-route authentication. Explain rejected route/account class combinations without exposing account identifiers or credentials. Add focused selector, availability, and runtime auth preparation regressions. Related: openclaw#185064
…n again (#206797) Root cause: src/agents/runtime-plan/prepare-auth.ts:610 turned the route selector's credential-class rejection into a plain `Error`, so its explanatory text ("...requires api-key authentication...") was classified by the generic `authentication` pattern and rendered as "Couldn't sign in to the AI service". Fixes #206727 ## What Problem This Solves When the selected model route needs a different kind of credential than the configured account (for example an API-key route with only a ChatGPT subscription sign-in), OpenClaw already knows exactly what is wrong and writes a clear, credential-safe explanation. Chat users never saw it: they got "Couldn't sign in to the AI service. Sign in again...", and signing in again with the same subscription cannot fix a route/credential mismatch. Thanks @alexph-dev for the detailed report, production timeline and installed-bundle fixture. ## User Impact A chat reply for this failure now shows the selector's existing guidance, for example: > Explicit auth order for openai has no usable profiles. Selected model route requires api-key authentication (openai-responses); configured profiles support subscription authentication. Select a model route compatible with the configured account, or select a compatible account. Real sign-in failures (rejected or expired credentials) keep the sign-in advice. No new wording: the text is the diagnostic added in #197737. ## Why This Change Was Made `prepare-auth` now throws the incompatibility as a `FailoverError` carrying that diagnostic as `userMessage`, the field chat replies already show for owner-authored copy and that the exhausted-fallback wrapper already forwards. The failover facts stay exactly as before (`reason=auth`, status 401, same provider/model), so fallback, retries and route or credential selection are unchanged. The `required-profile` rejection names the profile id, which chat replies only show in direct chats, so it stays diagnostic-only as before. History: the sign-in copy (#163381) and the `authentication` text pattern predate this diagnostic. #197737 added the explanatory suffix; its word "authentication" made the classifier map the previously unclassified message to `auth`. Nothing deliberately folded route mismatches into sign-in advice. Out of scope: why the reporter's native-Codex turn picked a Platform route in the first place (not isolated in the report; related #162811, #185064). ## Evidence Built Gateway (`pnpm build`) in a secretless `node:24.22.1` container, one inbound Signal DM through a signal-cli stand-in, local Responses API stand-in, synthetic profiles only. Proof comment: #206797 (comment) | scenario | base 7d93619 | this PR | |---|---|---| | subscription OAuth profile, explicit order, model on api-key route (run 1) |⚠️ Couldn't sign in to the AI service... | Explicit auth order for openai has no usable profiles. Selected model route requires api-key authentication... | | same (run 2) |⚠️ Couldn't sign in to the AI service... | same diagnostic | | control: API key rejected by provider (401 invalid_api_key) |⚠️ Couldn't sign in to the AI service... |⚠️ Couldn't sign in to the AI service... | | control: compatible API-key profile on the same route | model reply | model reply | Fallback decision log is `reason=auth next=none` on both sides. Regression: `prepare-auth.test.ts` "explains incompatible Codex auth" now asserts the typed failure; it fails on base (4 cases) and passes here. Delta: the console `lane task error` line for this case is now quiet, as for every other `FailoverError` fallback candidate; the user sees the text directly. Merge danger: two-way door. No stored state, config or contract change; a revert restores the previous reply text. Blast radius: chat replies for route/credential-class mismatches in OpenAI route auth preparation. Co-authored-by: Ayaan Zaidi <[email protected]>
…n again (openclaw#206797) Root cause: src/agents/runtime-plan/prepare-auth.ts:610 turned the route selector's credential-class rejection into a plain `Error`, so its explanatory text ("...requires api-key authentication...") was classified by the generic `authentication` pattern and rendered as "Couldn't sign in to the AI service". Fixes openclaw#206727 ## What Problem This Solves When the selected model route needs a different kind of credential than the configured account (for example an API-key route with only a ChatGPT subscription sign-in), OpenClaw already knows exactly what is wrong and writes a clear, credential-safe explanation. Chat users never saw it: they got "Couldn't sign in to the AI service. Sign in again...", and signing in again with the same subscription cannot fix a route/credential mismatch. Thanks @alexph-dev for the detailed report, production timeline and installed-bundle fixture. ## User Impact A chat reply for this failure now shows the selector's existing guidance, for example: > Explicit auth order for openai has no usable profiles. Selected model route requires api-key authentication (openai-responses); configured profiles support subscription authentication. Select a model route compatible with the configured account, or select a compatible account. Real sign-in failures (rejected or expired credentials) keep the sign-in advice. No new wording: the text is the diagnostic added in openclaw#197737. ## Why This Change Was Made `prepare-auth` now throws the incompatibility as a `FailoverError` carrying that diagnostic as `userMessage`, the field chat replies already show for owner-authored copy and that the exhausted-fallback wrapper already forwards. The failover facts stay exactly as before (`reason=auth`, status 401, same provider/model), so fallback, retries and route or credential selection are unchanged. The `required-profile` rejection names the profile id, which chat replies only show in direct chats, so it stays diagnostic-only as before. History: the sign-in copy (openclaw#163381) and the `authentication` text pattern predate this diagnostic. openclaw#197737 added the explanatory suffix; its word "authentication" made the classifier map the previously unclassified message to `auth`. Nothing deliberately folded route mismatches into sign-in advice. Out of scope: why the reporter's native-Codex turn picked a Platform route in the first place (not isolated in the report; related openclaw#162811, openclaw#185064). ## Evidence Built Gateway (`pnpm build`) in a secretless `node:24.22.1` container, one inbound Signal DM through a signal-cli stand-in, local Responses API stand-in, synthetic profiles only. Proof comment: openclaw#206797 (comment) | scenario | base 5d9c855 | this PR | |---|---|---| | subscription OAuth profile, explicit order, model on api-key route (run 1) |⚠️ Couldn't sign in to the AI service... | Explicit auth order for openai has no usable profiles. Selected model route requires api-key authentication... | | same (run 2) |⚠️ Couldn't sign in to the AI service... | same diagnostic | | control: API key rejected by provider (401 invalid_api_key) |⚠️ Couldn't sign in to the AI service... |⚠️ Couldn't sign in to the AI service... | | control: compatible API-key profile on the same route | model reply | model reply | Fallback decision log is `reason=auth next=none` on both sides. Regression: `prepare-auth.test.ts` "explains incompatible Codex auth" now asserts the typed failure; it fails on base (4 cases) and passes here. Delta: the console `lane task error` line for this case is now quiet, as for every other `FailoverError` fallback candidate; the user sees the text directly. Merge danger: two-way door. No stored state, config or contract change; a revert restores the previous reply text. Blast radius: chat replies for route/credential-class mismatches in OpenAI route auth preparation. Co-authored-by: Ayaan Zaidi <[email protected]>
…n again (#206797) Root cause: src/agents/runtime-plan/prepare-auth.ts:610 turned the route selector's credential-class rejection into a plain `Error`, so its explanatory text ("...requires api-key authentication...") was classified by the generic `authentication` pattern and rendered as "Couldn't sign in to the AI service". Fixes #206727 ## What Problem This Solves When the selected model route needs a different kind of credential than the configured account (for example an API-key route with only a ChatGPT subscription sign-in), OpenClaw already knows exactly what is wrong and writes a clear, credential-safe explanation. Chat users never saw it: they got "Couldn't sign in to the AI service. Sign in again...", and signing in again with the same subscription cannot fix a route/credential mismatch. Thanks @alexph-dev for the detailed report, production timeline and installed-bundle fixture. ## User Impact A chat reply for this failure now shows the selector's existing guidance, for example: > Explicit auth order for openai has no usable profiles. Selected model route requires api-key authentication (openai-responses); configured profiles support subscription authentication. Select a model route compatible with the configured account, or select a compatible account. Real sign-in failures (rejected or expired credentials) keep the sign-in advice. No new wording: the text is the diagnostic added in #197737. ## Why This Change Was Made `prepare-auth` now throws the incompatibility as a `FailoverError` carrying that diagnostic as `userMessage`, the field chat replies already show for owner-authored copy and that the exhausted-fallback wrapper already forwards. The failover facts stay exactly as before (`reason=auth`, status 401, same provider/model), so fallback, retries and route or credential selection are unchanged. The `required-profile` rejection names the profile id, which chat replies only show in direct chats, so it stays diagnostic-only as before. History: the sign-in copy (#163381) and the `authentication` text pattern predate this diagnostic. #197737 added the explanatory suffix; its word "authentication" made the classifier map the previously unclassified message to `auth`. Nothing deliberately folded route mismatches into sign-in advice. Out of scope: why the reporter's native-Codex turn picked a Platform route in the first place (not isolated in the report; related #162811, #185064). ## Evidence Built Gateway (`pnpm build`) in a secretless `node:24.22.1` container, one inbound Signal DM through a signal-cli stand-in, local Responses API stand-in, synthetic profiles only. Proof comment: #206797 (comment) | scenario | base 7d93619 | this PR | |---|---|---| | subscription OAuth profile, explicit order, model on api-key route (run 1) |⚠️ Couldn't sign in to the AI service... | Explicit auth order for openai has no usable profiles. Selected model route requires api-key authentication... | | same (run 2) |⚠️ Couldn't sign in to the AI service... | same diagnostic | | control: API key rejected by provider (401 invalid_api_key) |⚠️ Couldn't sign in to the AI service... |⚠️ Couldn't sign in to the AI service... | | control: compatible API-key profile on the same route | model reply | model reply | Fallback decision log is `reason=auth next=none` on both sides. Regression: `prepare-auth.test.ts` "explains incompatible Codex auth" now asserts the typed failure; it fails on base (4 cases) and passes here. Delta: the console `lane task error` line for this case is now quiet, as for every other `FailoverError` fallback candidate; the user sees the text directly. Merge danger: two-way door. No stored state, config or contract change; a revert restores the previous reply text. Blast radius: chat replies for route/credential-class mismatches in OpenAI route auth preparation. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 6a6431b) Companion audit: 86ca412 concerns saved quota-reset guidance for a route skipped at admission and is separate from account mismatch. Release adaptation: Stable FailoverError does not carry arbitrary userMessage: use its existing code and fixed reply-copy contract for non-required-profile route/account mismatches, preserving the detailed local diagnostic and auth classification. No credential or Codex behavior changed. Co-authored-by: RomneyDa <[email protected]>
…n again (#206797) Root cause: src/agents/runtime-plan/prepare-auth.ts:610 turned the route selector's credential-class rejection into a plain `Error`, so its explanatory text ("...requires api-key authentication...") was classified by the generic `authentication` pattern and rendered as "Couldn't sign in to the AI service". Fixes #206727 ## What Problem This Solves When the selected model route needs a different kind of credential than the configured account (for example an API-key route with only a ChatGPT subscription sign-in), OpenClaw already knows exactly what is wrong and writes a clear, credential-safe explanation. Chat users never saw it: they got "Couldn't sign in to the AI service. Sign in again...", and signing in again with the same subscription cannot fix a route/credential mismatch. Thanks @alexph-dev for the detailed report, production timeline and installed-bundle fixture. ## User Impact A chat reply for this failure now shows the selector's existing guidance, for example: > Explicit auth order for openai has no usable profiles. Selected model route requires api-key authentication (openai-responses); configured profiles support subscription authentication. Select a model route compatible with the configured account, or select a compatible account. Real sign-in failures (rejected or expired credentials) keep the sign-in advice. No new wording: the text is the diagnostic added in #197737. ## Why This Change Was Made `prepare-auth` now throws the incompatibility as a `FailoverError` carrying that diagnostic as `userMessage`, the field chat replies already show for owner-authored copy and that the exhausted-fallback wrapper already forwards. The failover facts stay exactly as before (`reason=auth`, status 401, same provider/model), so fallback, retries and route or credential selection are unchanged. The `required-profile` rejection names the profile id, which chat replies only show in direct chats, so it stays diagnostic-only as before. History: the sign-in copy (#163381) and the `authentication` text pattern predate this diagnostic. #197737 added the explanatory suffix; its word "authentication" made the classifier map the previously unclassified message to `auth`. Nothing deliberately folded route mismatches into sign-in advice. Out of scope: why the reporter's native-Codex turn picked a Platform route in the first place (not isolated in the report; related #162811, #185064). ## Evidence Built Gateway (`pnpm build`) in a secretless `node:24.22.1` container, one inbound Signal DM through a signal-cli stand-in, local Responses API stand-in, synthetic profiles only. Proof comment: #206797 (comment) | scenario | base 7d93619 | this PR | |---|---|---| | subscription OAuth profile, explicit order, model on api-key route (run 1) |⚠️ Couldn't sign in to the AI service... | Explicit auth order for openai has no usable profiles. Selected model route requires api-key authentication... | | same (run 2) |⚠️ Couldn't sign in to the AI service... | same diagnostic | | control: API key rejected by provider (401 invalid_api_key) |⚠️ Couldn't sign in to the AI service... |⚠️ Couldn't sign in to the AI service... | | control: compatible API-key profile on the same route | model reply | model reply | Fallback decision log is `reason=auth next=none` on both sides. Regression: `prepare-auth.test.ts` "explains incompatible Codex auth" now asserts the typed failure; it fails on base (4 cases) and passes here. Delta: the console `lane task error` line for this case is now quiet, as for every other `FailoverError` fallback candidate; the user sees the text directly. Merge danger: two-way door. No stored state, config or contract change; a revert restores the previous reply text. Blast radius: chat replies for route/credential-class mismatches in OpenAI route auth preparation. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 6a6431b) Release adaptation: Use the existing structured failover code and fixed public-copy renderer, preserving fallback without importing the main-only plugin-authored error feature or exposing diagnostic profile details. Co-authored-by: RomneyDa <[email protected]>
Related: #185064
What Problem This Solves
Configured credentials can be rejected with a generic authentication error, while the availability check can misclassify profiles whose inference requirements differ from their stored credential type. For example, token-sharing OAuth serves an API-key route, but the incompatibility check previously treated it as subscription-only OAuth.
User Impact
Route-mismatch errors explain the required authentication class and API adapter, and the class supported by the configured profiles. Model availability correctly distinguishes an incompatible credential contract from a compatible account that is temporarily unavailable; identity-only sign-ins remain explicitly denied inference.
This addresses a bounded classification/diagnostic problem found while investigating #185064. Successful Terra execution on an unmodified current-main Gateway remains unverified, and this PR does not close that issue.
Why This Change Was Made
Use each profile's existing
authRequirementwhen classifying route incompatibility, matching the actual selector. Treatnullas an explicit inference denial. Reuse that classification to append a bounded explanation only when all configured profiles have known incompatible requirements. A configured route remains authoritative in the explanation.The new suffix contains auth categories and API adapter names. It adds no credential values, profile identifiers or endpoint URLs. Physical route selection, profile ordering and native account ownership retain their existing algorithms; the corrected availability classification is intentionally consumed by model admission and Doctor. Native catalog transport metadata and static model lists are unchanged.
Evidence
Regression assertions were run against base
b48d16bf6e98f0b9c1e110548fc46b3b35f2becdbefore applying the production fix: 4 expected selector failures, 3 availability-consumer failures, and 4 runtime auth-preparation failures. The same assertions pass with the fix.Scoped lint, formatting,
git diff --check, the production core typecheck, and both relevant test typecheck leaves pass. The runtime tests exercise observed/authored Platform routes with automatic/explicit profile order, exact credential-safe errors, and successful selected-OAuth forwarding on the subscription route.Self
pr-simplifyand an independent code review completed with no remaining actionable findings. The reviewed, tested, and published file contents match.Validation environment: Node 24.22.1, pnpm 11.25.0, Vitest 5.0.5. Used the documented Node runner and serial projects after a parallel cold worker startup exited 137 before any tests; that setup failure is not counted as defect evidence. Lockfile unchanged.
Focused validation commands
OPENCLAW_VITEST_RUNTIME=node OPENCLAW_TEST_PROJECTS_SERIAL=1 pnpm test \ src/agents/provider-model-route-auth.test.ts \ src/agents/runtime-plan/prepare-auth.test.ts \ src/agents/model-auth-availability.native.test.ts \ src/agents/model-auth-availability.session-pin.test.ts \ --maxWorkers=1 OPENCLAW_LINT_TOOL=oxlint node scripts/run-oxlint.mjs \ --tsconfig config/tsconfig/oxlint.core.json \ src/agents/provider-model-route-auth.ts \ src/agents/provider-model-route-auth.test.ts \ src/agents/runtime-plan/prepare-auth.test.ts \ src/agents/model-auth-availability.native.test.ts OPENCLAW_FORMAT_TOOL=oxfmt pnpm format:check \ src/agents/provider-model-route-auth.ts \ src/agents/provider-model-route-auth.test.ts \ src/agents/runtime-plan/prepare-auth.test.ts \ src/agents/model-auth-availability.native.test.ts git diff --check node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.agents-root.json --incremental node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.agents-other.json --incrementalImplementation and review were AI-assisted. Regression inputs are synthetic; these tests perform no provider inference or account sign-in. Upstream main CI, CodeQL security, and Critical Quality all succeeded on head
3321155e3853b5f87a26e207ad468e165ced9c8c.The current-head security notice requires an upstream maintainer to review and post
/allow-security-sensitive-changebefore merge. The aggregate merge gate is blocked on that approval, not on a test failure. Maintainer review remains pending.Runtime behavior proof — November 12
Added the running CLI/Gateway evidence requested in the ClawSweeper review, at unchanged source and build commit
3321155e3853b5f87a26e207ad468e165ced9c8c.The normal
pnpm openclaw --helpsource build completed; the CLI reports OpenClaw 2026.11.3 anddist/build-info.jsonidentifies the full commit above. These runs use the actual CLI, a running Gateway, the real bundled OpenAI provider, and the canonical SQLite credential writer. No provider-policy, selector, availability, authentication-preparation, or Gateway-dispatch functions were mocked.Each case has separate disposable
OPENCLAW_HOME,OPENCLAW_STATE_DIR,OPENCLAW_CONFIG_PATH, and workspace paths. Provider credentials were excluded from the inherited environment. The sole account in each case is synthetic, persisted with the packagedupsertAuthProfileWithLockOrThrowSDK function;models auth listverifies the stored OAuth account.plugins list --jsonreports the bundled OpenAI plugin as enabled and loaded. The fixtures use an authoredopenai/gpt-5.5row, the OpenClaw runtime, and unpinned model selection.openai-responsesroutechatgpt-token-sharing; expired at1, no refresh token; canonicalhttps://api.openai.com/v1+openai-responsesmodels listreportsavailable: false; Gateway spawn returnsaccepted,modelApplied: true;agent.waitthen reports the same run's ordinary auth failure.chatgpt-identity; authoredopenai-chatgpt-responsesrouteThe public Responses endpoint in the token-sharing case is intentional: OpenAI's actual token-sharing policy requires that canonical endpoint. An earlier loopback setup mixed endpoint incompatibility with expiry and is excluded from the evidence.
Actual commands and captured output
All setup/readback commands returned exit 0:
The account fixtures are written through the packaged canonical API, with explicit disposable state and agent directories:
Each credential uses OAuth storage, provider
openai, and a synthetic access value. The ordinary and identity-only fixtures have future expiry; the latter specifiesauthFlow: "chatgpt-identity". The compatible-unavailable fixture specifiesauthFlow: "chatgpt-token-sharing",expires: 1, and an empty refresh field, which the canonical store normalizes away.1. Actual local agent CLI — mismatch
pnpm openclaw agent --local --agent main \ --message "Proof only; no inference should start." --jsonExit 1. Captured JSON:
{ "ok": false, "error": { "type": "cli_error", "message": "No route-compatible authentication source is configured for openai. Selected model route requires api-key authentication (openai-responses); configured profiles support subscription authentication. Select a model route compatible with the configured account, or select a compatible account." } }2–3. Actual Gateway model-choice consumer
The disposable Gateway config explicitly includes the documented
gateway.tools.allow: ["sessions_spawn"]exposure setting. Both cases run a realpnpm openclaw gateway runprocess and wait for its ready log.pnpm openclaw gateway call tools.invoke \ --params '{"name":"sessions_spawn","agentId":"main","args":{"task":"Proof only; no inference should start.","model":"openai/gpt-5.5","runtime":"subagent","context":"isolated","mode":"run","runTimeoutSeconds":10,"expectsCompletionMessage":false}}' \ --json --timeout 20000The RPC exits 0 in both cases. The significant result is the nested
output.details, not merely the RPC envelope'sok: true.Compatible but unavailable token-sharing profile, selected fields from the actual
output.details:{ "status": "accepted", "runId": "<proof-run>", "resolvedModel": "openai/gpt-5.5", "resolvedProvider": "openai", "modelApplied": true }Then the public wait RPC, using that same returned run ID:
pnpm openclaw gateway call agent.wait \ --params '{"runId":"<proof-run>","timeoutMs":15000}' \ --json --timeout 20000Exit 0; selected fields from the actual terminal result:
{ "runId": "<proof-run>", "status": "error", "error": "No route-compatible authentication source is configured for openai." }The Gateway log independently records that same run's authentication failure. The run ID is redacted consistently above; matching of the original receipts was verified. This is observed terminal failure, not an assumption based on spawn acceptance.
Identity-only profile on the subscription route, actual
output.details:{ "status": "error", "error": "sessions_spawn model \"openai/gpt-5.5\" is not usable: The selected account or native runtime is unavailable for openai/gpt-5.5. Restore that account before spawning this model." }No accepted child run ID was returned in the identity-only case.
Cleanup and scope
The two Gateway logs confirm intentional shutdown and clean completion (146 ms for canonical token sharing; 118 ms for identity-only). After shutdown, both Gateway ports were closed and the actual offline
models auth listcommand succeeded, confirming release of state ownership. The pnpm wrapper's -15 status records the fixture owner's intentional SIGTERM cleanup.The mismatch and identity-only cases use loopback sentinel endpoints, each recording zero requests. The canonical public endpoint in the compatible-unavailable case was not instrumented; its receipt demonstrates authentication-preparation failure and makes no measured zero-outbound-traffic claim. No valid account credential or successful inference is claimed.
These are real CLI/Gateway executions with controlled fixture inputs. The runtime captures are for the PR head only; the baseline comparison remains the red/green regression evidence above. They do not establish native Codex/Terra inference or resolve #185064.
The final captures and setup were independently reviewed, including the canonical token-sharing endpoint requirement. Repository source remains clean and unchanged. The second ClawSweeper review, completed November 12 at 9:48 a.m. ET, accepted this terminal proof as sufficient and reported no findings. GitHub now labels the PR
proof: sufficientandstatus: ⏳ waiting on maintainer. The remaining before-merge requirement is upstream maintainer approval of the authentication change for this exact head.