Skip to content

Model Setup 'Test & use' fails on configless gateways: prepared model runtime owner was not committed after replacement #111520

Description

@steipete

Summary

On a gateway with no explicit model configured (model resolved from a provider env key, e.g. OPENAI_API_KEYopenai/gpt-5.6-sol), the Control UI first-run Model Setup → "Test & use" flow fails deterministically with:

Connection failed: prepared model runtime owner was not committed after replacement for /home/openclaw/.openclaw/agents/main/agent

Because activation never commits, openclaw.setup.detect keeps returning setupComplete: false, so every operator-admin device is permanently bounced to /settings/model-setup?firstRun=1 from the default chat landing. On a multi-user trusted-proxy gateway this locks all admins out of the chat UI.

Where it throws

rebindInputToCommittedConfiguredOwner (src/agents/prepared-model-runtime.owner.ts:101) requires exactly one committed owner with provenance === "configured":

Repro

  1. Gateway with agents.defaults.model unset and models unset in openclaw.json; provider key present via env (OPENAI_API_KEY).
  2. Open the Control UI as an operator admin on the default chat landing → redirected to Model Setup (firstRun=1).
  3. Click "Test & use" on the detected key → error above; setup never completes; redirect loop persists.

Workaround (verified)

openclaw models set openai/gpt-5.6-sol on the gateway host (writes the explicit default into openclaw.json) + gateway restart. setup.detect then reports complete and the takeover disappears for all devices.

Environment

  • main @ b369c32e (also reproduced on e6d7aee), Linux gateway, trusted-proxy auth, single main agent at /home/openclaw/.openclaw/agents/main/agent.
  • Gateway log at the failure shows the openclaw.setup.activate request completing but the prepared-runtime rebind rejecting with the error above.

Side observation

While debugging, the gateway logs show a steady 5s-interval spam of question.list responses failing with FORBIDDEN missing scope: operator.questions from a connected Control UI client — likely a UI poller not gating on granted scopes. Filing here as a footnote since it surfaced in the same logs; can split into its own issue if preferred.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.maintainerMaintainer-authored PR

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions