openclaw - 💡(How to fix) Fix Spawned subagents inherit parent model instead of their configured model

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Workaround

Currently working around this by using sessions_send to persistent named sessions created via cron sessionTarget: "session:<custom-id>" per agent. This correctly uses each agent's configured model.

RAW_BUFFERClick to expand / collapse

Bug Description

When spawning a subagent via sessions_spawn, the child session inherits the parent agent's model rather than the spawned agent's configured model from agents.list[].

Steps to Reproduce

  1. Configure Agent A (e.g. aria) with model anthropic/claude-sonnet-4-6
  2. Configure Agent B (e.g. max) with model ollama/qwen3:8b in agents.list[]
  3. From Agent A's session, call sessions_spawn targeting Agent B's workspace/task
  4. In the spawned session, call session_status to check the running model

Expected Behaviour

The spawned child should run on Agent B's configured model (ollama/qwen3:8b).

Actual Behaviour

The spawned child runs on Agent A's model (anthropic/claude-sonnet-4-6) — it inherits the parent's model rather than resolving its own agent config.

Impact

  • Significant cost impact when using expensive models as orchestrators: every ad-hoc delegation burns the orchestrator's model tokens instead of routing to a free/cheap local model.
  • The delegation pattern (orchestrator on Sonnet → workers on Ollama) is broken for ad-hoc spawning. It only works correctly for cron-triggered agent runs.

Workaround

Currently working around this by using sessions_send to persistent named sessions created via cron sessionTarget: "session:<custom-id>" per agent. This correctly uses each agent's configured model.

Environment

  • OpenClaw version: 2026.5.12 (f066dd2)
  • Ollama 0.24.0
  • Affected agents: all agents spawned via sessions_spawn from a parent agent

Suggested Fix

When sessions_spawn resolves the model for the child session, it should check if the task is being assigned to a known agent (via agentId or workspace match) and use that agent's configured model, falling back to the parent's model only if no agent-specific config exists.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Spawned subagents inherit parent model instead of their configured model