Skip to content

feat(auth): import declared credentials during provider login - #142933

Merged
obviyus merged 7 commits into
mainfrom
fix/explicit-provider-credential-import
Sep 9, 2026
Merged

obviyus merged 7 commits into
mainfrom
fix/explicit-provider-credential-import

Conversation

@obviyus

@obviyus obviyus commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Login could prompt again for an existing supported credential or report successful reuse of an expired saved account.

Why This Change Was Made

The migration owner selects the method’s declared credential kind, checks plugin policy before reading, and rechecks usability before saving under the existing lock. Explicit force, profile selection, and default-changing requests use normal sign-in.

User Impact

Eligible credentials can be reused without another paste prompt, preserving profiles and model settings. Expired credentials require renewal. No schema change is required.

Evidence

Compiled CLI checks reproduced the extra prompt and expired-profile false success. Candidate checks imported a usable credential and exposed it through the public auth list without changing source/config data. The expired case reached renewal but failed on unavailable network resolution, so completed authentication is unverified. Credential-import regressions passed. Live channel reuse and account validity were outside the captured proof.

@obviyus obviyus self-assigned this Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations extensions: openai extensions: codex size: XL maintainer Maintainer-authored PR labels Sep 9, 2026
@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: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 9, 2026, 6:48 AM ET / 10:48 UTC (Revision 5).

ClawSweeper review

What this changes

Provider login can import an existing credential through a plugin-declared migration owner while preserving model settings and explicit login options.

Warning

SQLite table change

This PR modifies persisted SQLite tables in extensions/codex/src/migration/auth.ts, extensions/codex/src/migration/cli-credentials.ts, extensions/codex/src/migration/source.ts, src/plugins/migration-provider-public-artifacts.ts, and 1 more. Prefer a design that avoids changing persisted SQLite tables. Migration or upgrade compatibility proof is recorded, but maintainers should still confirm that the schema change is necessary.

Merge readiness

⛔ Blocked before merge - 4 items remain

This remains useful, protected work absent from inspected main. Earlier defects are addressed, but the prior channel account-selection decision remains unresolved; the latest commit changes only a test fixture.

Priority: P2
Reviewed head: d74df581a8dc8863c428b213c8582b5f348b5e3e
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent implementation with useful CLI proof and no new concrete correctness finding; account-selection intent remains unresolved.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The supplied compiled-CLI before/after observations support file-key import, persisted-profile readback, owner-policy rejection, and preservation of existing settings and credentials. That accepted CLI evidence remains valid; channel account-selection behavior is a separate unresolved product and validation question.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied compiled-CLI before/after observations support file-key import, persisted-profile readback, owner-policy rejection, and preservation of existing settings and credentials. That accepted CLI evidence remains valid; channel account-selection behavior is a separate unresolved product and validation question.
Evidence reviewed 10 items Introduced login shortcut: The pinned introduced diff adds import before interactive authentication, bypassed by force, profileId, and setDefault. Successful import promotes the saved profile and returns immediately.
Channel account selection remains affected: The device-code method declares credential import. The channel runtime invokes that method without an import-bypass option, and commands-login.ts selects the returned profile for the session. The existing owner/admin and private-context checks remain in place.
Channel caller and final session selection: runCodexDeviceLoginFlow passes method, agent, config, signal, and isRemote, with no force or profileId for this caller; the channel handler then switches to the returned profile. This supports the previous review's account-selection concern without establishing an authorization bypass.
Findings None None.
Security None None.

How this fits together

Provider authentication serves both CLI sign-in and channel login commands. The new import path reads the selected credential source, saves an agent auth profile, and returns that profile to callers that may select it for subsequent requests.

flowchart TD
  A[CLI or channel login] --> B[Selected provider method]
  B --> C{Import eligible?}
  C -->|Yes| D[Policy-approved migration owner]
  D --> E[Read and recheck source credential]
  E --> F[Save and select auth profile]
  C -->|No or unavailable| G[Interactive sign-in]
  G --> F
Loading

Decision needed

Question Recommendation
Should channel device-code login automatically reuse the host's stored Codex account, or continue requiring device pairing? Preserve device pairing: Keep automatic import for appropriate CLI methods while ensuring channel device-code login continues to offer explicit account selection.

Why: The shared login shortcut changes which account a channel session selects, and neither the supplied discussion nor the latest test-only commit establishes the intended behavior.

Before merge

  • Resolve merge risk (P1) - An existing channel owner requesting device-code login can receive immediate success and switch the session to the host's stored account, without choosing an account through device pairing.
  • Resolve merge risk (P1) - The optional provider-auth declaration and public migration artifact introduce a plugin contract whose automatic account-selection semantics need an explicit maintainer decision.
  • Complete next step (P2) - Decide whether channel device-code login may reuse host credentials, then document and demonstrate the selected behavior before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +713, Tests +664, Docs +25. Total +1402 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 15 804 91 +713
Tests 4 770 106 +664
Docs 1 25 0 +25
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 20 1599 197 +1402

Review metrics

Metric Value Why it matters
Provider contract expansion 1 optional import declaration and 1 public artifact convention; 3 OpenAI auth methods opt in The contract affects plugin authors and extends automatic reuse to device-code login.
Production versus test growth Net production +713 lines; tests +664 lines Production growth implements native storage selection, credential fencing, and generic migration dispatch; tests cover preservation and rejection behavior.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/codex/migration-provider-api.ts, migration/backfill/repair: extensions/codex/src/migration/cli-credentials.ts, migration/backfill/repair: extensions/codex/src/migration/plan.ts, migration/backfill/repair: extensions/codex/src/migration/provider.ts, migration/backfill/repair: extensions/codex/src/migration/source.ts, migration/backfill/repair: src/commands/models/auth-credential-import.ts, and 10 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Retain explicit channel account selection (recommended)
    After the product decision, narrow the import shortcut so channel device-code login cannot silently select the host account.
  2. Approve and demonstrate reuse
    Accept the changed account-selection behavior only after documenting it and demonstrating a clear channel account choice.

Technical review

Best possible solution:

Keep plugin-owned CLI credential reuse while preserving explicit account choice for channel device-code login, with documented behavior for existing installations.

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

Not applicable as a feature proposal; source inspection establishes the changed channel path, but this review did not execute a channel login.

Is this the best way to solve the issue?

Unclear overall: reusing the migration owner is coherent, but extending automatic import to device-code callers needs an explicit account-selection decision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 056d14028ff1.

Labels

Label justifications:

  • P2: This is a bounded provider-login improvement with an unresolved account-selection choice.
  • merge-risk: 🚨 compatibility: Existing device-code callers can bypass pairing, and the PR expands the provider plugin contract.
  • merge-risk: 🚨 auth-provider: Channel login can select the host's stored account instead of an account chosen through device pairing.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied compiled-CLI before/after observations support file-key import, persisted-profile readback, owner-policy rejection, and preservation of existing settings and credentials. That accepted CLI evidence remains valid; channel account-selection behavior is a separate unresolved product and validation question.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied compiled-CLI before/after observations support file-key import, persisted-profile readback, owner-policy rejection, and preservation of existing settings and credentials. That accepted CLI evidence remains valid; channel account-selection behavior is a separate unresolved product and validation question.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The shared shortcut can change Telegram /login from device pairing to immediate success and session account selection.

Evidence

What I checked:

  • Introduced login shortcut: The pinned introduced diff adds import before interactive authentication, bypassed by force, profileId, and setDefault. Successful import promotes the saved profile and returns immediately. (src/commands/models/auth.ts:1054, d74df581a8dc)
  • Channel account selection remains affected: The device-code method declares credential import. The channel runtime invokes that method without an import-bypass option, and commands-login.ts selects the returned profile for the session. The existing owner/admin and private-context checks remain in place. (extensions/openai/provider-contract-api.ts:94, d74df581a8dc)
  • Channel caller and final session selection: runCodexDeviceLoginFlow passes method, agent, config, signal, and isRemote, with no force or profileId for this caller; the channel handler then switches to the returned profile. This supports the previous review's account-selection concern without establishing an authorization bypass. (src/auto-reply/reply/commands-login.ts:246, d74df581a8dc)
  • Re-review continuity: The supplied previous review requested a decision about channel reuse of host credentials. REST inspection confirms the newest commit only changes provider.test.ts to seed the selected local store explicitly; it does not resolve that product choice. The live PR remains open and has no submitted reviews. (extensions/codex/src/migration/provider.test.ts:1085, d74df581a8dc)
  • Import safeguards and regression coverage: The importer validates the declared item, provider, and credential kind. The migration owner rereads credential bytes, rejects changed fingerprints, checks cancellation before the store update, and preserves existing matching profiles. Added coverage includes denied owners, explicit login options, changed sources, uncertain reader cleanup, and expired existing OAuth profiles. (extensions/codex/src/migration/auth.ts:593, d74df581a8dc)
  • Supplied real CLI proof: The captured PR body reports compiled-CLI before/after import, fresh auth-list readback, unchanged source/config observations, enabled/disabled/denied owner controls, explicit default selection, and preservation of an existing OAuth profile. It identifies executed package 3cc281be93b891adadd725557671126d9d07d3ad and limits its claims to synthetic file credentials with an offline Gateway. It does not claim channel account-selection proof. Captured context identity: 708e57cca60d02a314e1e82c5432d49bb64b4fb14661d413aee892b0c47e6a38. (3cc281be93b8)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve the channel device-code account-selection policy and demonstrate the chosen behavior.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-09T07:43:01.915Z sha 7191e78 :: needs real behavior proof before merge. :: [P1] Enforce plugin policy before loading bundled migration artifacts | [P2] Honor --set-default when credential import succeeds
  • reviewed 2026-09-09T08:37:06.669Z sha 9a7bbc1 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-09T09:48:07.178Z sha 9a7bbc1 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T10:27:06.494Z sha aa1e10a :: blocked before merge. :: none

@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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 9, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. labels Sep 9, 2026
@obviyus

obviyus commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 142933
head: d74df58
run: 34341630235 attempt: 1
failed: checks-node-changed-extensions-bundle-27 job=102433708549 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit 0d383e9 into main Sep 9, 2026
178 of 180 checks passed
@obviyus
obviyus deleted the fix/explicit-provider-credential-import branch September 9, 2026 11:34
@obviyus

obviyus commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 0d383e9 after a clean exact-head review and guarded merge.

  • Supported file credentials import through provider login without another paste prompt. Fresh-process profile reads confirm persistence; source files, existing credentials and model settings remain preserved.
  • The expired-OAuth control now requests renewal instead of reporting false import success. It reaches the device-code request and ends with isolated DNS failure, not completed authentication or cancellation. The usable-profile control reuses its existing credentials without fresh pairing.
  • Independent captured-observation validation accepts all five required clauses. The review cleared code and security findings. Live Telegram, inherited/shared-owner reuse, other storage backends and optional public force/profile-id/race controls remain unproved.
  • CI34341630235, attempt1 remains red from checks-node-changed-extensions-bundle-27 and its aggregate gate. The sole child failure is the final reply assertion in model-callback.loopback.integration.test.ts:245: editMessageText fails after model selection is persisted. This path does not call login/import. Its test, router and reply implementation match tested main parent056d14028ff128218ab98e1558832ba627bad146. The earlier separate candidate run34329028662/job102393560836 records the same failure on head0f25a8723c45016b1a93591f3525021783a85789. Main-push CI does not select this changed-extension suite; no matching main-run claim is made. The low-level transport cause and introducing author/commit remain unknown.
  • The merge used the exact standing unrelated-red approval. No CI replay or unrelated Telegram repair was included.

Native sign-in/status/catalog ownership and removal of ordinary-read credential sync remain separate work.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…aw#142933)

Provider login can import an existing credential through the selected method's migration provider. For example, `openclaw models auth login --provider openai --method api-key` reuses a supported Codex file key without another paste prompt.

The migration owner selects the declared item and credential kind, checks plugin policy before loading the artifact, and re-reads the credential before saving. Import preserves existing profiles and model settings. A matching OAuth profile must be usable at planning and again under the existing store lock. An expired match leads to renewed sign-in; expiry after planning fails closed. `--force`, `--profile-id`, and `--set-default` use normal sign-in. This uses the existing credential writer and changes no SQLite schema or table version.

The approved method-level behavior includes device-code login: an eligible usable stored account may be reused by the shared channel caller, and that returned profile is selected for the session. Existing owner, private-context and account checks remain. Fresh pairing is used when import is unavailable. Live channel behavior is outside the captured CLI proof below.

Validation:

- Compiled baseline prompts for the existing key; the candidate imports without input and a fresh `models auth list --json` sees the profile. Paired source-file and full configuration observations remain unchanged.
- Enabled-owner control imports. Disabled and denylisted controls show no opens of the selected artifact/source paths and no saved profile; their recorded timeout and cancellation remain explicit limits. `--set-default` takes fresh input and applies the provider recommendation. An API-key compatibility control preserves the existing OAuth profile, tokens and configuration.
- Before the usability fix, the compiled CLI falsely reports import success for an expired local OAuth profile. After the fix, it requires renewal and reaches a device-code request, then exits1 with `EAI_AGAIN auth.openai.com` in the isolated environment. No cancellation input or completed vendor authentication is claimed. The usable-profile control reuses the existing profile, exits0 and preserves its tokens, configuration and source file.
- Independent captured-observation validation passes all five required clauses at those limits. Native formatting, lint and commit hooks pass. The exact-head CI credential-import regressions pass. Optional public force/profile-id and race controls, inherited/shared-owner reuse, live account validity and other storage backends remain outside this proof.

The affected commands use the original package from [CI34339642829](https://github.com/openclaw/openclaw/actions/runs/34339642829), build `cb74e7eefc9e9fe7cf87ded8bc568e8dc136cd2f`. All15 production PR files match `d74df581a8dc8863c428b213c8582b5f348b5e3e`; the later commit repairs only test setup. Full source/sibling comparison is retained. The nearby checkout makes the CLI banner show `9a7bbc1`; original package stamps remain unchanged. Earlier valid controls keep their original package identities.

[Current CI34341630235](https://github.com/openclaw/openclaw/actions/runs/34341630235) is terminal with one unrelated failed child: [Telegram loopback reply](https://github.com/openclaw/openclaw/actions/runs/34341630235/job/102433708549), plus the aggregate gate. The failure follows successful session persistence and matches [an earlier separate candidate failure](https://github.com/openclaw/openclaw/actions/runs/34329028662/job/102393560836). The exercised model callback does not call login/import; its complete test/router/reply source matches the tested main parent. The low-level transport cause is unknown. [Standing unrelated-red approval](openclaw#142933 (comment)) records the exact run and head; final review and guarded merge remain required.

This completes the explicit-import capability. Wider native sign-in/status/catalog ownership and removal of ordinary-read credential sync remain separate work.

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit that referenced this pull request Sep 10, 2026
## Summary

Native Codex sign-in now supplies model availability without copying its credentials into OpenClaw profiles. CLI, chat, status, and Gateway model controls use one prepared owner for per-model runtime eligibility, physical routes, and authentication mode. Selections are revalidated before session persistence.

Native sign-in observations no longer masquerade as host-prepared credentials when the registered runtime evaluates model eligibility. Native credentials remain with Codex. Explicit profiles, account pins, authored routes, isolated agent homes, and remote server accounts retain their existing boundaries. Native local stdio uses the user home only when no prepared OpenClaw credential or explicit home selection owns the route. The separate Gateway authentication projection and ordinary-read Codex credential import are removed.

Explicit import preserves the supported declared `openai:default` profile reference. Apply now rechecks inherited account identity and usability at the destination, so an account inserted under the same profile ID after planning cannot be silently replaced. Matching shared accounts stay inherited. Native authentication enumeration also follows the captured plugin generation, including an explicitly empty generation, instead of unrelated ambient registry state.

Default local discovery asks the existing ordered-profile owner first and carries its selected profile and store into the shared client. Native login is the fallback when that owner selects no profile; an explicitly selected native home retains its authority.

Stdio proxies keep the destination server’s account and model catalog. Local login probing and the native user-home default apply only to owned local stdio runtimes; proxy arguments from configuration and environment use the existing proxy classifier.

Login-status probing also retains the official Node launcher prefix and native configuration arguments while removing the app-server transport suffix. Runtime verification rules are unchanged.

## Compatibility

The approved native-owner cutover requires explicit import or reselection for old CLI-backed pins outside the supported declared default-profile recovery. The credential documentation describes that recovery. Existing explicitly isolated homes and remote connections retain their selection. No configuration key, protocol version, or SQLite schema is added.

Dependency contract personally inspected in Codex at `e5769939113536eb72752660bf7d1903f799d198`: [`codex-rs/app-server-protocol/src/protocol/v2/account.rs:524`](https://github.com/openai/codex/blob/e5769939113536eb72752660bf7d1903f799d198/codex-rs/app-server-protocol/src/protocol/v2/account.rs#L524) (`GetAccountParams` and `GetAccountResponse`), [`codex-rs/app-server/src/request_processors/account_processor.rs:826`](https://github.com/openai/codex/blob/e5769939113536eb72752660bf7d1903f799d198/codex-rs/app-server/src/request_processors/account_processor.rs#L826) (managed refresh and client-supplied token login), and [`codex-rs/cli/src/login.rs:443`](https://github.com/openai/codex/blob/e5769939113536eb72752660bf7d1903f799d198/codex-rs/cli/src/login.rs#L443) (native login status). `account/read` supplies account identity; an unknown remote subscription mode remains unknown. [`codex-rs/cli/src/main.rs:1344`](https://github.com/openai/codex/blob/e5769939113536eb72752660bf7d1903f799d198/codex-rs/cli/src/main.rs#L1344) confirms that stdio proxy forwards to the selected Unix socket.

## Validation

- Native Testbox: 300 selected tests passed across import/auth bridge, native login/logout, per-model choices, captured generation ownership, status, Gateway metadata, and CLI cleanup.
- The inherited-account and captured-registry regressions failed before their fixes and pass afterward.
- The registered-harness correction passed 60 focused tests. The proxy correction failed six regression cases before the fix, then passed all 76 focused tests.
- The profile-owned discovery correction passed 18 catalog cases and two selected shared-client cases after two expected regression failures. The launcher correction passed 31 native/transport cases after its expected regression failure.
- A required merge-conflict rebase retained all 17 PR patches. The auth-pin and selected-model setup tests passed all 23 cases on the rebased head; retained runtime captures keep their original tested build identities.
- Formatting and syntax lint passed for each correction. Type checks and full CI run on GitHub.
- Telegram Test Server commands on the compiled candidate: native runtime selection succeeds; status agrees; a missing explicit profile rejects without changing selection; verified native logout plus public catalog refresh rejects the native runtime. No inference requests were made.
- Enabled-discovery proof with the real Codex binary selects the profile-owned catalog while native login is absent or different, and the native catalog for explicit user-home selection. An official Node-launcher control with no host profiles reports native auth and an available native model. Synthetic host-token cases retain vendor auth-rejection diagnostics; this proof establishes catalog ownership, not vendor credential validity.
- Public interactive migration was paused at confirmation while a same-ID inherited account was inserted. A different account reports conflict; a matching usable account is reused; neither writes a child-local shadow. The unrelated shared profile and native source remain intact.
- Public CLI migration preserves the declared `openai:default` reference, configured model, and native source bytes. Repeating import with a separate backup output retains one profile and reports no credential write.
- Synthetic native credentials prove local command and ownership behavior; they do not establish vendor authentication or inference. Full GitHub CI and the exact-head landing review are tracked by the required checks and landing receipt.

Related: #136257. Builds on explicit import from #142933. Discord #143322 is a separate consumer lane.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
…w#143588)

## Summary

Native Codex sign-in now supplies model availability without copying its credentials into OpenClaw profiles. CLI, chat, status, and Gateway model controls use one prepared owner for per-model runtime eligibility, physical routes, and authentication mode. Selections are revalidated before session persistence.

Native sign-in observations no longer masquerade as host-prepared credentials when the registered runtime evaluates model eligibility. Native credentials remain with Codex. Explicit profiles, account pins, authored routes, isolated agent homes, and remote server accounts retain their existing boundaries. Native local stdio uses the user home only when no prepared OpenClaw credential or explicit home selection owns the route. The separate Gateway authentication projection and ordinary-read Codex credential import are removed.

Explicit import preserves the supported declared `openai:default` profile reference. Apply now rechecks inherited account identity and usability at the destination, so an account inserted under the same profile ID after planning cannot be silently replaced. Matching shared accounts stay inherited. Native authentication enumeration also follows the captured plugin generation, including an explicitly empty generation, instead of unrelated ambient registry state.

Default local discovery asks the existing ordered-profile owner first and carries its selected profile and store into the shared client. Native login is the fallback when that owner selects no profile; an explicitly selected native home retains its authority.

Stdio proxies keep the destination server’s account and model catalog. Local login probing and the native user-home default apply only to owned local stdio runtimes; proxy arguments from configuration and environment use the existing proxy classifier.

Login-status probing also retains the official Node launcher prefix and native configuration arguments while removing the app-server transport suffix. Runtime verification rules are unchanged.

## Compatibility

The approved native-owner cutover requires explicit import or reselection for old CLI-backed pins outside the supported declared default-profile recovery. The credential documentation describes that recovery. Existing explicitly isolated homes and remote connections retain their selection. No configuration key, protocol version, or SQLite schema is added.

Dependency contract personally inspected in Codex at `e5769939113536eb72752660bf7d1903f799d198`: [`codex-rs/app-server-protocol/src/protocol/v2/account.rs:524`](https://github.com/openai/codex/blob/e5769939113536eb72752660bf7d1903f799d198/codex-rs/app-server-protocol/src/protocol/v2/account.rs#L524) (`GetAccountParams` and `GetAccountResponse`), [`codex-rs/app-server/src/request_processors/account_processor.rs:826`](https://github.com/openai/codex/blob/e5769939113536eb72752660bf7d1903f799d198/codex-rs/app-server/src/request_processors/account_processor.rs#L826) (managed refresh and client-supplied token login), and [`codex-rs/cli/src/login.rs:443`](https://github.com/openai/codex/blob/e5769939113536eb72752660bf7d1903f799d198/codex-rs/cli/src/login.rs#L443) (native login status). `account/read` supplies account identity; an unknown remote subscription mode remains unknown. [`codex-rs/cli/src/main.rs:1344`](https://github.com/openai/codex/blob/e5769939113536eb72752660bf7d1903f799d198/codex-rs/cli/src/main.rs#L1344) confirms that stdio proxy forwards to the selected Unix socket.

## Validation

- Native Testbox: 300 selected tests passed across import/auth bridge, native login/logout, per-model choices, captured generation ownership, status, Gateway metadata, and CLI cleanup.
- The inherited-account and captured-registry regressions failed before their fixes and pass afterward.
- The registered-harness correction passed 60 focused tests. The proxy correction failed six regression cases before the fix, then passed all 76 focused tests.
- The profile-owned discovery correction passed 18 catalog cases and two selected shared-client cases after two expected regression failures. The launcher correction passed 31 native/transport cases after its expected regression failure.
- A required merge-conflict rebase retained all 17 PR patches. The auth-pin and selected-model setup tests passed all 23 cases on the rebased head; retained runtime captures keep their original tested build identities.
- Formatting and syntax lint passed for each correction. Type checks and full CI run on GitHub.
- Telegram Test Server commands on the compiled candidate: native runtime selection succeeds; status agrees; a missing explicit profile rejects without changing selection; verified native logout plus public catalog refresh rejects the native runtime. No inference requests were made.
- Enabled-discovery proof with the real Codex binary selects the profile-owned catalog while native login is absent or different, and the native catalog for explicit user-home selection. An official Node-launcher control with no host profiles reports native auth and an available native model. Synthetic host-token cases retain vendor auth-rejection diagnostics; this proof establishes catalog ownership, not vendor credential validity.
- Public interactive migration was paused at confirmation while a same-ID inherited account was inserted. A different account reports conflict; a matching usable account is reused; neither writes a child-local shadow. The unrelated shared profile and native source remain intact.
- Public CLI migration preserves the declared `openai:default` reference, configured model, and native source bytes. Repeating import with a separate backup output retains one profile and reports no credential write.
- Synthetic native credentials prove local command and ownership behavior; they do not establish vendor authentication or inference. Full GitHub CI and the exact-head landing review are tracked by the required checks and landing receipt.

Related: openclaw#136257. Builds on explicit import from openclaw#142933. Discord openclaw#143322 is a separate consumer lane.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation extensions: codex extensions: openai maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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