openclaw - 💡(How to fix) Fix [Bug]: OpenClaw 2026.5.7 subagent regression

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…

OpenClaw 2026.5.7 appears to introduce a major regression affecting native/local subagent execution with Ollama runtimes.

Root Cause

OpenClaw 2026.5.7 appears to introduce a major regression affecting native/local subagent execution with Ollama runtimes.

Fix Action

Fix / Workaround

  1. Apply temporary bypass patch preventing: prepareContextEngineSubagentSpawn() from executing during isolated subagent runs.
  • local Ollama subagents

  • low CPU usage

  • successful lightweight orchestration

  • no runaway context expansion

  • no embedded runtime fallback during isolated subagent dispatch.

  • embedded runtime execution appearing during subagent dispatch

  • runaway behavior disappearing after bypassing: prepareContextEngineSubagentSpawn() for isolated subagent runs

Code Example

Relevant observed log evidence:

 id="z4l6ko"
lightContext is only supported for runtime='subagent'


 id="k2n1xt"
[agent/embedded] embedded run agent end


Observed behavior during isolated lightweight subagent execution:

* runaway CPU utilization on local Ollama host
* excessive inherited context expansion
* stalled or delayed inference
* unstable subagent orchestration behavior
* embedded runtime fallback appearing during subagent dispatch

Relevant source inspection findings:

 id="f7q3nr"
const contextEnginePrepareResult = await prepareContextEngineSubagentSpawn({


Observed mitigation:
Bypassing context-engine preparation during isolated subagent execution restored stable lightweight orchestration.

Applied test patch:

 id="5z8cpm"
if (params.context?.mode === "isolated") {
  return {
    status: "ok",
    preparation: void 0
  };
}


Observed post-patch behavior:

* no CPU spike
* no embedded fallback in logs
* successful isolated lightweight subagent execution
* stable local Ollama inference behavior

Additional evidence attached:

* gateway logs
* isolated spawn test results
* runtime source excerpts
* before/after behavior comparison
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

OpenClaw 2026.5.7 appears to introduce a major regression affecting native/local subagent execution with Ollama runtimes.

Steps to reproduce

  1. Configure OpenClaw 2026.5.7 with:

    • main/orchestrator agent using a remote model
    • subagents using local Ollama runtimes
    • lossless-claw enabled
    • sessions_spawn orchestration workflow
  2. Configure subagents with native local models (example):

    • qwen2.5-coder:14b-32k
    • runtime path using sessions_spawn()
  3. From the main agent, execute:

    • runtime="subagent"
    • context="isolated"
    • lightContext=true
    • mode="run"
  4. Spawn a lightweight subagent task such as: "Reply only with: OK"

  5. Observe:

    • excessive inherited context injection
    • large payload expansion
    • high CPU usage on local Ollama host
    • stalled or delayed inference
    • embedded runtime fallback appearing in logs
    • timeout/failure behavior
  6. Apply temporary bypass patch preventing: prepareContextEngineSubagentSpawn() from executing during isolated subagent runs.

  7. Repeat the same isolated lightweight spawn test.

  8. Observe:

    • no CPU spike
    • no embedded fallback
    • successful lightweight isolated subagent execution
    • stable Ollama behavior

Expected behavior

Isolated lightweight subagent execution should remain lightweight when using:

  • runtime="subagent"
  • context="isolated"
  • lightContext=true

Subagent runs should not inherit large context-engine payloads, forked transcript state, or embedded fallback behavior during isolated execution.

Behavior observed prior to 2026.5.7 was stable with:

  • local Ollama subagents
  • low CPU usage
  • successful lightweight orchestration
  • no runaway context expansion
  • no embedded runtime fallback during isolated subagent dispatch.

Actual behavior

When executing isolated lightweight subagent spawns using local Ollama runtimes, OpenClaw 2026.5.7 injected unexpectedly large inherited context into subagent execution.

Observed behavior included:

  • runaway CPU utilization on the local Ollama host
  • large payload expansion during lightweight isolated spawns
  • stalled or delayed inference
  • embedded runtime fallback appearing in logs
  • unstable subagent orchestration behavior
  • timeout/failure conditions during lightweight subagent execution

Observed gateway/runtime evidence included:

  • embedded runtime execution appearing during subagent dispatch
  • runaway behavior disappearing after bypassing: prepareContextEngineSubagentSpawn() for isolated subagent runs

After applying the isolated-context bypass patch:

  • no CPU spike occurred
  • no embedded fallback appeared in logs
  • lightweight isolated subagent execution completed successfully
  • local Ollama runtime behavior stabilized

OpenClaw version

version: 2026.5.7

Operating system

Ubuntu 24.04 LTS

Install method

npm global

Model

Main orchestrator: openrouter/x-ai/grok-4.1-fast | subagents: qwen2.5-coder:14b-32k (Ollama)

Provider / routing chain

OpenClaw gateway → sessions_spawn → native subagent runtime → remote Ollama hosts → local Ollama inference

Additional provider/model setup details

Main orchestrator agent uses:

  • openrouter/x-ai/grok-4.1-fast

Subagents use native/local Ollama runtimes across separate hosts:

  • minimax-m2.7:cloud
  • qwen2.5-coder:14b-32k (local modification)
  • gemma4

Observed regression occurs specifically during:

  • sessions_spawn()
  • runtime="subagent"
  • context="isolated"
  • lightContext=true

Environment includes:

  • distributed multi-host OpenClaw deployment
  • remote orchestrator model
  • local subagent inference servers
  • lossless-claw enabled

Relevant runtime behavior observed in:

  • ~/.openclaw/openclaw.json
  • dist/subagent-spawn-CZA9_Uwl.js
  • dist/openclaw-tools-0ftkmYS3.js

Observed regression appears connected to: prepareContextEngineSubagentSpawn()

Bypassing context-engine preparation during isolated subagent execution restored stable lightweight behavior.

Logs, screenshots, and evidence

Relevant observed log evidence:

 id="z4l6ko"
lightContext is only supported for runtime='subagent'


 id="k2n1xt"
[agent/embedded] embedded run agent end


Observed behavior during isolated lightweight subagent execution:

* runaway CPU utilization on local Ollama host
* excessive inherited context expansion
* stalled or delayed inference
* unstable subagent orchestration behavior
* embedded runtime fallback appearing during subagent dispatch

Relevant source inspection findings:

 id="f7q3nr"
const contextEnginePrepareResult = await prepareContextEngineSubagentSpawn({


Observed mitigation:
Bypassing context-engine preparation during isolated subagent execution restored stable lightweight orchestration.

Applied test patch:

 id="5z8cpm"
if (params.context?.mode === "isolated") {
  return {
    status: "ok",
    preparation: void 0
  };
}


Observed post-patch behavior:

* no CPU spike
* no embedded fallback in logs
* successful isolated lightweight subagent execution
* stable local Ollama inference behavior

Additional evidence attached:

* gateway logs
* isolated spawn test results
* runtime source excerpts
* before/after behavior comparison

Impact and severity

Affected systems:

  • OpenClaw multi-agent deployments using:

    • sessions_spawn()
    • native/local Ollama subagents
    • distributed inference hosts
    • lossless-claw enabled environments

Severity: High

Observed impact:

  • runaway CPU utilization on local inference hosts
  • stalled lightweight subagent execution
  • unstable orchestration behavior
  • embedded runtime fallback during isolated subagent dispatch
  • timeout/failure conditions during lightweight tasks

Frequency: Consistently reproducible during isolated lightweight subagent execution prior to applying the bypass patch.

Observed consequence:

  • lightweight subagent orchestration becomes unstable
  • local inference hosts experience excessive load
  • isolated subagent execution no longer behaves lightweight
  • orchestration reliability degrades significantly under local Ollama deployments

Observed mitigation: Bypassing prepareContextEngineSubagentSpawn() during isolated subagent execution restored stable behavior.

Additional information

Last known stable behavior observed prior to upgrade from:

  • OpenClaw 2026.4.27

First known problematic behavior observed on:

  • OpenClaw 2026.5.7

Observed regression coincided with:

  • subagent policy enforcement changes
  • allowAgents enforcement
  • isolated subagent context-engine preparation behavior

Observed source/runtime evidence:

  • sessions_spawn internally resolves isolated runtime behavior through: spawnSubagentDirect()
  • isolated lightweight subagent runs still invoke: prepareContextEngineSubagentSpawn()

Observed temporary mitigation: Bypassing context-engine preparation during isolated subagent execution restored stable lightweight orchestration behavior.

Observed stable post-patch behavior:

  • no CPU runaway
  • no embedded fallback in logs
  • successful lightweight isolated subagent execution
  • stable local Ollama inference behavior

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…

FAQ

Expected behavior

Isolated lightweight subagent execution should remain lightweight when using:

  • runtime="subagent"
  • context="isolated"
  • lightContext=true

Subagent runs should not inherit large context-engine payloads, forked transcript state, or embedded fallback behavior during isolated execution.

Behavior observed prior to 2026.5.7 was stable with:

  • local Ollama subagents
  • low CPU usage
  • successful lightweight orchestration
  • no runaway context expansion
  • no embedded runtime fallback during isolated subagent dispatch.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING