#Openclaw agents troubleshooting

9 messages · Page 1 of 1 (latest)

red stag
#

Hi @nimble hill , i have code :

"agents": {
"list": [
{
"id": "executor",
"model": {
"primary": "lmstudio/minimax"
},
"thinkingDefault": "low",
"reasoningDefault": "off",
"skills": [],
"tools": {
"profile": "coding",
"deny": []
}
}
],
"defaults": {
"model": {
"primary": "lmstudio/minimax"
},
"models": {
"lmstudio/minimax": {
"alias": "Local"
}
},
"workspace": "C:\Users\Andi\.openclaw\workspace",
"compaction": {
"mode": "safeguard"
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
},
"llm": {
"idleTimeoutSeconds": 1000000000000
}
}
}

But i have error : Context limit exceeded. I've reset our conversation to start fresh - please try again.

To prevent this, increase your compaction buffer by setting agents.defaults.compaction.reserveTokensFloor to 20000 or higher in your config.

pls help

nimble hillBOT
#

I’m checking the exact setting and whether there’s a second gotcha with LM Studio/local models.

#

Yep, that key is real.

Try this under agents.defaults.compaction:

compaction: {
  mode: "safeguard",
  reserveTokensFloor: 24000,
}

Then restart the gateway:

openclaw gateway restart
#

Two important notes:

  1. agents.defaults.models only sets aliases.
    It does not define the LM Studio model’s real context size.

  2. With LM Studio, make sure your top-level models.providers.lmstudio.models[] entry has the correct contextWindow and maxTokens. Wrong values can cause overflow/compaction loops.

Docs:

If it still fails, paste these 3 things and I’ll check the exact issue:

  • openclaw --version
  • your models.providers.lmstudio block
  • the log lines right after the failure from openclaw logs --follow
red stag
#

I have set my model to have maximum ContextLength of 131072. And what happens if i set reserveTokensFloor: 24000 to 100000 for example

nimble hillBOT
#

reserveTokensFloor is reserved headroom, not extra context.

So with a contextWindow of 131072:

  • reserveTokensFloor: 24000 means OpenClaw tries to keep about 24k tokens free
  • reserveTokensFloor: 100000 means it tries to keep 100k free, so you only get about 31k-ish usable room before compaction/overflow logic starts kicking in

So yes, if you set it to 100000, the bot will likely compact way earlier and way more often. That usually makes things worse, not better.

I’d start here instead:

compaction: {
  mode: "safeguard",
  reserveTokensFloor: 24000,
}
#

If needed, try 32000 next, but I would not jump to 100000.

Also, one big gotcha: setting LM Studio’s context length in the app is not enough by itself. Make sure OpenClaw’s model config also knows the same value via your models.providers.lmstudio.models[].contextWindow.

So the safe rule is:

  • model contextWindow = total capacity
  • reserveTokensFloor = space kept aside for retries/compaction/memory flush
  • bigger reserve = less usable chat context

Docs:

If you paste your full models.providers.lmstudio block, I can sanity-check whether OpenClaw is actually seeing 131072 correctly.

red stag
#

so if the reserveTokensFloors already reach its compaction limit. So we start a new conversation? or /new?

nimble hillBOT
#

Not quite, reserveTokensFloor is the buffer, not the “start new chat now” limit.

What should happen is:

  1. conversation gets close to the buffer
  2. OpenClaw tries compaction
  3. if compaction works, you stay in the same conversation
  4. only if compaction/retry fails badly, OpenClaw may reset the session and ask you to try again

So:

  • /compact = keep same session, summarize old context now
  • /new = throw away current session context and start fresh

If you saw:

“I’ve reset our conversation to start fresh”