openclaw - ✅(Solved) Fix OpenClaw Model Registry: GPT-4.1 family passes through unmanaged [1 pull requests, 1 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#63301Fetched 2026-04-09 07:55:35
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

  • No error or warning at configuration time

Fix Action

Fixed

PR fix notes

PR #66652: feat(tools): add model_spawn tool — live session model switch and parallel ephemeral spawns

Description (problem / solution / changelog)

Summary

  • Adds model_spawn LLM-callable tool implementing the canonical spec in docs/tools/model-spawn.md
  • live mode: switches the current session's model in-place (context preserved, takes effect at the next clean turn boundary via liveModelSwitchPending + session store)
  • spawn single: delegates one task to a specified model in an ephemeral isolated session via spawnSubagentDirect
  • spawn multi: fans out up to 10 tasks concurrently across different models via Promise.all — supports both model specialization (different subtasks to different models) and model comparison (same task across multiple models)
  • Replaces the narrower model_switch tool (live-switch only, no spawn capability)
  • Canonical spec (docs/tools/model-spawn.md) is language-agnostic; a conformant Rust implementation for zeroclaw is being submitted in parallel to zeroclaw-labs/zeroclaw

Files changed

FileChange
src/agents/tools/model-spawn-tool.tsNew tool implementation
src/agents/openclaw-tools.tsRegister model_spawn, remove model_switch
src/agents/tool-display-config.tsAdd display metadata (required by pre-commit hook)
apps/shared/OpenClawKit/Resources/tool-display.jsonRegenerated snapshot
docs/tools/model-spawn.mdCanonical spec (shared with zeroclaw)

Schema

{
  "mode": "live" | "spawn",
  "model": "provider/model-id",        // live or single spawn
  "task": "...",                        // single spawn or default for spawns[]
  "context": "...",                     // optional, prepended to task
  "spawns": [                           // multi-model parallel execution
    { "model": "...", "task": "...", "label": "...", "context": "..." }
  ],
  "cleanup": "delete" | "keep",        // default: "delete"
  "timeout_seconds": 120
}

Test plan

  • live mode: verify liveModelSwitchPending is set in session store; next turn uses new model
  • spawn single: task runs in isolated session on specified model; parent session model unchanged
  • spawn multi: all entries run concurrently; results array contains one entry per spawn with label/index/model/status/output
  • spawns[] fallback: per-entry omitted task inherits top-level task; per-entry omitted context inherits top-level context
  • Mutual exclusion: providing both top-level model and spawns[] returns an error
  • cleanup="keep": session persists after spawn completes

🤖 Generated with Claude Code

Changed files

  • apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json (modified, +10/-0)
  • docs/tools/model-spawn.md (added, +273/-0)
  • src/agents/openclaw-tools.ts (modified, +13/-0)
  • src/agents/tool-display-config.ts (modified, +5/-0)
  • src/agents/tool-mutation.ts (modified, +1/-0)
  • src/agents/tools/model-spawn-tool.test.ts (added, +379/-0)
  • src/agents/tools/model-spawn-tool.ts (added, +319/-0)
  • src/security/dangerous-tools.ts (modified, +2/-0)
RAW_BUFFERClick to expand / collapse

Issue

OpenClaw 2026.4.7 uses the GPT-5.4 model family internally for OpenAI workloads. When a user configures a model ID outside the registry — such as openai/gpt-4.1-nano, openai/gpt-4.1-mini, or openai/gpt-4.1 — the ID passes through to OpenAI's API raw, without OpenClaw's exec profile, tool-use optimizations, or context window tuning applied. The model runs unmanaged with no warning to the user.

Impact

GPT-4.1 Nano ($0.10/$0.40 per million tokens, 1M context) is visibly attractive to cost-sensitive users. A user who sets it as their primary will see:

  • No error or warning at configuration time
  • No indication that the model is running without OpenClaw's exec profile
  • Degraded tool-call behavior, schema adherence, and output quality compared to registry-managed models
  • Potential exec preflight failures

The failure mode is silent.

Reproduction

  1. Set primary model: "primary": "openai/gpt-4.1-nano" in ~/.openclaw/openclaw.json
  2. Restart gateway
  3. Run any multi-step agentic skill involving tool calls
  4. Observe: model executes but without exec profile, tool-use optimizations, or context window tuning

Proposed Solution

  1. Registry validation with user warning — emit a clear warning at startup when a model ID is not in the registry
  2. GPT-4.1 family registry entries — add exec profiles for gpt-4.1, gpt-4.1-mini, and gpt-4.1-nano

Re-filed from #63301 (originally filed under wrong account).

extent analysis

TL;DR

To address the issue, add a registry validation with a user warning for unmanaged models and consider adding the GPT-4.1 family to the registry for managed access.

Guidance

  • Validate model IDs against the OpenClaw registry and emit a clear warning at startup for unmanaged models.
  • Consider adding the GPT-4.1 family (Nano, Mini, and standard) to the registry with appropriate exec profiles for managed access.
  • To mitigate the issue, users can set "unmanaged": true in the model config to suppress the warning, but this is not recommended due to potential quality degradation.
  • Verify the fix by configuring a model ID outside the registry and checking for the warning message, then test the output quality with and without the proposed changes.

Example

To add a model to the registry, create a JSON entry like the following:

{
  "id": "gpt-4.1-nano",
  "name": "GPT-4.1 Nano",
  "contextWindow": 1047576,
  "maxTokens": 32768,
  "capabilities": ["tool_calling", "structured_output"],
  "tier": "nano",
  "reasoning": false
}

Notes

The proposed solution requires changes to the OpenClaw registry and potentially the gateway startup logic. The addition of the GPT-4.1 family to the registry is optional but recommended for managed access to these models.

Recommendation

Apply the workaround by adding registry validation with a user warning for unmanaged models. This preserves the user's ability to use any valid provider model ID while making the tradeoff explicit. Consider adding the GPT-4.1 family to the registry for managed access to improve output quality and user experience.

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 OpenClaw Model Registry: GPT-4.1 family passes through unmanaged [1 pull requests, 1 participants]