Repository navigation
fix: stop sending chats to OpenAI when no model is configured - #203271
Conversation
A config with no primary model silently resolved to openai/gpt-6-astra. Fresh installs planned OpenAI into model discovery, derived an OpenAI utility model, and ran turns against OpenAI without anyone choosing it. resolveDefaultModelForAgent now returns undefined when config names no model. Turns stop before any provider call with one actionable message; status, models status, and the startup log report the model as not configured. Doctor writes openai/gpt-6-astra as the primary only for installs that relied on the implicit default with OpenAI credentials. The plugin SDK DEFAULT_PROVIDER and runtime.agent.defaults are deprecated. Co-authored-by: obviyus <[email protected]>
|
🦞👀 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: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
…nsult test (follows openclaw#203271) Main no longer falls back to a compiled-in model when responseModel is unset, so the consult test now sets agents.defaults.model.primary like main's own consult tests.
… its delegates staged Upstream openclaw#203271 (stop sending chats to OpenAI when no model is configured) made resolveSessionModelRef return undefined when the agent has no model. The stage-5 merge took it cleanly, and sessions.compact's post-compaction delegate release still built its follow-up run from the result as a required model: tsgo failed at sessions-compact.ts:421 and :569. At run time the release threw a TypeError while building that run, so the delegates stayed staged behind a warning that named a property read. The release now refuses with upstream's NO_MODEL_CONFIGURED_MESSAGE, which names the next step, before it builds the run. The delegates stay staged for the next compaction, as on any other release failure. The new case runs the real maxLines handler with no configured model. On the merge commit 86d1bb9 it fails on the warning's reason; with this change the release is not attempted, the delegate stays staged, and the warning names the missing model. Refs openclaw#129388 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…quires Upstream openclaw#203271 (stop sending chats to OpenAI when no model is configured) made subagent spawn model selection refuse with NO_MODEL_CONFIGURED_MESSAGE where it used to fall back to the OpenAI default. Two fork fixtures configured no model and relied on that default: the launch-key Gateway suite (both cases threw the refusal) and the delegate dispatch-grant suite (six cases: the first spawn attempt threw, the claim was left unproven, and the next pass ended it as spawn-interrupted). Both now configure openai/gpt-6-astra, as upstream's own spawn fixtures do (withSpawnTestModel); no assertion changed. Refs openclaw#129388 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream openclaw#203271 made an embedded run with no configured model refuse with NO_MODEL_CONFIGURED_MESSAGE (resolveInitialEmbeddedRunModel) where it used to fall back to a default provider. The fork's overflow-recovery continuation cases replace the shared harness's config with one that carries only continuation settings, so all three threw before the attempt. They now configure anthropic/test-model, the model upstream's shared run harness configures to match its mocked default; no assertion changed. Green on Bun and Node 24. Refs openclaw#129388 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The stage-5 absorb lane finished at 42d46d7 (overflow-recovery run fixtures configure a model, openclaw#203271). Carried over by merge, not rebase. Refs openclaw#129388
…aw#203271) ## What Problem This Solves On a fresh install with no model chosen, OpenClaw silently behaves as if `openai/gpt-6-astra` were configured. The Models page shows "Couldn't load models from openai", the utility model shows `Auto · openai/gpt-6-luna`, and chat turns are sent to OpenAI even though the user never picked OpenAI or signed in to it. ## User Impact User impact: OpenClaw no longer picks a model for you. With no model configured, a chat turn replies "No model is configured. Choose one in Settings → Models, send `/model <provider/model>` in chat, or run `openclaw models set <provider/model>`." before any chat-model call. `/model <provider/model>` in chat still works. `openclaw models status` and the Gateway startup log say the model is not configured. The Models page no longer tries to load OpenAI, and no utility model is derived from a primary that does not exist. Existing installs keep working: on update from 2026.11.6 or earlier (config `meta.lastTouchedVersion`), `openclaw doctor --fix` writes the model the install was actually running as `agents.defaults.model.primary`: `openai/gpt-6-astra`, or the provider row the old release picked. This includes configs whose only provider row is a separated utility model, which the old release skipped in favor of OpenAI. The OpenAI model is written only when OpenAI credentials are available; without them those installs could not run anyway and now get the message above. Configs written by newer releases are left alone. Plugin SDK: `resolveDefaultModelForAgent` returns `undefined` when no model is configured. `DEFAULT_PROVIDER` and `runtime.agent.defaults` are deprecated under a new compatibility record and keep their values. Bundled plugins (Telegram, Discord, Slack, Mattermost, Codex, voice-call, llama.cpp, Skill Workshop) are migrated. ## Why This Change Was Made `resolveDefaultModelForAgent` filled a missing primary with the compiled-in `openai/gpt-6-astra`, so every reader (catalog planning, utility derivation, turn admission, status) treated it as the user's choice. The owner now returns "no model" and readers either describe it or fail the turn with one shared message. The core provider default remains only for qualifying a bare model id (for example a legacy `responseModel: "gpt-5.4-mini"`). Chat commands that need no model (`/help`, `/status`, `/models`, `/model`, `/new`) run normally with no model configured; `/status` reports the model as not configured. The reply pipeline now carries "no model" through command and directive handling, and only the agent turn itself (and model settings such as `/think` or `/fast`) gets the setup message. Fixes openclaw#203304. ## Evidence - Head `67d43f41`, fresh profile, real Gateway, `chat.send` with no model: `/verbose off` applies ("Verbose logging set for the current reply only"), `/queue` shows the current queue settings, and `/think high` and `hello` both get the setup message. Gateway log: `agent model: not configured`. - Fresh profile on this branch (no model, no credentials): Gateway log `agent model: not configured (...)`; `models.list` has no `openai` provider outcome and no refresh failure; `openclaw agent --message "say hi"` and a Control UI `chat.send` both return the setup message; no OpenAI request. - Before (same mechanism on base and on the published 2026.11.6): `models status` reports `openai/gpt-6-astra` with utility `openai/gpt-6-luna (provider-default)`; the Gateway log shows `agent model: openai/gpt-6-astra`; `models.list` reports `openai: unavailable`. - Upgrade from the published 2026.11.6 on a scratch profile whose config has no model: - with an OpenAI key in the environment, Doctor on this branch writes `openai/gpt-6-astra` as the primary; `models status` matches 2026.11.6; a chat turn runs against `openai/gpt-6-astra` (it fails only on the fake key with OpenAI's 401); - without OpenAI credentials, Doctor leaves config unchanged and `models status` reports no default model. - Doctor migration tests: writes the legacy model for 2026.11.6 configs (including OpenAI listed after another row, and a utility-only row), never without OpenAI credentials, over a configured primary, for a config from a newer release, or when runtime already selects the same provider row; model-selection tests now expect no model instead of `openai/gpt-5.4`; voice-call refuses to invent a response model. - No-model commands: `/help`, `/status` (shows "Model: not configured") and `/new` run through the real reply pipeline with no model, and a plain message gets the setup message without starting a model run. The new test fails on the previous head and passes here. - `/status` with no model no longer crashes in the catalog lookup (regression test fails on the previous head). - Forking a session with no model into a host-only harness still refuses when the creator requires a sandbox. - Typecheck (core, extensions, and their tests), oxlint, oxfmt, line-cap and mock-export ratchets, and the staged-content guard pass. The CI-failing test files and focused gateway, auto-reply, TUI and changed-plugin suites pass locally. <details><summary>Known local-only failures (unrelated, reproduce without this change's code paths)</summary> - `src/plugins/plugin-preparation-exec-argv.test.ts`: `FsSafeError: private Darwin creation requires native descriptor ACL inspection (helper-unavailable)` on this host. - `extensions/mattermost/src/mattermost/slash-http.boundary.test.ts`: binds `127.0.0.10+` loopback aliases that this macOS host does not have. - `src/agents/provider-request-header-redaction.test.ts`: failed once inside the full unit shard, passes alone (ordering). </details> ## Merge danger One-way door for config: Doctor writes a primary model into existing configs that relied on the implicit default (reverting the code leaves that explicit, equivalent setting in place). Two-way for runtime behavior. Blast radius: installs with no configured model and no Doctor run since update (they get the setup message instead of OpenAI), and third-party plugins that assumed `resolveDefaultModelForAgent` always returns a model (type change; they now receive `undefined`). ### Accepted edge case Attachment preprocessing (for example audio transcription through a media provider the install has credentials for) runs before the turn's model is resolved, so a model-less turn can still transcribe an attachment before replying with the setup message. I tried gating it on an early guess of the turn's model; review showed the guess is wrong for inherited thread models and per-channel models, and the only correct answer comes from the model resolution that runs later. Reordering preprocessing after model resolution is a larger change than this fix. The case needs no model and usable media credentials at once; installs upgraded from 2026.11.6 with OpenAI credentials get a model from the Doctor migration, so it is rare, visible, and costs one transcription. Docs say so. ### Review follow-ups in this head - An existing config with no recorded version stays eligible for the implicit-model migration across unrelated saves (it is stamped with the last implicit-model release); a brand-new file starts on the new rules. Regression test fails on the previous head. Co-authored-by: Ayaan Zaidi <[email protected]>
Since #203271 a chat with no configured model is refused before execution starts, so every cron failure-repair case failed with "Session event was not admitted". Set an explicit model in the two fixture configs; the authority outcomes stay as they were. Co-authored-by: Ayaan Zaidi <[email protected]>
`src/agents/tools/sessions-spawn-outcome.test.ts` passes again: its fixture config now names a model for the `main` agent. Part of #204008. ## Problem Since #203271 ("stop sending chats to OpenAI when no model is configured"), model selection throws `No model is configured…` when neither the agent nor defaults name a model. This fixture had `entries: { main: {} }`, so three spawn cases failed before dispatch (`expected "callInProcessGatewayTool" to be called once, but got 0 times`) in every scheduled `main` run (latest: 45147591436, `checks-node-compact-large-39`). ## Solution Set `entries.main.model` to `openai/gpt-4.1`, the same fixture change #204022 made for the cron failure-repair test. No product change. `openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts` has the same cause but is owned by open PR #203569, so it is left alone. ## Evidence - Scheduled `main` run 45147591436: 3 cases fail with the error above. - This branch, locally: `sessions-spawn-outcome.test.ts` 16/16 pass. Co-authored-by: Ayaan Zaidi <[email protected]>
## Problem Two suites are red on scheduled `main`: - `src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts` (checks-node-compact-large-13): 4 cases throw "No model is configured". Since #203271, a spawn refuses to start without a configured model, and these fixtures set none. - `src/flows/doctor-health.legacy-update.test.ts` (checks-node-compact-large-4): the legacy-update cases that replay a finished run had no run receipt, so they no longer match how a finished run is recorded. ## Fix - The lifecycle fixtures set a default model. - The doctor-health cases that replay a finished run claim a run receipt first, through the existing test support. - Imports sorted (format only). No product code changes. ## Impact Test-only. Restores checks-node-compact-large-4 and -13 on `main`. ## Evidence - Scheduled `main` runs 45165162201 and 45175216085: both jobs red on these files. - This head (6d68b45, on current `main`): CI run 45187939922 green. - Local ClawSweeper review on this head: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
…203176) ## Problem A requester that calls `sessions_yield` after spawning several completion-mode subagents was woken only when every member of the frozen yield batch was ready. A sibling that keeps running, or that pauses on its own `sessions_yield` while a background command runs, held every finished result back. Production incident (2026-11-21): a dashboard parent spawned 3 children and yielded at 16:20 IST. Two children finished at 16:26:58 and 16:29:41 with reports that needed a decision. The third kept cycling through exec-yield and resume. The Gateway log has no `announce:requester-settle:…` run for that parent. The parent ran again only at 18:32, when the user typed into the chat. A copy of the state database shows why: both finished rows were `terminal`/`ok` with `delivery.status: pending` and a pending `requesterSettleWake` (`batchRunIds` = all 3, `rearmGeneration: 1`). The third row was still `running`. The gate in `subagent-announce.requester-settle-wake.ts` returned `false` unless every frozen member passed `isRequesterSettleMemberReady`. #200967 had already made an exception for siblings that wait for a message. An exec-yielded or running sibling is the same bug class. ## Change Rule: every ready result wakes the yielded parent. Siblings that are still working keep their wake, with the same `rearmGeneration`, and wake the parent again when they finish. Each result is delivered once. - **Settle wake:** removed the all-or-nothing gate and the message-wait exception (`isEndedSubagentMessageWait` is deleted). The wake delivers the ready members of the frozen batch as one partition, and lists the members that are still working. A member whose partition has already started dispatch records its own batch, so a later partition never offers it again. When a partition holds only results that were already delivered and siblings are still pending, it settles without a redundant wake. - **Wake message:** a partition that leaves members pending no longer says "every subagent has settled… do not call sessions_yield again". It names the siblings that are still working (label, task name or run ID, at most 5, each truncated) and tells the parent: if the request needs those results, call `sessions_yield` to wait; otherwise act on the ready results without reporting the batch as finished. - **Lifecycle failure path:** `offeredBatch` now offers only ready members, so failure settlement can never consume the wake of a sibling that is still running or exec-yielded. - **Yield transfer:** when a child ended before the yield and a sibling is still running, `afterRelease` now schedules the settle for the finished child. Before, nothing woke the parent until the sibling ended. - **Followup owners** (`sessions_send` wait-for-reply, `agent-step`, nested `agent-run-subagent`): the caller is waiting for a single reply. Only the partition that leaves no member pending continues the followup. Earlier partitions wake the session as ordinary settle turns. `successor()` accepts that last partition as a subset of its cohort, so it no longer throws and records the result as a permanent failure. - **Automation authority:** a yield that carried cron-management authority keeps it for the partition that leaves no member pending. Earlier partitions run without borrowing it, and settling them shrinks the retained cohort instead of discarding the authority. - **Silent waits:** while siblings are still working, the parent may stay silent (`NO_REPLY`) and wait. Such a turn is not treated as a missing visible reply, so it is not retried. - **Goal return:** an earlier partition leaves the Goal cohort when it settles. The partition that settles the cohort last resumes the Goal once. - `isRequesterSettleMemberReady` moved to `subagent-run-liveness.ts`, its only owner, and replaces the deleted message-wait predicate. - Docs: `tools/subagents/announce.md` and `concepts/subagent-yield-handoff.md`. Product decisions, under the rules "no stranded user" and "no false done": - A stopped child is a settled outcome, so its report now wakes the parent right away instead of waiting for its siblings. - A followup caller gets one reply, after all results are in. The session itself is still woken for each result. ## Evidence **Regression test** (`subagent-registry.requester-wake.e2e.test.ts`, real registry, lifecycle, yield tool and wake entry point): spawn 2 children, yield, finish one, keep the other exec-yielded. The parent is woken with the finished result, and the wake names the working sibling. The sibling's continuation then wakes the parent again with only its own result. A sweep adds no third wake. A second case covers a child that ended before the yield, while the requester's turn held it. - Base `eb7ca3d33375`: both cases red (`expected [] to have a length of 1`: no wake). - Head: both cases green. **Owner tests:** cron authority (`requester-cron-authority.test.ts`: the early partition neither borrows nor consumes the authority, and the last partition is admitted with it), followup partition (`subagent-announce.requester-settle-followup.test.ts`: early partition runs with no followup successor, last partition carries it). Goal partition (`goal-continuation.test.ts`: early partition does not resume the Goal, last partition resumes it once). **Updated tests that asserted the all-at-once rule:** `requester-settle-cross-turn` (paused member), `subagent-control.worker` progress card (one wake per result; the card retires once), `requester-wake-settlement` (stopped child). **Real-Gateway E2E**, incident shape. Scratch `ocx src` Gateway under `env -i`, OpenAI `gpt-5.5` on the OpenClaw runtime. Parent spawns `alpha` (replies at once) and `beta` (`exec` with `background: true` running `sleep 90`, then `sessions_yield`), then yields. | | alpha ended | first parent wake | beta yielded | beta ended | second parent wake | |---|---|---|---|---|---| | base | 19:47:10 | **19:48:53** (one combined run, after beta) | 19:47:13 | 19:48:50 | none | | head | 19:40:08 | **19:40:11** (`announce:requester-settle:…:<alpha>:yield-1`) | 19:40:12 | 19:41:55 | 19:41:59 (`…:<beta>:yield-1`) | The parent's replies on head were `alpha: ALPHA-RESULT-7`, then `alpha: ALPHA-RESULT-7 / beta: BETA-RESULT-9`. The live Peanutto launchd pid and `openclaw.json` hash did not change. **Live sibling suites** (`subagent-yield-pause`, `subagent-followup-yield`, `subagent-yield-resume`, real OpenAI `gpt-5.5`): the same tests fail on base `eb7ca3d33375` and on this branch, with the same assertions (missing `completion.resultText` after a resumed or paused child completes, a Gateway shutdown timeout, an interim reply in the follow-up watch case; follow-up-yield failed 2 of 2 on base). One run of this branch showed a parent that wrote its final report as soon as the first result arrived; the wake message now says to keep waiting when the request needs the remaining results, and that failure no longer appears. The real-Gateway restart e2e files (`test/gateway-*-restart*.e2e.test.ts`) fail locally on base too (11 of 26 on base, 9 of 26 here, same assertions). **Gates:** `pnpm tsgo:core`, `pnpm check:test-types`, oxlint and oxfmt on the changed files. Every test file in `src/agents/subagents` and `goal-continuation.test.ts` was run across the unit-fast, infra, agents-support, spawn-boundary, core-isolated and e2e projects. Two infra tests failed once under host load and passed when run alone, on head and on base. ## Size Production code is +96 / −56. The gate, the message-wait exception and its predicate are deleted. The added lines are the partition support the old gate did not need: pending members in the message, the followup last-partition rule, Goal cohort shrink, and pre-yield scheduling, and cron-authority cohort shrink. A census of `batchRunIds`, `requesterYieldBatch`, the frozen branch and `selectConnectedSettledSubagentWave` found every remaining reader still in use. v8 coverage could not attribute lines under the compiled-worker test runner (0 files collected in two attempts), so the census was done by reading the code. ## Accepted edge cases - If a Goal cohort's last partition is rejected for an unrelated reason (for example, a rearm-generation mismatch), the Goal return stays retained until Stop or a lifecycle rotation. That is the same outcome as a failed final delivery today. - A nested requester whose early partition answers without yielding reports that answer to its parent. The later result wakes it again as a separate completion. ## Merge danger - **Two-way door.** No schema, stored-row or config change: the wake rows keep their existing fields and generation. A revert restores the all-at-once wake for every cohort, including rows written while this change ran. - **Blast radius:** requesters that yield on two or more completion children (dashboard, chat and nested subagent requesters). A defect here would show as an extra or a missing wake for the parent, not as a lost child result: every result stays saved in its child session. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 09d956b) Release adaptation: Kept stable QA Gateway fixture lifecycle; filtered intentionally silent partial-result wakes. Companion audit: #203222 selected. #204249, #204069, #204048, #203892, #202513, #198960 not applicable (refactors/test cleanup); #204260, #204178, #204098, #204089, #203839, #203271 missing in lane and not prerequisites. Co-authored-by: RomneyDa <[email protected]>
…es (#203241) * fix(gateway): shutdown never first-imports chunks an in-place update replaced * test(gateway): guard built shutdown against late first-imports * fix(gateway): keep broker close functions visible to dead-export scan * fix(process): supervisor shutdown warnings never first-import their logger; guard tracks pre-signal modules * test(ci): watch supervisor shutdown owners for the late-import guard * test(gateway): readable late-import entry parsing * test(gateway): stop the guard Gateway after startup maintenance settles * test(gateway): guard only hashed dist chunks that a swap removes * test(gateway): skip the SIGTERM guard where taskkill stops the Gateway * fix(gateway): prime supervisor shutdown logger from the shutdown runtime; add restart worker to PR wrapper inventory * fix(memory-core): own the manager runtime loader in a leaf module so closing never loads the provider * fix(state): agent lease cleanup handler loads with the state worker; guard stop budget and watch paths * fix(cron): claimed runs load their finalization before shutdown can need it; watch memory loader owners * fix(cron): scheduled runs also load finalization with their scheduler (cherry picked from commit 78a6ca1) Release adaptation: Preserve the stable cron dispatch preamble and command set, without main-only cron.importLegacyMemberSources; scheduler and queue still prepare finalization together. The shutdown-runtime overlap is supplied by the preceding #203185 backport. Companions: #203185 selected and applied first. #203839 replaces test process ownership separately and is not required for this guard: the stable fixture supports the same child, entrypoint and stop APIs. #203790, #202507, #202495 startup/resource changes, #201024 cgroup sizing, #197395 cron backoff, and #204210/#203458/#203271 wrapper-only overlaps are not dependencies. Co-authored-by: RomneyDa <[email protected]>
…#204022) Since openclaw#203271 a chat with no configured model is refused before execution starts, so every cron failure-repair case failed with "Session event was not admitted". Set an explicit model in the two fixture configs; the authority outcomes stay as they were. Co-authored-by: Ayaan Zaidi <[email protected]>
…aw#204033) `src/agents/tools/sessions-spawn-outcome.test.ts` passes again: its fixture config now names a model for the `main` agent. Part of openclaw#204008. ## Problem Since openclaw#203271 ("stop sending chats to OpenAI when no model is configured"), model selection throws `No model is configured…` when neither the agent nor defaults name a model. This fixture had `entries: { main: {} }`, so three spawn cases failed before dispatch (`expected "callInProcessGatewayTool" to be called once, but got 0 times`) in every scheduled `main` run (latest: 45147591436, `checks-node-compact-large-39`). ## Solution Set `entries.main.model` to `openai/gpt-4.1`, the same fixture change openclaw#204022 made for the cron failure-repair test. No product change. `openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts` has the same cause but is owned by open PR openclaw#203569, so it is left alone. ## Evidence - Scheduled `main` run 45147591436: 3 cases fail with the error above. - This branch, locally: `sessions-spawn-outcome.test.ts` 16/16 pass. Co-authored-by: Ayaan Zaidi <[email protected]>
## Problem Two suites are red on scheduled `main`: - `src/agents/openclaw-tools.subagents.sessions-spawn.lifecycle.test.ts` (checks-node-compact-large-13): 4 cases throw "No model is configured". Since openclaw#203271, a spawn refuses to start without a configured model, and these fixtures set none. - `src/flows/doctor-health.legacy-update.test.ts` (checks-node-compact-large-4): the legacy-update cases that replay a finished run had no run receipt, so they no longer match how a finished run is recorded. ## Fix - The lifecycle fixtures set a default model. - The doctor-health cases that replay a finished run claim a run receipt first, through the existing test support. - Imports sorted (format only). No product code changes. ## Impact Test-only. Restores checks-node-compact-large-4 and -13 on `main`. ## Evidence - Scheduled `main` runs 45165162201 and 45175216085: both jobs red on these files. - This head (6d68b45, on current `main`): CI run 45187939922 green. - Local ClawSweeper review on this head: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
Plugin session forks (`runForkedTurn`, `forkSession`; for example Better Prompt and Skill Workshop reviews) always ran on the built-in runtime. On a Claude CLI chat signed in with a Claude subscription:
- With only the CLI's own `claude` login, `runForkedTurn` failed with `No API key found for provider "claude-cli"`.
- With a Claude subscription token stored in OpenClaw, `runForkedTurn` sent the token to the Anthropic API directly, which bills metered extra usage instead of the plan (`cliBackendDispatch` notes in `run/params.ts`).
- `forkSession` refused every CLI runtime: `Session forks are not supported for CLI runtime claude-cli.`
OpenClaw already has one owner for "run this embedded run on the subscription CLI": `cliBackendDispatch: "subscription-auth"` (Active Memory's recall uses it). The fork owner opts into it; no new path:
- `runSessionFork` sets `cliBackendDispatch: "subscription-auth"`. Eligibility is unchanged: subscription (oauth/token) or unresolvable credentials go to the CLI; API keys keep the request replay and its prompt cache.
- Dispatch accepts the fork's in-memory conversation (`sessionManager`), and sends the CLI only the tools that may execute (`toolExecutionAllow`; an empty list is a tool-free run).
- Dispatch now picks the CLI account the way a new CLI session does. Before, it passed only an explicit pin, so a stored Claude token never reached the CLI (`Not logged in · Please run /login`); Active Memory recalls had the same gap.
- Runs that grant the plugin's own tools or set `maxTokens` keep the direct route: neither reaches a CLI process.
- Dispatch carries the run's policy facts to the CLI: a run under another session's policy (a fork's `sandboxSessionKey`) passes that session's entry, the requester fields and `internal_system` provenance into the CLI's Gateway tool grant, so restricted-sender limits apply to the fork as to the chat's own turns.
Accepted: a CLI fork starts a fresh CLI session with the conversation as context, so it does not reuse the chat's cache, and each fork leaves one Claude session file under `~/.claude/projects`, as Active Memory's CLI recalls already do. The source chat's native session is never resumed or written.
Permission modes (maintainer decision, now in `docs/gateway/permission-modes.md`): the `sessionRoot` boundary is enforced on the built-in runtime; CLI-backed chats use the CLI's own controls, and owner turns' Gateway tools are not limited to `sessionRoot`. Live, on a Claude CLI chat in `workspace` mode, an ordinary turn and a fork both read a file outside the workspace through `mcp__openclaw__read`, and the same chat on the built-in runtime refuses both with `Path escapes sandbox root`. A CLI fork therefore has the same file access as the chat's own CLI turns.
Not covered: Gemini CLI on a Google login (OpenClaw cannot limit its tools under OAuth), and harnesses that own their login with no limited one-shot turn (Copilot, Muse, `acp-*`).
Real product, tier source (`ocx src`), isolated foreground Gateway, no API key in the environment or auth store; profiles: Claude subscription setup token, ChatGPT OAuth, Grok OAuth. Each chat: one turn ("Remember PELICAN-42"), then forks through a probe plugin.
| Route | `runForkedTurn` `[read, ls]` | `forkSession` | `runForkedTurn` cache read |
|---|---|---|---|
| `claude-cli`, Claude token | `PELICAN-42 \| FORK-READ-OK 7f3a` (dispatched to Claude CLI) | `PELICAN-42` | 6,985 |
| ChatGPT OAuth, built-in | `PELICAN-42 \| FORK-READ-OK 7f3a` | `PELICAN-42` (cache read 9,856) | 10,112 |
| Codex app-server | `PELICAN-42 \| FORK-READ-OK 7f3a` | `PELICAN-42` (19,584) | 8,704 |
| Grok OAuth | `PELICAN-42 \| FORK-READ-OK 7f3a` | `PELICAN-42` (1,152) | 1,152 |
- `main` on the same Claude chat: `runForkedTurn` ran on the Anthropic API with the token (cache read 0, cache write 23,872), `forkSession` refused.
- Every route: source transcript hash, message count and native binding unchanged; the Claude source session file holds only the chat's own turn.
- Better Prompt 0.2.2 (`start` → `take` through `plugins.sessionAction`) produced an improved prompt on the Claude CLI chat and on the ChatGPT chat.
- Dispatch tests: a fork runs on the CLI with only its own tools from its in-memory session; plugin tool grants and output caps keep the passthrough.
Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit b7bf937)
Release adaptation: retain staged Gateway permission-mode documentation and enforcement; omit the superseded upstream documentation exception.
Companions: #202941 and #202646 are present-equivalent (9ec8d08 and 087c816); #201554 is staged as 5647120. #202957 is not applicable (reverts a separate native-tools path). #204219, #203999, #203901, #203919, #203601 and #203271 are independent prewarm, lifecycle, recovery, review or default-routing changes; not required for the selected fork path.
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 8a592a33b7866a1306c60468e4aaf2c9fb23a93f)
…del route On main 00a9cbf, 2 of the 3 cases failed: the fixture bound the delegated handoff to DEFAULT_MODEL, which openclaw#203271 (265577c) removed, so consumeSubagentCompletionToolHandoff returned nothing and the requester turn ran with disableTools: true. The handoff is now bound to the fixture's configured primary (openai/gpt-5.5), and the retention case asserts the embedded run carries that route. createAgentRunModelSelectionHandler lost lifecycleStorePath and activeSessionAgentId in openclaw#199529 (e6265d6), which the agents-root test typecheck reported as TS2353; the fixture passes the same fields as production's call in agent-run-execution-phase.ts.
Release backports #203271 and #206477 made the old no-model one-shot turn ineligible to seed starter files. Exercise the installed agent creation path without a provider instead, still requiring all five files and now requiring a successful CLI exit. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
On a fresh install with no model chosen, OpenClaw silently behaves as if
openai/gpt-6-astrawere configured. The Models page shows "Couldn't load models from openai", the utility model showsAuto · openai/gpt-6-luna, and chat turns are sent to OpenAI even though the user never picked OpenAI or signed in to it.User Impact
User impact: OpenClaw no longer picks a model for you. With no model configured, a chat turn replies "No model is configured. Choose one in Settings → Models, send
/model <provider/model>in chat, or runopenclaw models set <provider/model>." before any chat-model call./model <provider/model>in chat still works.openclaw models statusand the Gateway startup log say the model is not configured. The Models page no longer tries to load OpenAI, and no utility model is derived from a primary that does not exist.Existing installs keep working: on update from 2026.11.6 or earlier (config
meta.lastTouchedVersion),openclaw doctor --fixwrites the model the install was actually running asagents.defaults.model.primary:openai/gpt-6-astra, or the provider row the old release picked. This includes configs whose only provider row is a separated utility model, which the old release skipped in favor of OpenAI. The OpenAI model is written only when OpenAI credentials are available; without them those installs could not run anyway and now get the message above. Configs written by newer releases are left alone.Plugin SDK:
resolveDefaultModelForAgentreturnsundefinedwhen no model is configured.DEFAULT_PROVIDERandruntime.agent.defaultsare deprecated under a new compatibility record and keep their values. Bundled plugins (Telegram, Discord, Slack, Mattermost, Codex, voice-call, llama.cpp, Skill Workshop) are migrated.Why This Change Was Made
resolveDefaultModelForAgentfilled a missing primary with the compiled-inopenai/gpt-6-astra, so every reader (catalog planning, utility derivation, turn admission, status) treated it as the user's choice. The owner now returns "no model" and readers either describe it or fail the turn with one shared message. The core provider default remains only for qualifying a bare model id (for example a legacyresponseModel: "gpt-5.4-mini").Chat commands that need no model (
/help,/status,/models,/model,/new) run normally with no model configured;/statusreports the model as not configured. The reply pipeline now carries "no model" through command and directive handling, and only the agent turn itself (and model settings such as/thinkor/fast) gets the setup message. Fixes #203304.Evidence
67d43f41, fresh profile, real Gateway,chat.sendwith no model:/verbose offapplies ("Verbose logging set for the current reply only"),/queueshows the current queue settings, and/think highandhelloboth get the setup message. Gateway log:agent model: not configured.agent model: not configured (...);models.listhas noopenaiprovider outcome and no refresh failure;openclaw agent --message "say hi"and a Control UIchat.sendboth return the setup message; no OpenAI request.models statusreportsopenai/gpt-6-astrawith utilityopenai/gpt-6-luna (provider-default); the Gateway log showsagent model: openai/gpt-6-astra;models.listreportsopenai: unavailable.openai/gpt-6-astraas the primary;models statusmatches 2026.11.6; a chat turn runs againstopenai/gpt-6-astra(it fails only on the fake key with OpenAI's 401);models statusreports no default model.openai/gpt-5.4; voice-call refuses to invent a response model./help,/status(shows "Model: not configured") and/newrun through the real reply pipeline with no model, and a plain message gets the setup message without starting a model run. The new test fails on the previous head and passes here./statuswith no model no longer crashes in the catalog lookup (regression test fails on the previous head).Known local-only failures (unrelated, reproduce without this change's code paths)
src/plugins/plugin-preparation-exec-argv.test.ts:FsSafeError: private Darwin creation requires native descriptor ACL inspection (helper-unavailable)on this host.extensions/mattermost/src/mattermost/slash-http.boundary.test.ts: binds127.0.0.10+loopback aliases that this macOS host does not have.src/agents/provider-request-header-redaction.test.ts: failed once inside the full unit shard, passes alone (ordering).Merge danger
One-way door for config: Doctor writes a primary model into existing configs that relied on the implicit default (reverting the code leaves that explicit, equivalent setting in place). Two-way for runtime behavior. Blast radius: installs with no configured model and no Doctor run since update (they get the setup message instead of OpenAI), and third-party plugins that assumed
resolveDefaultModelForAgentalways returns a model (type change; they now receiveundefined).Accepted edge case
Attachment preprocessing (for example audio transcription through a media provider the install has credentials for) runs before the turn's model is resolved, so a model-less turn can still transcribe an attachment before replying with the setup message. I tried gating it on an early guess of the turn's model; review showed the guess is wrong for inherited thread models and per-channel models, and the only correct answer comes from the model resolution that runs later. Reordering preprocessing after model resolution is a larger change than this fix. The case needs no model and usable media credentials at once; installs upgraded from 2026.11.6 with OpenAI credentials get a model from the Doctor migration, so it is rare, visible, and costs one transcription. Docs say so.
Review follow-ups in this head