Skip to content

[Bug]: Model picker persists an OpenAI model without ensuring its required Codex harness can run #134305

Closed

Description

@goslingmanagment

Bug type

Behavior bug (model-selection control path)

Beta release blocker

No

Summary

The Control UI model picker can persist an openai/* model even when its required codex agent harness has no installed/activatable owner. The picker does not invoke the existing runtime-plugin ensure/install path and does not validate prepared-runtime readiness before committing the selection. The first turn then fails before inference.

This issue is intentionally limited to selection-time runtime readiness. A separate issue tracks working claude-cli/* rows being projected as unavailable and disabled by the picker.

Steps to reproduce

  1. Use OpenClaw 2026.8.1 with valid OpenAI OAuth and no installed @openclaw/codex plugin.

  2. Start with a working model, for example claude-cli/claude-opus-5.

  3. In the Control UI model picker, select openai/gpt-5.6-sol.

  4. Observe the Gateway log:

    persisted sticky model selection agentId=main model=openai/gpt-5.6-sol target=defaults
    
  5. Send a message.

Expected behavior

Before committing the model selection, the UI/Gateway should do one of the following:

  • verify that the resolved harness owner is registered and ready;
  • invoke the supported runtime-plugin setup flow and require explicit capability acceptance where needed; or
  • refuse the selection with an actionable explanation that names @openclaw/codex and any plugins.allow blocker.

The prior runnable selection should remain usable from the UI.

Actual behavior

  • sessions.patch accepts the selection and sticky persistence writes it to the configured default under the current unset/effective scope.

  • There is no Codex plugin install/provision attempt in the Gateway log.

  • The next turn fails in 26-27 ms:

    Agent harness runtime "codex" is unavailable because its plugin registration is missing from this prepared run.
    
  • openclaw models status knows the route is unavailable, but that state does not gate the picker commit.

Source evidence

  • sessions.patch calls persistSessionPatchModelSelection; that path does not call ensureModelSelectionRuntimePlugins.
  • Runtime-plugin ensure/repair helpers exist for onboarding and CLI model-selection flows, but not this UI patch path.
  • The official Codex harness requires @openclaw/codex to be installed and, when a restrictive allowlist is configured, codex to be included in plugins.allow.

Version

OpenClaw 2026.8.1 (ea80657), npm install, macOS, Node 26.7.0.

Related

Privacy

No credentials, account identifiers, tokens, or private filesystem contents are included.

Activity

  1. goslingmanagment commented on Aug 31, 2026

    @goslingmanagment
    ContributorAuthor

    Correction on the dead-rows mechanism (updating my own report; the user-facing symptom and asks are unchanged):

    • The claim that the anthropic plugin drops out of the prepared run once the default moves off claude-cli/* is wrong. openclaw plugins inspect anthropic --json on the affected box shows "activated": true, "status": "loaded", "activationReason": "bundled default enablement", and the full catalog (models list --all) still contains all claude-cli/* and anthropic/* models.
    • Stronger: with the broken openai/* default still in place, a CLI probe succeeds immediately — openclaw agent --agent main --model claude-cli/claude-opus-5 -m 'Reply exactly PROBE_OK' returns PROBE_OK. The backend, harness, and native Claude CLI auth are all healthy while the picker shows those same models as unselectable.
    • Clicking the dead rows emits no sessions.patch at all (every sticky persist in the gateway log is an openai/* model), so the disable is client-side. The likely trigger: claude-cli models report Auth - — the synthetic native-CLI auth (syntheticAuthRefs: ["claude-cli"], marker openclaw:claude-cli-native-auth) is not surfaced as a usable auth signal to the picker, while openai/* models show a stored OAuth profile.

    So the picker simultaneously (a) marks a provably working model unavailable with no reason shown, and (b) lets the user persist a model that cannot run. Expected behavior from the original report applies to both directions.

  2. clawsweeper commented on Aug 31, 2026

    @clawsweeper
    Contributor

    🦞⚠️
    Automatic implementation stopped before completion.
    Reason: The automatic implementation worker stopped before all deterministic gates completed. Open the workflow run for the exact blocker.
    Worker: https://github.com/openclaw/clawsweeper/actions/runs/33418786680

  3. added
    clawsweeper:fix-shape-clear
    clawsweeper:queueable-fix
    clawsweeper:source-repro
    impact:auth-provider
    impact:ux-friction
    issue-rating: 🦞 diamond lobster
    no-stale
    P1
    on Aug 31, 2026
  4. clawsweeper commented on Aug 31, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 31, 2026, 1:42 PM ET / 17:42 UTC.

    Summary
    Keep open: current main still accepts and persists a selected OpenAI route without checking whether its required harness is runnable, while the later run boundary fails on the missing registration. The reported 2026.8.1 behavior is also present in the released source.

    Reproducibility: yes. source-reproducible: current main accepts an allowed OpenAI model in sessions.patch, persists it under sticky scope, and only the later prepared run rejects the missing harness. The supplied 2026.8.1 report and released source match that path; this read-only review did not execute a local live setup.

    Maintainer decision needed

    Question Recommendation
    Should an unavailable Codex harness be handled by rejecting the picker selection with recovery guidance, or by adding an explicit consented setup flow before persistence? Reject and explain: Do not commit an unrunnable route and surface the official plugin and allowlist recovery steps in the picker or patch error.

    Why: The defect must be fixed, but initiating plugin installation and capability consent from a session-selection RPC is a separate UX and security boundary from rejecting an unrunnable selection.

    Next step
    The missing invariant is source-proven, but a maintainer must choose the explicit setup-versus-rejection interaction across the Gateway, plugin-control-plane, and Control UI boundaries.

    Review details

    Best possible solution:

    Publish and consume one prepared harness-readiness result before persistence, preserving the prior runnable selection and returning an actionable Codex-plugin/allowlist recovery path; keep installation and consent in the existing control-plane setup owner.

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

    Yes, source-reproducible: current main accepts an allowed OpenAI model in sessions.patch, persists it under sticky scope, and only the later prepared run rejects the missing harness. The supplied 2026.8.1 report and released source match that path; this read-only review did not execute a local live setup.

    Is this the best way to solve the issue?

    Yes for the invariant: readiness must be checked before persistence and the existing consented installer must not be called as an unprompted runtime shortcut. Maintainer direction is still needed on whether recovery is a rejection with guidance or an explicit setup flow.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • A selection-only guard that does not share the prepared harness-readiness fact could still leave the picker and recovery messaging inconsistent with the actual runnable state.

    Codex review notes: model internal, reasoning high; reviewed against a6e3ebd5b4f7.

    Label changes

    Label justifications:

    • P1: A normal picker action can save a model route that causes the next real agent turn to fail before inference.
    • impact:auth-provider: The failure is model-to-harness/plugin routing readiness, including the configured OpenAI authentication path.
    • impact:ux-friction: The picker currently permits an invalid choice and does not provide its recovery path at selection time.
    Evidence reviewed

    What I checked:

    • Current selection path validates membership, not readiness: The current-main resolver accepts a model when it is allowed by configuration/catalog membership; its status shape contains no runtime-readiness condition. The patch applier then persists the resolved model override. (src/gateway/sessions-patch.ts:95, a6e3ebd5b4f7)
    • Sticky persistence follows a successful patch without readiness setup: After a committed patch, the Gateway invokes sticky selection persistence; that owner resolves scope and writes the selected model without calling an installer or readiness helper. (src/gateway/server-methods/sessions-patch-model-selection.ts:20, a6e3ebd5b4f7)
    • Later run boundary rejects the unavailable harness: The prepared-run guard computes the effective harness and throws when the run-owned plugin registry lacks its registration, which is the failure reached after persistence. (src/agents/harness/runtime-plugin.ts:136, a6e3ebd5b4f7)
    • Existing supported setup flow is not reused by session patches: The reusable model-selection helper identifies eligible OpenAI routes, installs or enables the official Codex plugin with capability consent, and returns a failure before a persistent effect; onboarding calls it, but the session patch path does not. (src/commands/runtime-plugin-install.ts:135, a6e3ebd5b4f7)
    • Existing regression fixture demonstrates the missing invariant: The sticky-model test supplies an OpenAI catalog row under empty plugin metadata, accepts the patch, and asserts both the session override and sticky configured-default persistence; it has no harness-readiness assertion. (src/gateway/server-methods/sessions-mutations.sticky-model.test.ts:180, a6e3ebd5b4f7)
    • Shipped behavior and plugin requirement: The v2026.8.1 source contains the same sticky-persistence path. The Codex harness documentation requires the official plugin and, when applicable, inclusion in plugins.allow. Public docs: docs/plugins/codex-harness.md. (docs/plugins/codex-harness.md:100, ea806575e645)

    Likely related people:

    • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • Marvinthebored: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    How this review workflow works
    • 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.
  5. changed the title [-][Bug]: Model picker persists a model whose harness runtime cannot register, then strands the user — previous default renders as dead rows with no reason[/-] [+][Bug]: Model picker persists an OpenAI model without ensuring its required Codex harness can run[/+] on Aug 31, 2026
  6. goslingmanagment commented on Aug 31, 2026

    @goslingmanagment
    ContributorAuthor

    Clarification on the automated review: the picker does send a sessions.patch rather than editing the config directly, but the Gateway then calls persistSessionPatchModelSelection. With modelSelectionScope unset/effective in this live repro, that server-side sticky step did persist the configured default; the exact log is persisted sticky model selection agentId=main model=openai/gpt-5.6-sol target=defaults. The scope/legibility question is tracked separately in #134306 and is not required to reproduce this issue: even with session-only scope, the picker can still accept an unexecutable model because runtime readiness is not checked.

  7. added
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-product-decision
    clawsweeper:no-new-fix-pr
    and removed
    no-stale
    clawsweeper:fix-shape-clear
    clawsweeper:queueable-fix
    on Aug 31, 2026
  8. steipete commented on Sep 1, 2026

    @steipete
    Contributor

    Fixed by #134837, merged as 2e3cae2 and verified as an ancestor of current main.

    The shared session projection now rejects a model with no activatable harness before changing the session or publishing a sticky default. Actual isolated Gateway RPC proof covered an absent custom harness, disabled implicit Codex, and a v2026.7.1-2-shaped agent roster/provider configuration migrated with doctor --fix --non-interactive: both sessions.patch and sessions.create returned actionable INVALID_REQUEST; the previous model, label, and configuration stayed unchanged.

    The focused pair suite passed 118 cases, branch autoreview had no actionable P0–P2 findings, and exact-head CI run 33479490035 passed before the native prepare/merge wrapper landed it. Thanks @goslingmanagment for the report. Existing broken-config recovery remains tracked separately in #134304 / #134468.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1clawsweeper:needs-maintainer-reviewclawsweeper:needs-product-decisionclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:auth-providerimpact:ux-frictionissue-rating: 🦞 diamond lobster

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions