Fix oMLX OOM stalls in Pi agent by adding a "reduce context" compact trigger
chibop1 · reddit · 2026-08-18
When running oMLX with the Pi agent, long sessions frequently hit out-of-memory errors and the agent simply stops — even with Memory guard set to aggressive and a sane context length — forcing manual compaction and resume.
The author's fix adds a compaction trigger word to Pi: clone the omlx repo, edit packages/ai/src/utils/overflow.ts, and below the line /token limit exceeded/i add /reduce context/i, then reinstall with npm install && npm run build and npm install -g ./packages/coding-agent.
The trick works because oMLX sends a stop error containing the phrase "reduce context" on context-related problems, so Pi now compacts regardless of the configured context length. The result: qwen-3.8-27b runs for hours overnight without intervention.
More from coding & agent
- Experiment: Giving Your AI a Brain You Own — dfinke · 2026-08-18
- Harvey's synthetic law firm agent shows enterprise knowledge retrieval — soumitrashukla9 · 2026-08-18
- Hermes Agent lets you build inline native widgets, like live BTC charts inside chat — NousResearch · 2026-08-18
- Codex desktop ships "More Details": highlight any text for an instant deep-dive — aniketapanjwani · 2026-08-18
- mermaid-ascii renders Mermaid diagrams as ASCII art right in your terminal — tom_doerr · 2026-08-18
- ComfyUI-MiniMax-H3-LongMedia: open-source node pack for long-form H3 video on consumer GPUs — Independent-Ear-3035 · 2026-08-18