openclaw - 💡(How to fix) Fix [Bug]: "Stop" button has no effect after the agent has reached maximum context length [1 pull requests]

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…

After agent hits the situation when maximum context length has reached:

...
openclaw-gateway-1  | 2026-05-07T17:46:03.750+00:00 [ws] ⇄ res ✓ sessions.list 110ms conn=f195b6ae…9d09 id=13d18608…0946                    
openclaw-gateway-1  | 2026-05-07T17:46:06.634+00:00 [agent/embedded] embedded run agent end: runId=458d10dc-2870-4499-a163-1c8727eda10b isError=true model=kilo-auto/free provider=kilocode error=Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model. rawError=400 Provider returned error {"error":{"message":"This model's maximum context length is 262144 tokens. However, you requested 303617 tokens (271617 in the messages, 32000 in the completion). Please re…

chat shows a dimming red boundary (as if agent is still running), stop button does not work, and I cannot restart the session by sending /new, because this command is queued:

<img width="1199" height="418" alt="Image" src="https://github.com/user-attachments/assets/fed837be-adb1-40bc-bec2-837e010c6975" />

As a result I cannot recover.

Error Message

openclaw-gateway-1 | 2026-05-07T17:46:06.634+00:00 [agent/embedded] embedded run agent end: runId=458d10dc-2870-4499-a163-1c8727eda10b isError=true model=kilo-auto/free provider=kilocode error=Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model. rawError=400 Provider returned error {"error":{"message":"This model's maximum context length is 262144 tokens. However, you requested 303617 tokens (271617 in the messages, 32000 in the completion). Please re… Agent correctly detects this situation and reports model misconfiguration error (models.providers.kilocode.models.*.contextWindow) and stops the processing.

Root Cause

After agent hits the situation when maximum context length has reached:

...
openclaw-gateway-1  | 2026-05-07T17:46:03.750+00:00 [ws] ⇄ res ✓ sessions.list 110ms conn=f195b6ae…9d09 id=13d18608…0946                    
openclaw-gateway-1  | 2026-05-07T17:46:06.634+00:00 [agent/embedded] embedded run agent end: runId=458d10dc-2870-4499-a163-1c8727eda10b isError=true model=kilo-auto/free provider=kilocode error=Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model. rawError=400 Provider returned error {"error":{"message":"This model's maximum context length is 262144 tokens. However, you requested 303617 tokens (271617 in the messages, 32000 in the completion). Please re…

chat shows a dimming red boundary (as if agent is still running), stop button does not work, and I cannot restart the session by sending /new, because this command is queued:

Fix Action

Fixed

Code Example

...
openclaw-gateway-1  | 2026-05-07T17:46:03.750+00:00 [ws] ⇄ res ✓ sessions.list 110ms conn=f195b6ae…9d09 id=13d18608…0946                    
openclaw-gateway-1  | 2026-05-07T17:46:06.634+00:00 [agent/embedded] embedded run agent end: runId=458d10dc-2870-4499-a163-1c8727eda10b isError=true model=kilo-auto/free provider=kilocode error=Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model. rawError=400 Provider returned error {"error":{"message":"This model's maximum context length is 262144 tokens. However, you requested 303617 tokens (271617 in the messages, 32000 in the completion). Please re…
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

After agent hits the situation when maximum context length has reached:

...
openclaw-gateway-1  | 2026-05-07T17:46:03.750+00:00 [ws] ⇄ res ✓ sessions.list 110ms conn=f195b6ae…9d09 id=13d18608…0946                    
openclaw-gateway-1  | 2026-05-07T17:46:06.634+00:00 [agent/embedded] embedded run agent end: runId=458d10dc-2870-4499-a163-1c8727eda10b isError=true model=kilo-auto/free provider=kilocode error=Context overflow: prompt too large for the model. Try /reset (or /new) to start a fresh session, or use a larger-context model. rawError=400 Provider returned error {"error":{"message":"This model's maximum context length is 262144 tokens. However, you requested 303617 tokens (271617 in the messages, 32000 in the completion). Please re…

chat shows a dimming red boundary (as if agent is still running), stop button does not work, and I cannot restart the session by sending /new, because this command is queued:

<img width="1199" height="418" alt="Image" src="https://github.com/user-attachments/assets/fed837be-adb1-40bc-bec2-837e010c6975" />

As a result I cannot recover.

Steps to reproduce

Tricky to reproduce, but each time context length exceeds, I cannot restart the agent from the Chat.

Expected behavior

Agent correctly detects this situation and reports model misconfiguration error (models.providers.kilocode.models.*.contextWindow) and stops the processing.

OpenClaw version

v2026.4.15

Operating system

Ubuntu

Install method

docker

Provider / routing chain / model

kilocode/kilo-auto/free

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

Agent correctly detects this situation and reports model misconfiguration error (models.providers.kilocode.models.*.contextWindow) and stops the processing.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING