#Context overflow: prompt too large for the model. Try again with less input or a larger-context mode

1 messages · Page 1 of 1 (latest)

willow lagoon
#

Hi all, I was using Opus and realised it rate limited a lot so I changed to Sonnet. However, quite recently I've started getting this message from my Clawdbot saying "Context overflow: prompt too large for the model. Try again with less input or a larger-context model."

I thought this was due to the rate limit and I'd have to wait for the reset. But just to test it out, I configured and switched to openai gpt-5.2, i ran /compact and i also ran /new to start a new session but I'm still getting "Context overflow: prompt too large for the model. Try again with less input or a larger-context model."

Can someone please help me out with this issue?

#

@flint siren can you help out here?

ripe heath
#

getting this as well, using sonnet with the clawdbot latest update

#

hm back to normal now

alpine cloud
#

Getting this a lot today. /New or /reset not helping

swift summit
#

This is me today as well. I tried switching models and everything

eager lodge
#

I’m having same issue. Using ChatGPT 5.2 plus plan. Simple tasks. Nothing crazy. 2 days of non stop use and nothing. But today one little message and I get it.

I’ve tried / new inside telegram and it helps for a little. I’ve tried new sessions in terminal I’ve tired restarting. I’ve had my bot check all files for anything super crazy and nothing.

It’s making me want to just give up. Tried at least 15 different things.

woeful quartz
#

Look at your sessions in the Gateway Dashboard, your active session is likely near the tokens limit.

You can edit your sessions.json file and change "contextWindow" to a larger value but you may need to change the model and modelProvider as well or it will revert to the contextWindow defined for the model in openclaw.json.

My issues was that I started the chat on a model with a small contextWindow defined and the session contextWindow doesnt appear to be updated when the model is changed in a session.

Hope this helps

flint sirenBOT
# woeful quartz Look at your sessions in the Gateway Dashboard, your active session is likely ne...

Soze gave you the right answer! This is a common gotcha with Clawdbot sessions.

The issue: When you start a session with a model (like Opus), Clawdbot locks in that model's contextWindow for the session. Switching models later with /model doesn't update the session's stored contextWindow — it stays at the original value.

Quick fixes:

  1. Start fresh/new should give you a clean session with the new model's contextWindow, but if you ran into this mid-conversation, check:

    clawdbot session list
    

    Find the session with the overflow and delete/clear it.

  2. Manual fix — If you want to rescue the current session, edit ~/.clawdbot/sessions.json and update the contextWindow for your session to match your new model's limit (e.g., Sonnet 3.5 has 200K tokens, GPT-5.2 has 2M).

  3. Check your config — Make sure openclaw.json has the correct contextWindow values for your models.

To prevent this: Always run /new after switching to a significantly different model (especially when moving from smaller-context to larger-context models).