Repository navigation
fix(discord): refuse unavailable model runtime selections - #143322
Conversation
|
🦞👀 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. |
|
Codex review: blocked before merge. Reviewed September 10, 2026, 2:19 PM ET / 18:19 UTC (Revision 11). ClawSweeper reviewWhat this changesDiscord’s model picker uses model-specific runtime availability, preserves runtime identity across navigation, and refuses stale or unavailable selections before dispatch. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful Discord fix that current main does not implement. No blocking code defect was found in the narrowed patch; earlier credential-import findings no longer belong to its introduced changes. Repository-required visual evidence remains outstanding. Priority: P2 Review scores
Verification
How this fits togetherDiscord’s model picker turns slash-command interactions into model-selection commands. It reads OpenClaw’s shared model catalog and session context, while normal command dispatch retains authorization and persistence. flowchart TD
A[Discord model picker] --> B[Resolve session context]
B --> C[Shared model and runtime catalog]
C --> D[Validate selected runtime]
D -->|Unavailable or stale| E[Show recovery notice]
D -->|Available| F[Authorized command dispatch]
F --> G[Save and confirm selection]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +106, Tests +430. Total +536 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep shared catalog ownership and normal command authorization, with demonstrated picker recovery and built-in model-only compatibility on the supported older host. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main derives runtime choices from the provider union, allowing another model’s runtime into the picker. The focused regressions exercise that distinction; no runtime reproduction was executed here. Is this the best way to solve the issue? Yes. Consuming shared model-specific decisions and retaining normal command dispatch is a focused repair without adding a competing availability or authorization owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 99cd8f569d25. 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 (10 earlier review cycles; latest 8 shown)
|
## 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]>
4088fa5 to
b41be86
Compare
|
landpr-approve-admin-merge |
|
Thanks @obviyus! Proof: The compiled, registered mock-Gateway flow saved an available model, refused an unavailable selection without changing saved state, and refused a stale generated control. Live QA bots completed a guild message round-trip; Discord also accepted and returned the generated menu components.
|
…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]>
…43322) Use shared model-specific runtime and session authentication facts in Discord model menus. Preserve stable runtime identities through navigation and refuse unknown, unavailable, retired, or obsolete selections before normal command dispatch. Related: openclaw#136257 Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #136257, #143588.
What Problem This Solves
Fixes an issue where the chat model picker retained a runtime for another model or selected a different runtime when an old menu’s choices were reordered.
Why This Change Was Made
The picker consumes shared model-specific runtime choices with the effective session’s authentication context. Navigation carries stable runtime identities and rejects unavailable, retired or obsolete selections before command dispatch.
User Impact
Valid choices remain selectable; stale choices show a notice without changing saved state. Older supported installations retain model-only selection and refuse unsupported explicit runtime changes.
Consumers: the channel picker uses shared model/runtime eligibility and stable identities.
Evidence
Four rendering regressions failed before the fix. Targeted picker, catalog and authentication tests passed. Registered commands with a mocked Gateway proved available selection and unavailable/stale refusal with unchanged saved state. Live guild evidence covered replies and menu-component delivery; native commands and user component clicks were not driven.