Fixing long-horizon task drift on local models with a deterministic state plugin
paulqq · reddit · 2026-10-03
A developer open-sourced a fix for a common failure mode: after a few context-compaction cycles, local models lose sight of the original task scope, causing goal drift, hallucinated task completion, or loops.
The dsh-local-long-horizon plugin keeps state tracking outside the chat buffer:
- Hooks into the agent loop and maintains a structured state file shown in an independent sidebar: current macro milestone, the in-flight micro-step, a deterministic queue of the next 3 steps, and a verification log with exit codes and test status.
- Key mechanism: when compaction happens, the plugin re-anchors the model to this exact state file instead of trusting the lossy compaction summary.
Code is on GitHub for testing and adaptation.
More from coding & agent
- Claude Opus 5.5 one-shots decompiling 1996 game Chaos Overlords and porting it to macOS in 48 minutes — AIFlow_ML · 2026-10-03
- Claude Connectors roundup: 14 third-party tools you can plug straight into Claude — nikola_mr64990 · 2026-10-03
- Hackathon lessons: agent workflows are the norm and context sharing decides ship speed — Arindam_1729 · 2026-10-03
- Vibe coder built a Claude Code app that researches via 5 LLMs, but auto-picked images don't match — zascar · 2026-10-03
- Developer assigns his AI assistant to earn $80/month to pay for its own subscription — dot_withdotlab · 2026-10-03
- Copilot Home is a nested if, Autopilot is while(true): one analogy explains Microsoft's AI lineup — pswider · 2026-10-03