Repository navigation
Context-overflow handling in long local agent sessions: does the system prompt survive? #1063
behrnt-slatgng
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm the founder of Grunz — a hosted, not local, service — but we run some of the same open-weight models people run through llamafile, and a failure mode from our long-session agent work seems like it should show up locally too, so I'm curious whether it's familiar to people here.
When an agent's context window fills up, something has to decide what gets dropped, and if the goal/system prompt isn't preserved verbatim through that process, it tends to get summarized into vagueness rather than cleanly evicted. The model then reads back its own degraded notes, loses the original instruction, and quietly drifts back to some default plan — it looks exactly like "the model forgot what I told it" but the instruction was compressed away, not buried under newer context. In our case that's an LLM-driven compaction step, but llama.cpp's own context-overflow handling (dropping/shifting earlier tokens once you hit n_ctx) is a different mechanism aimed at the same problem, and I'd expect it to have a similar failure shape if the system prompt happens to be what gets shifted out.
If the point is running weights entirely locally with no server dependency, llamafile is obviously the right tool for that — this isn't a "you should use something else" post. Just curious about this specific behavior: for people running long local agent sessions on llamafile, do you re-inject the system prompt/goal periodically to survive whatever eviction happens once context fills, or is there already a clean pattern (a flag, a wrapper, something in the server mode) for pinning it so it can't be shifted out?
All reactions