openclaw - ✅(Solved) Fix Bug: sessions_spawn model parameter silently ignored — sub-agents always use orchestrator default [1 pull requests, 1 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#74837Fetched 2026-05-01 05:40:52
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
commented ×1cross-referenced ×1

The model parameter on sessions_spawn() is silently ignored. The response returns modelApplied: true, but the sub-agent runtime always uses the orchestrator's default model instead of the requested model.

Root Cause

Impact

  • Critical for multi-model orchestration. The entire point of model on spawn is to route coding tasks to coding models, research to research models, etc.
  • Sub-agents burned through their entire output token budget on exploration/thinking (because GLM-5.1 thinks heavily before writing), hit stopReason: "length", and produced zero output files in 3 consecutive attempts to build a project.
  • Related: maxTokens was also artificially capped at 8192 for GLM-5.1 in models.json (workaround: bumped to 32000 locally), but the model override bug is the primary blocker.

Fix Action

Workaround

None effective. Building directly in the orchestrator session instead of spawning sub-agents.

PR fix notes

PR #74892: fix(agents): modelApplied flag only true when caller provides model override

Description (problem / solution / changelog)

Summary

Targeted single-issue fix.

Closes #74837

🤖 Generated with Claude Code

Changed files

  • src/agents/subagent-spawn-plan.ts (modified, +1/-1)
  • src/agents/subagent-spawn.ts (modified, +4/-1)

Code Example

sessions_spawn(model="venice/qwen3-coder-480b-a35b-instruct-turbo", ...)
RAW_BUFFERClick to expand / collapse

Bug Report

Summary

The model parameter on sessions_spawn() is silently ignored. The response returns modelApplied: true, but the sub-agent runtime always uses the orchestrator's default model instead of the requested model.

Environment

  • OpenClaw version: 2026.4.27 (cbc2ba0)
  • Platform: macOS (Apple Silicon)
  • Gateway config: ~/.openclaw/openclaw.json

Steps to Reproduce

  1. Spawn a sub-agent with a specific model override:
    sessions_spawn(model="venice/qwen3-coder-480b-a35b-instruct-turbo", ...)
  2. Response returns modelApplied: true
  3. Check the sub-agent trajectory: "model":"zai-org-glm-5-1" — always the orchestrator default

Evidence

Spawned 4 test sub-agents. All returned modelApplied: true. All trajectories show the same model:

Requested ModelActual Model UsedSession ID
venice/qwen3-coder-480b-a35b-instruct-turbozai-org-glm-5-1633df869-...
venice/qwen3-coder-480b-a35b-instruct-turbozai-org-glm-5-10d3d44c4-...
venice/qwen3-coder-480b-a35b-instruct-turbozai-org-glm-5-1c086ec02-...
venice/qwen3-coder-480b-a35b-instruct-turbozai-org-glm-5-117f6e7cc-... (post-upgrade test)

Trajectory files confirmed via grep "model" <session>.trajectory.jsonl.

Impact

  • Critical for multi-model orchestration. The entire point of model on spawn is to route coding tasks to coding models, research to research models, etc.
  • Sub-agents burned through their entire output token budget on exploration/thinking (because GLM-5.1 thinks heavily before writing), hit stopReason: "length", and produced zero output files in 3 consecutive attempts to build a project.
  • Related: maxTokens was also artificially capped at 8192 for GLM-5.1 in models.json (workaround: bumped to 32000 locally), but the model override bug is the primary blocker.

Expected Behavior

Sub-agent should use the model specified in the model parameter.

Workaround

None effective. Building directly in the orchestrator session instead of spawning sub-agents.

Related

  • Also affects model parameter on sessions_spawn() for any model that differs from the orchestrator default.
  • Token output cap issue: 20 Venice models in models.json had maxTokens: 8192 (artificially low) — local workaround applied but upstream default should be corrected.

extent analysis

TL;DR

The model parameter in sessions_spawn() is being ignored, causing sub-agents to use the orchestrator's default model instead of the requested one, and a potential workaround could involve investigating the openclaw.json configuration or the models.json file for any model-specific settings.

Guidance

  • Verify that the model parameter is correctly formatted and matches the expected model name in the models.json file.
  • Check the openclaw.json configuration file for any settings that might be overriding the model parameter.
  • Investigate if there are any version-specific issues with OpenClaw version 2026.4.27 that might be causing this behavior.
  • Consider testing with a different model to see if the issue is specific to the venice/qwen3-coder-480b-a35b-instruct-turbo model.

Example

No code snippet is provided as the issue seems to be related to configuration or version-specific behavior.

Notes

The issue seems to be critical for multi-model orchestration, and the current workaround of building directly in the orchestrator session instead of spawning sub-agents might not be scalable. Further investigation into the OpenClaw configuration and version-specific behavior is needed to resolve this issue.

Recommendation

Apply a workaround by manually configuring the models.json file to use the correct maxTokens value for each model, and investigate the openclaw.json configuration file for any settings that might be causing the model parameter to be ignored. This is because the issue seems to be related to configuration or version-specific behavior, and a workaround might be necessary until a permanent fix is available.

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 - ✅(Solved) Fix Bug: sessions_spawn model parameter silently ignored — sub-agents always use orchestrator default [1 pull requests, 1 comments, 2 participants]