openclaw - 💡(How to fix) Fix Beta blocker: ollama - qwen3.5:9b produces garbage output under full agent system prompt [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#70975Fetched 2026-04-24 10:37:15
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3renamed ×3

When OpenClaw sends a full agent system prompt (~42,000 chars) to ollama/qwen3.5:9b, the model produces repetition loops instead of a coherent response; confirmed across multiple sessions on v2026.4.12 and v2026.4.22.

Root Cause

When OpenClaw sends a full agent system prompt (~42,000 chars) to ollama/qwen3.5:9b, the model produces repetition loops instead of a coherent response; confirmed across multiple sessions on v2026.4.12 and v2026.4.22.

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

Yes

Summary

When OpenClaw sends a full agent system prompt (~42,000 chars) to ollama/qwen3.5:9b, the model produces repetition loops instead of a coherent response; confirmed across multiple sessions on v2026.4.12 and v2026.4.22.

Steps to reproduce

  1. Configure OpenClaw with a full agent workspace (workspace files totaling ~27k chars: SOUL.md, AGENTS.md, USER.md, IDENTITY.md, TOOLS.md, HEARTBEAT.md, BOOTSTRAP.md)
  2. Set agents.defaults.model.primary to ollama/qwen3.5:9b
  3. Configure remote Ollama at http://host:11434 with qwen3.5:9b Q4_K_M
  4. Start a new session and send any message (e.g. "hello")
  5. Observe garbage output after 2-3 minute response time

Expected behavior

ollama/qwen3.5:27b produces coherent responses under identical workspace and tool configuration on the same hardware; qwen3.5:9b should behave similarly.

Actual behavior

Model produces repetition loops after 2-3 minutes: HeyHeyHeyHeyHeyHeyHeyHeyHeyHey... NONONONONONOhelloNONONONONONONOHELLONONO...

Ollama logs show first request returns 500 after 15s (race condition on load), second request returns 200 after 2m48s with garbage content.

[GIN] 2026/04/24 05:33:09 | 500 | 15.404728969s | POST "/api/chat" [GIN] 2026/04/24 05:36:00 | 200 | 2m48s | POST "/api/chat"

OpenClaw version

2026.4.22 (also reproduced on 2026.4.12)

Operating system

Ubuntu 24.04 (running as Unraid VM)

Install method

npm global

Model

ollama/qwen3.5:9b

Provider / routing chain

openclaw -> ollama (remote host 192.168.40.22:11434)

Additional provider/model setup details

Remote Ollama instance at http://192.168.40.22:11434 (no /v1) Model: qwen3.5:9b Q4_K_M, 9.7B parameters GPU stack: RTX 3090 24GB + RTX 3080 10GB + RTX 3060 12GB + RTX 3070 8GB = 54GB VRAM Model loads successfully: all 33 layers on GPU, 21.7GB VRAM, context_length 262144 agents.defaults.experimental.localModelLean: true was tried — did not resolve

Logs, screenshots, and evidence

Impact and severity

Affected: Any user running qwen3.5:9b with a full agent workspace Severity: High — model is completely unusable for agent sessions Frequency: 100% reproducible (5/5 attempts failed) Consequence: Agent session cannot start; falls back to garbage output or hangs

Additional information

System prompt breakdown at time of failure:

  • Total: ~42,562 chars
  • Project context (workspace files): ~27,152 chars
  • Tool schemas: ~14,143 chars
  • Skills prompt: ~3,747 chars

qwen3.5:27b handles identical prompt correctly on same hardware. localModelLean: true attempted — did not resolve. No errors in Ollama logs during inference — failure is silent garbage output only.

extent analysis

TL;DR

The issue can be mitigated by adjusting the model configuration or the input prompt to prevent repetition loops when using ollama/qwen3.5:9b with a full agent system prompt.

Guidance

  • Verify model limits: Check the maximum input length and context length supported by ollama/qwen3.5:9b to ensure the prompt is within acceptable limits.
  • Adjust prompt length: Attempt to reduce the length of the system prompt by optimizing workspace files, tool schemas, or skills prompt to see if it resolves the issue.
  • Explore model alternatives: Consider using a different model version, such as ollama/qwen3.5:27b, which is reported to handle identical prompts correctly.
  • Monitor Ollama logs: Although no errors are reported during inference, closely monitor Ollama logs for any patterns or warnings that might indicate the cause of the silent failure.

Example

No specific code snippet can be provided without further details on the model or OpenClaw configuration. However, adjusting the context_length or max_input_length parameters in the model configuration might help mitigate the issue.

Notes

The root cause of the issue seems related to the model's handling of long input prompts. The fact that ollama/qwen3.5:27b handles the same prompt correctly suggests a potential version-specific issue or configuration difference.

Recommendation

Apply a workaround by adjusting the model configuration or input prompt length, as the issue seems specific to the combination of ollama/qwen3.5:9b and the full agent system prompt. Upgrading to a different model version might also be considered if the workaround is not effective.

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

ollama/qwen3.5:27b produces coherent responses under identical workspace and tool configuration on the same hardware; qwen3.5:9b should behave similarly.

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 Beta blocker: ollama - qwen3.5:9b produces garbage output under full agent system prompt [1 participants]