Skip to content

[Bug]: "Stop" button has no effect after the agent has reached maximum context length #79525

@dmak

Description

@dmak

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:

Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions