#Compaction issue: OpenClaw 2026.5.18 with LM Studio

1 messages · Page 1 of 1 (latest)

sharp steeple
#

This is on a local only Minisforum MS-S1 Max that I have used the github.com/xcodelyokox/quickstartclaw to help set up. It was working fine until I tried switching models (finally settled on llama 3.1b-instruction) and have tried everything, including completely blowing away wsl and removing any traces of Ubuntu before reloading again today and still having the same issues:
Running OpenClaw 2026.5.18 with LM Studio + llama-3.1-8b-instruct on Ubuntu 24.04 under WSL2.

Symptoms:

  • First prompt often succeeds.
  • LM Studio completes inference successfully.
  • Immediately afterward OpenClaw says “compacting context”.
  • User prompt disappears from UI/session.
  • Session status becomes “failed”.
  • No further requests reach LM Studio until gateway/session restart.

Observed:

  • Context can instantly jump to 98% after tiny prompts.
  • Manual compaction sometimes temporarily fixes it.
  • Session JSON/trajectory files appear to get stuck/corrupted.
  • Earlier runs showed stale/irrelevant compaction summaries injected into context.
  • Multiple sessions worsened behavior.
  • Reducing context to 32768, simplifying AGENTS.md, disabling heartbeat behavior, reducing maxConcurrent/subagents to 1 helped somewhat but did not solve it.
  • Tailscale/gateway itself appears stable.
  • LM Studio itself appears stable.

Question:

  • Is there a known regression in compaction/session lifecycle in 2026.5.18?
  • Is there a way to fully disable compaction/summarization?
  • Are there recommended settings for local small-context models (32K) to avoid session corruption?

I actually know that disabling compaction is probably a no-go, but is anyone else having this problem? Do I need to greatly increase the context to make the model usable? Right now, it can answer one question, maybe two (and I mean like "What is 2+2?") before I need to restart the gateway.

crisp thornBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

broken heartBOT
wintry gobletBOT
# sharp steeple This is on a local only Minisforum MS-S1 Max that I have used the github.com/xco...

This looks less like Tailscale/gateway and more like local-model context accounting + compaction pressure.

A 32K local model is right on the edge for OpenClaw’s full agent prompt. The compaction docs say Pi auto-compacts when:

contextTokens > contextWindow - reserveTokens

and OpenClaw’s default reserve floor is 20K tokens. So with a 32K window, the usable prompt budget can become tiny fast, especially with AGENTS/bootstrap/tool schema context. That can explain “tiny prompt → 98% → compacting context”.

I would try this order:

  1. Make sure OpenClaw and LM Studio agree on the actual loaded context length. In LM Studio, confirm the model is really loaded at 32K or higher, not just configured in OpenClaw.

  2. For this local-only profile, lower the compaction pressure:

{
  agents: {
wintry gobletBOT
wintry gobletBOT
wintry gobletBOT
# sharp steeple This is on a local only Minisforum MS-S1 Max that I have used the github.com/xco...
}
  1. Start a fresh session after changing this. If old session JSONL files already contain stale compaction summaries, continuing that same session can keep reintroducing the bad state.

I would not try to fully disable compaction. There is compaction machinery underneath, but OpenClaw depends on it for overflow recovery and long-running sessions. For 32K local models, tuning reserveTokens / keepRecentTokens down is the safer lever.

Docs I checked:
https://docs.openclaw.ai/gateway/local-models
https://docs.openclaw.ai/gateway/troubleshooting#local-openai-compatible-backend-passes-direct-probes-but-agent-runs-fail
https://docs.openclaw.ai/reference/session-management-compaction
https://docs.openclaw.ai/concepts/models

Also: if you want “has anyone else seen this?” answers from actual local-model users, #users-helping-users is the better place for lived hardware/model experience. For a bug-level report, the useful artifact is openclaw status --all plus the log section around the first bad compaction, then file it here: https://github.com/openclaw/openclaw/issues

sharp steeple
#

expanding the context to 64k and setting supportTools: false seems to have helped with stability tremendously. Thank you, Krill.

wintry gobletBOT
sharp steeple
#

I typed it correctly in the .json and confirmed it with openclaw config validate before trying to run it to catch if I made any errors. It was fine. Thank you again.

wintry gobletBOT