Skip to content

[Bug]: Project-parent sessions_spawn fails model validation while models.list reports available models (2026.10.6) #182467

Open

Description

@resinoftree97

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

In existing project-parent sessions, sessions_spawn rejected DeepSeek or native Haiku during model validation, although the preserved Gateway model-list projection reported those models available; the same logical session later spawned working Children after text /reset

Steps to reproduce

Historical operator-reported steps, supported by the attached selected records (not rerun for this report):

  1. Use an installation where DeepSeek and native Haiku routes already work from a normal session.
  2. Open a session attached to a registered non-worktree project outside the agent workspace.
  3. Ask Main to invoke sessions_spawn explicitly with deepseek/deepseek-flash or anthropic/claude-haiku-4-5.
  4. Observe the preflight errors below.

Control: the existing SESSION-A history has failures at 13:57 KST, text /reset at 13:59 KST, then an accepted DeepSeek Child at 14:01 KST and later DeepSeek/Haiku assistant output. Project detachment at reset is operator-reported; no before/after project metadata snapshots were recovered. Do not treat /reset as the proposed fix. A clean-stock minimal configuration was not independently reproduced.

Expected behavior

A model that works in a normal session should remain usable for Child validation when its parent is project-attached, without changing the project execution directory. The attached historical after-reset successes and related upstream inventory contract provide the control.

Actual behavior

Two distinct historical errors were observed before Child execution:

sessions_spawn model "deepseek/deepseek-flash" is not usable: Unknown model: deepseek/deepseek-flash. Found agents.defaults.models["deepseek/deepseek-flash"], but no matching models.providers["deepseek"].models[] entry. Add { "id": "deepseek-flash", "name": "deepseek-flash" } to models.providers["deepseek"].models[] to register this provider model. For custom or proxy providers, also set api and baseUrl so requests route to the intended endpoint. See https://docs.openclaw.ai/concepts/model-providers.
sessions_spawn model "anthropic/claude-haiku-4-5" is not usable: The selected account or native runtime is unavailable for anthropic/claude-haiku-4-5. Restore that account before spawning this model.

The native-runtime wording is an admission result, not evidence that the real credential expired. DeepSeek fails model resolution; Haiku fails availability evaluation inside the same outer preflight. These are not claimed to be identical inner failures.

OpenClaw version

2026.10.6 (fe06181dc5ecc01cf8904abbfc26925925efefbc), build 2026-10-22T08:54:27.830Z.

Operating system

Windows 10 Pro 22H2 (OS Build 19045.7725), WSL2

Install method

global-layout Node package in the managed Node v24.22.1 toolchain. Original installation command: NOT_ENOUGH_INFO.

Model

Main observed: openai/gpt-6.1-sol and claude-cli/claude-sonnet-5-5. Child failures: deepseek/deepseek-flash, deepseek/deepseek-v4-pro; Haiku case: anthropic/claude-haiku-4-5 (not Haiku 5.5).

Provider / routing chain

Gateway sessions_spawn -> resolveSubagentModelAndThinkingPlan -> prepareModelChoice -> prepared catalog owner/model/runtime evaluation. DeepSeek uses the installed global provider plugin; Haiku uses logical anthropic routing to the native claude-cli runtime. The rejected calls did not reach Child inference.

Additional provider/model setup details

DeepSeek plugin manifest: enabled, global registration, activation.onStartup=false, providerCatalogEntry=./dist/provider-discovery.js, modelCatalog present. Earlier investigation recorded an empty inline deepseek model list; credentials and full config are intentionally not attached. A local project creation/recording maintenance plugin is installed but was not disabled; no clean-stock comparison is claimed. Project roots and session identifiers are aliased.

Logs

See `01-child-spawn-evidence.zip`: `logs/child-failures.jsonl`, `logs/child-accepted.jsonl`, `logs/child-execution-identities.jsonl`, and `comparison/timeline.csv`. All event times use the original record timestamp, also rendered as KST. Only selected fields are exported; errors are verbatim.

The preserved models.list projection has 35 rows in agent-default, normal-session and project-session scopes: OpenAI 8, Anthropic 14, Claude CLI 11, DeepSeek 2. Selected DeepSeek and Haiku rows show available=true. It was collected later than the failures. The full raw 35-row response was not retained, and this RPC is not the Child validator owner.

Screenshots, recordings, and evidence

01-child-spawn-evidence.zip

Impact and severity

Affected: the reporter's project-parent workflow on this installation. Severity: blocks Child delegation while preserving project membership. Operator reports multiple projects and both Main routes affected. The attachment is a selected evidence set, not a complete failure-rate sample; population-wide frequency is NOT_ENOUGH_INFO.

Additional information

Related: #169205 and #169539. The installed commit is not a descendant of merge 52885d96ffef88db68c56cb772840d23dcfaf150; the installed lease code lacks inventoryInput. The upstream issue is analogous, not identical (it reported Main ingress failures). The PR repairs shared run leases; it does not directly cover sessions_spawn preflight.

Source-level candidate, NOT observed failure-owner state: project workspace owner lookup can miss a compatible published owner and fall back to a readOnly ephemeral build without runtime plugin facts. Owner keys also distinguish readOnly mode. Inspect src/agents/prepared-model-catalog.ts owner selection and src/agents/model-runtime-choice.ts::prepareModelChoice, in addition to the lease fix. Preserve agent/auth/environment/generation isolation and execution cwd. No manual global-model-registration workaround is requested.

No Child/reset/restart/test or Core/config/DB/session mutation was performed to prepare this package. No failing-owner snapshot, clean-stock reproduction, or proof of a proposed patch is claimed. Last-known-good version: NOT_ENOUGH_INFO.

Activity

  1. added
    bug
    on Oct 24, 2026
  2. added
    bug:behavior
    on Oct 24, 2026
  3. added
    clawsweeper:intake:bug
    P2
    clawsweeper:needs-live-repro
    clawsweeper:needs-maintainer-review
    clawsweeper:no-new-fix-pr
    impact:auth-provider
    issue-rating: 🐚 platinum hermit
    and removed
    clawsweeper:intake:bug
    on Oct 24, 2026
  4. clawsweeper commented on Oct 24, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep this issue open: current main retains the workspace-sensitive preflight mismatch, released-installation reports establish user impact, and the explicitly closing PR remains draft and unmerged.

    Reproducibility: Current source establishes the explicit-workspace owner miss and ephemeral fallback; VQuesada and resinoftree97 supply released-installation observations, but this read-only review ran no Gateway or tests and does not claim a current-main live reproduction.

    Root-cause cluster
    Relationship: canonical
    Canonical: #182467
    Summary: This issue tracks the remaining read-only child-preflight mismatch; its open fixing PR owns the repair, while the earlier merged change addressed adjacent run admission.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Next step
    Resolve standalone-isolation coverage and establish a failing owner-selection regression plus successful Gateway child execution on the updated #183761 before merging its fix.

    Review details

    Best possible solution:

    Use compatible configured Gateway inventory for child preflight while preserving execution cwd, authentication identity, generation ownership, and standalone workspace isolation.

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

    Current source establishes the explicit-workspace owner miss and ephemeral fallback; VQuesada and resinoftree97 supply released-installation observations, but this read-only review ran no Gateway or tests and does not claim a current-main live reproduction.

    Is this the best way to solve the issue?

    Correcting inventory selection fits the documented Gateway contract, but the proposed fallback needs real owner-publication regressions and standalone-isolation coverage before its exact implementation can be accepted.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The successful reporter trial includes an additional correction and does not validate the exact open PR head; hosted trials did not reproduce the failing baseline.
    • Configured-owner reuse must preserve standalone workspace isolation, including lifecycle transitions and workspace-less publications.

    Codex review notes: model internal, reasoning medium; reviewed against 56b15bda91b8.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P2: The established failure blocks delegation for particular workspace and provider combinations, with limited demonstrated reach.
    • impact:auth-provider: Preflight can reject usable provider models because it selects catalog and native-authentication facts from the wrong runtime context.
    Evidence reviewed

    What I checked:

    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; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 8, 2026, 5:32 AM ET / 10:32 UTC.

  5. resinoftree97 commented on Oct 25, 2026

    @resinoftree97
    Author

    182467-owner-repro-evidence.zip

    Follow-up: isolated owner-selection observation on current main (observation only, no fix proposed)

    I am stopping further experiments on this issue here. This comment records what one self-written, Gateway-less test harness observed on upstream main, what it does not establish, and what I think needs to be verified next by someone who can run the real Gateway. All numbers and quotes below come from the attached evidence package; nothing was re-run to write this comment.

    Attachment: 182467-owner-repro-evidence.zip (README, harness source, full vitest log, per-case JSON, derived key-evidence file, SHA256SUMS).
    ZIP SHA-256: 62b8524881fd12f82c22e31eaf823819a9e721f7c44980ddc9aa37d69303c764

    Scope of the test (please read before the results)

    • Tested commit: f20e7dbea8fc33024ca4cacc9c103188bf6e17bc (upstream main, 2026-10-24, perf(control-ui): remove a transcript readiness round trip #182846). Not the installed 2026.10.6 (fe06181) from the original report.
    • Harness: one vitest file I wrote (zz-owner-observation.test.ts), run on a throwaway HOME/state dir/workspace. No Gateway process, no RPC, no real sessions_spawn tool call. It publishes owners by calling refreshPreparedModelRuntimeSnapshots with the same options as src/gateway/server-startup-model-runtime.ts, uses a local test plugin (ocverify) whose resolveDynamicModel hook resolves only one model, has no models.providers, and uses dummy credentials. It is not the real DeepSeek plugin, not a real DeepSeek/Anthropic/Haiku authenticated setup, and not the reporter's configuration.
    • The harness asserts nothing about the outcome (it records events and ends with expect(true).toBe(true)), so "1 test passed" in the log is not a verdict.

    Confirmed by this experiment (observed in the fixture on main)

    Calls made per case: withPreparedModelCatalogOwner({ agentId: "main", workspaceDir, readOnly: true }), then prepareModelChoice(...) and resolveSubagentModelAndThinkingPlan(...) for (1) a model that only the plugin's resolveDynamicModel hook can resolve and (2) a control model nothing can resolve. Published (configured) owner workspace = W.

    case workspaceDir passed owner found? plugin registry in snapshot used hook calls (choice / plan) hook-only model
    A undefined yes (published owner lease) ["ocverify"] 1 / 1 resolved, plan ok
    B W (explicit string) yes ["ocverify"] 1 / 1 resolved, plan ok
    C W/sub-project no [] 0 / 0 Unknown model
    D a directory outside W no [] 0 / 0 Unknown model
    E (x4) outside / subfolder, with an emulated agent-run admission lease held (with and without generation scope) no [] 0 / 0 Unknown model
    1. Owner search failure. For C, D and all E variants, getPreparedModelRuntimeSnapshot returned undefined (both readOnly variants) and acquirePreparedModelRuntimeSnapshot threw prepared model runtime owner was not published for <agentDir>. (6 of 8 case records; evidence class counts are in derived/key-evidence.md.)
    2. Ephemeral fallback. In those cases the code continued into acquireReadOnlyPreparedModelRuntime. The resulting snapshot had metadataPluginIds: ["ocverify"] but pluginRegistryPluginIds: [].
    3. Plugin hook not invoked. In those cases the fixture plugin's resolveDynamicModel was never called (0 calls in both prepareModelChoice and resolveSubagentModelAndThinkingPlan). In A and B it was called once in each.
    4. Unknown model produced. In those cases prepareModelChoice returned Unknown model: ocverify/dynamic-only-model. Run \openclaw models list --refresh --provider ocverify` ...andresolveSubagentModelAndThinkingPlanreturnedsessions_spawn model "ocverify/dynamic-only-model" is not usable: Unknown model: .... The control model is Unknown model` in every case, as intended.
    5. Subfolder vs. outside made no difference. C and D behaved identically. In this run the only distinguishing input was whether the workspaceDir string equalled the published owner's workspace (B) or was absent (A). Reading the source at this commit, resolvePublishedOwner (src/agents/prepared-model-runtime.owner.ts, ~l.349-390) first does an exact owner-key lookup and only falls back to the configured owner when workspaceDir, agentId or runtimePluginSelections is undefined (~l.399-403), and that fallback also compares workspaceDir for equality.
    6. Admission-style lease did not change the read-only lookup (emulated). In E, acquireAgentRunPreparedModelRuntime for the project directory succeeded and its snapshot had ["ocverify"] in the plugin registry, yet the subsequent read-only owner/model lookups still took the fallback path.

    Not confirmed (still unknown)

    • That this is the cause of the reporter's failures. The mechanism above was observed in a fixture. I have no failing-owner snapshot from the reporter's Gateway.
    • The DeepSeek path as reported. The real DeepSeek plugin (activation.onStartup=false, global registration, empty inline model list) was not loaded. The error text in the issue (Found agents.defaults.models[...], but no matching models.providers[...]) was not produced; the harness message is the generic one quoted above.
    • The Haiku / claude-cli "selected account or native runtime is unavailable" path. Not exercised at all.
    • Behavior on 2026.10.6. Only main was tested; the issue already notes the installed commit is not a descendant of merge 52885d96, so the code may differ.
    • Real Gateway behavior. Whether a real Gateway publishes owners with the same workspace string, readOnly flags and plugin selections as the replicated startup call; whether a real project-parent session passes a workspaceDir equal to the project root into resolveSubagentModelAndThinkingPlan/prepareModelChoice; case E emulates admission by calling exported functions rather than running agent-run-admission-phase.ts.
    • Whether the fallback is intended. I make no claim about design intent.
    • Existing repo tests. I tried to run three existing tests (model-runtime-choice.test.ts, model-runtime-choice.native.test.ts, prepared-model-catalog.test.ts) through the standard runner on an 8 GB host; they printed only "still running with no output" and I killed them. There is no pass/fail data from them.
    • Catalog discovery in the harness. OBS_DISCOVERY (printed right after two explicit refreshes) showed zero provider rows and zero endpoint hits, yet the later owner summaries for A and B list one catalog entry (discovered-only-model, the model the fixture endpoint advertises) while C, D and E list none. I did not log when that entry appeared and cannot say whether provider discovery ran. Please treat this as unexplained.
    • Unrelated host note. The machine was under memory pressure while I tried the standard runner; it is recorded in the package only for completeness and is not evidence about the bug.

    Suggested next verification (for maintainers)

    1. Run the three existing tests above on a machine that can finish them, and check whether any of them already covers a readOnly: true owner lookup with an explicit workspaceDir that differs from the published owner's workspace.
    2. On a real Gateway in a clean state dir (mock or maintainer-owned provider credentials), call sessions_spawn from a session attached to a project whose root is outside the agent workspace, and log (a) the workspaceDir that reaches resolveSubagentModelAndThinkingPlan/prepareModelChoice, (b) the owner keys that are published, and (c) which key the read-only lookup uses. This would show whether the fixture's condition occurs in production.
    3. Use a provider that resolves a model only through resolveDynamicModel (or the real DeepSeek plugin with an empty models.providers.deepseek.models) for step 2, and repeat on 2026.10.6 and current main to see whether the behavior differs between them.
    4. Exercise the claude-cli native-runtime availability branch of prepareModelChoice separately with a project workspaceDir; this package says nothing about it.
    5. Decide whether the read-only ephemeral fallback (empty plugin registry) is intended for explicit workspace directories that have no published owner, and whether models.list and the sessions_spawn validator are expected to agree for such directories.

    To re-check my reading without running anything: unzip the archive, run sha256sum -c SHA256SUMS, then see README.md (sections 4-7) and derived/key-evidence.md. The file derived/key-evidence.md can be regenerated from the log and JSON with python3 tools/derive-key-evidence.py.

    Sanitization: the host's home path and Node install path were replaced with placeholders in two files (hashes in SANITIZATION.md); the log, JSON and memory-sample files are byte-identical to the originals. The test source contains two dummy fixture values (issue-182467-observation-token, fixture-key) that are not real credentials.

  6. resinoftree97 commented on Oct 25, 2026

    @resinoftree97
    Author

    @clawsweeper re-review

  7. clawsweeper commented on Oct 25, 2026

    @clawsweeper
    Contributor

    🦞👀
    Exact review queued.

    Re-review progress:

  8. added
    clawsweeper:intake:bug
    on Oct 25, 2026
  9. 2 remaining items

  10. clawsweeper commented on Nov 1, 2026

    @clawsweeper
    Contributor

    🦞👀
    Exact review queued.

    Re-review progress:

  11. added
    clawsweeper:intake:bug
    clawsweeper:linked-pr-open
    clawsweeper:source-repro
    issue-rating: 🦞 diamond lobster
    and removed
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-live-repro
    issue-rating: 🐚 platinum hermit
    clawsweeper:intake:bug
    on Nov 1, 2026
  12. resinoftree97 commented on Nov 8, 2026

    @resinoftree97
    Author

    @clawsweeper re-review

    Update: original project-parent error fixed in a controlled trial on the reporting installation (2026-11-08 KST)

    I reproduced the original two sessions_spawn model-validation failures again on the unmodified OpenClaw 2026.10.10 operating Gateway, including after restarting that unchanged Gateway:

    • anthropic/claude-haiku-4-5: account/native runtime unavailable before child creation.
    • deepseek/deepseek-flash: Unknown model before child creation.

    After applying a version-specific compiled forward-port of the prerequisite in PR #183761 plus the proposed Gateway-lifecycle/standalone-isolation correction (Option 4), the same existing project parent successfully spawned each model, received actual assistant answer 2 from each respective backend, and recorded normal child stops. One operating Gateway was used sequentially; provider credentials, configuration, project workspace, and session were preserved. Original backups are available.

    This is stronger live before/after evidence than the earlier GitHub Actions experiments, where the unpatched CI base did not reproduce the rejection. It is not proof that the unmodified PR branch has been tested end-to-end, nor that all workspace isolation cases pass. Root-cause owner identity at the original failure was not logged.

    The detailed evidence summary, targeted owner-selection/P2 correction, and proposed source patch are being submitted on PR #183761: #183761 . The PR remains draft/open and requires the contributor's integration and regression review. Please keep this issue open until a reviewed fix is actually merged.

  13. clawsweeper commented on Nov 8, 2026

    @clawsweeper
    Contributor

    🦞👀
    Exact review queued.

    Re-review progress:

  14. added
    clawsweeper:intake:bug
    and removed
    clawsweeper:intake:bug
    on Nov 8, 2026
  15. resinoftree97 commented on Nov 13, 2026

    @resinoftree97
    Author

    Follow-up: project-session catalog fix merged upstream (#197238)

    A new fix for the same project-workspace/read-only model-catalog lookup failure has now been merged into main:

    The merged change adds a Gateway-lifecycle-only, workspace-less published-inventory fallback for read-only catalog lookups, retaining standalone workspace isolation. This addresses the failure mechanism documented here and the P2 concern raised on #183761. Its PR reports real project-session sessions_spawn / child-response testing with a stand-in runtime-discovery plugin and targeted regression coverage.

    For accuracy, this is not a direct re-test of my original Haiku 4.5 / DeepSeek Flash setup on the merged commit. My earlier operating-Gateway red → restart-only red → version-specific forward-port green evidence remains in the comments above.

    Could maintainers consider #197238 as the upstream resolution for this issue, and close it when appropriate after confirming the merged behavior/release? Thank you to everyone who investigated and contributed.

  16. abu-b-sidq commented on Nov 13, 2026

    @abu-b-sidq

    Another trigger for the same preflight miss (2026.11.3): spawning into an explicit systemAgent that has no pinned workspace

    Environment: OpenClaw 2026.11.3 (847611d) on Linux arm64, with the Gateway running as a systemd user service. Claude models run on claude-cli through agents.defaults.models.<ref>.agentRuntime.id.

    Config:

    • agents.ownership: "explicit"
    • agents.defaults.workspace: "~/.openclaw/workspace"
    • agents.defaults.systemAgent.agentId: "main"
    • 16 agents. Every agent except main has an explicit workspace.

    What happens

    • From another agent's session, sessions_spawn({ agentId: "main" }) fails:
      sessions_spawn model "anthropic/claude-sonnet-5-5" is not usable: The selected account or native runtime is unavailable for anthropic/claude-sonnet-5-5. Restore that account before spawning this model.
      Passing an explicit model fails the same way. The same requester can spawn other agents on the same model.
    • A/B test from a main session, same model, one minute apart:
      • sessions_spawn({ agentId: "main", visible: true }) failed with the error above.
      • A hidden sessions_spawn({ agentId: "main" }) was accepted and ran.

    Why (from the 2026.11.3 dist)

    The spawn path and the Gateway's published owner disagree on where the system agent's workspace is.

    1. resolveAgentWorkspaceDir(cfg, "main") returns agents.defaults.workspace itself only for the agent named by tryResolveLegacyDataOwnerAgentId. Under explicit ownership with more than one agent, that is undefined. So it returns <defaults.workspace>/main.
    2. At Gateway startup, tryResolveConfiguredAgentWorkspaceDir returns <defaults.workspace>. listConfiguredOwnerInputs gives that launch dir to the compatibility agent (the explicit systemAgent), with preserveWorkspaceDirOnRefresh set. So main's configured owner is published at <defaults.workspace>.
    3. Cross-agent and visible spawns take the child workspace from resolveSpawnedWorkspaceInheritance({ targetAgentId }), which returns resolveAgentWorkspaceDir. They then call prepareModelChoice({ agentId: "main", workspaceDir: "<defaults.workspace>/main" }). That lookup misses the published owner and falls back to the read-only ephemeral owner. The ephemeral owner has no claude-cli auth mode, so the spawn is rejected.
    4. Hidden same-agent spawns pass the requester's own workspace instead, so they find the published owner and work.

    #183761 adds a fallback that probes at resolveAgentWorkspaceDir. For this config that is <defaults.workspace>/main again, so I don't think it covers this case.

    Same split, other symptoms

    The system agent's runs and bootstrap files use <defaults.workspace>. Its memory_get / memory_search and the session-memory hook use <defaults.workspace>/main. That matches the "two edited workspaces" state described in docs/concepts/multi-agent.md. This roster never got Doctor's workspace pin. doctor --lint lists main's workspace as <defaults.workspace>/main and doesn't flag the split.

    Workaround (verified on the live Gateway)

    Pin agents.entries.main.workspace to the launch workspace. The change hot-reloads. After it, both the visible main→main spawn and the cross-agent spawn into main succeed.

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

    P2bugbug:behaviorclawsweeper:linked-pr-openclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:auth-providerissue-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