r/LocalLLM • u/fintip 2x XTX 7900 + 3060 • 26d ago
Discussion Solving a complex multi-task with 262k vs 128 context dropped performance from 91% to 57%... Then I made two changes. Solves with 128k went up to 94%.
I've been benchmarking local models as coding agents in opencode on real bugs in a real codebase, graded by hidden tests. The hardest tasks bundle 6–12 independent bugs into one request. At a 128k window, Qwen3.8-Flash-Next (IQ3_XXS, 2× 7900 XTX) kept "finishing" early with half the bugs untouched.
What was happening (from the recorded requests):
- When the context fills up, opencode replaces the conversation with a model-written summary. The original request is gone.
- The first summary lists every bug. Later summaries are summaries of summaries and only keep "completed" and "in progress", so bugs not started yet quietly drop out.
- After the summary, opencode adds "Continue if you have next steps, or stop and ask for clarification". The agent reports what it did and stops. One run literally asked me to paste issues 3, 4, 5, 7, 8 and 9 again because it no longer had them.
Two fixes, as a small opencode plugin:
- Re-insert: after every compaction, put the original request back word for word.
- Checklist: tell the summarizer to start every summary with a checklist of every item in the original request, marked done / in progress / not started, and never drop one. Then have the agent sync its todo list to that checklist and check it before finishing.
Results (4 multi-bug tasks, 79 hidden checks, 128k window):
┌─────────────────────────────────────────────────────┬────────┐
│ Setup │ passed │
├─────────────────────────────────────────────────────┼────────┤
│ Stock opencode │ 57% │
├─────────────────────────────────────────────────────┼────────┤
│ Checklist only │ 82% │
├─────────────────────────────────────────────────────┼────────┤
│ Re-insert only │ 90% │
├─────────────────────────────────────────────────────┼────────┤
│ Both │ 94% │
├─────────────────────────────────────────────────────┼────────┤
│ Same model, no fixes, 262k window (rarely compacts) │ 91% │
├─────────────────────────────────────────────────────┼────────┤
│ Claude Opus 5.5 (19 runs, same tasks) │ 94% │
└─────────────────────────────────────────────────────┴────────┘
So at 128k the fixes undo effectively all the damage compaction does--and perhaps even help on top of that. On these long tasks, a quantized local model then matches Opus on sub-tests. (Opus still fully solves more of the tasks outright.)
Caveats:
- One run per setup on the local side, and only 4 tasks. An earlier pilot showed the same direction.
- Single-bug tasks didn't change; they rarely compact, so no difference between 128k and 262k on those tasks.
It seems painfully obvious and I'm kind of shocked no one else has done this.
There's an opencode issue about todos being cleared on compaction (#5934 (https://github.com/anomalyco/opencode/issues/5934)) and an open PR that carries todos over (#25982 (https://github.com/anomalyco/opencode/pull/25982)). Nothing I've seen re-inserts the original request, and in my runs that was the bigger win.
Had claude push it out there as a plugin for anyone that wanted to test it themselves:
Plugin: https://github.com/kylebakerio/opencode-compaction-anchor
I'm doing more tests, but these early results were so direct that I decided to share this right away.
fwiw, my output is shared at:
https://lab.kylebaker.io
I don't sell anything or care if people visit. I've just spent the last month+ non-stop running local benchmarks and building out and upgrading my local benchmarks and had built my own dashboard to manage and view it all, so eventually decided I may as well throw it out there.
Finally, I've not really put this out there before, but for anyone that wants to replicate what I'm doing--I don't share MY benchmark of bugs, but the harness and framework that would allow you to build your OWN benchmark from your OWN git history is here:
https://github.com/kylebakerio/LL-Dash
(drafted with claude because of time, then hand-edited.)
5
u/Material-Database-24 26d ago
I have found similar things with other harnesses. The best workflow I have found for limited context Qwen3.8 27B or QFN is to 1) plan , 2) compact the plan into checklist/todo, and 3) keep and update that checklist/todo in context until all of them are done. It also seems to help them keep track of doing, when they are forced to stop between each todo. If let continue from one step to another without clear stop, there's quite high risk the models do not trust their previous steps have been actually done! With this method I have managed to pull significant refactors (>2000 lines) succesfully.
1
u/Scary-Difference630 20d ago
Why not just ask Opencode to create a todolist.md file with all the steps so even if there is compaction is still fulfills remaining steps in the todolist as it is outside. This is not opencode’s own todolist but a separate one.
If I am being honest, I never faced these issues with long tasks failing, maybe because of this skill.
Additionally you can ask model to add the original prompt in todolist so you don’t have to re-inject it
1
u/derbidrd 26d ago edited 26d ago
I disabled compaction entirely for my 120000k context. Now i use opencode dcp , today i will take a look at sleev it looks even more performant. Also tried mnemonic proxy but it was slowing down m'y flow and too hard to setup. EDIT : I spoke with the dev of mnemonic proxy and my result with his tool are probably user conf error or not enough ram avalaible.
1
u/Dathide 26d ago
You may be interested in tabbyapi, exl3 3bpw has higher accuracy than Q3
0
u/Adept_Diver2838 26d ago
What is your pc setup bro
0
u/stianhoiland 26d ago edited 26d ago
The first time I ever had a compaction, I went and filed an issue saying "put my messages (and potentially the agent responses, too) verbatim into the new context—and change the compaction instruction to say that that will happen and thus that the compaction/summary should focus on summarizing the between-the-lines reasoning instead. The messages are negligible in size and hold my instructions losslessly."
It took me ONE compaction event to spot this. Minimum is a Always/Never/Ask setting.
10
u/[deleted] 26d ago
[removed] — view removed comment