- compact at memory-safe token budget (~20k) not the 131k window; gpt-oss
hits oMLX's prefill memory guard ~47k tokens on a 24GB machine
- repair invalid_tool_calls (malformed JSON args) before echoing history —
LangChain serializes the raw malformed string which oMLX 500s on
- retry invokes (4x) with an oMLX watchdog restart between attempts
- ALWAYS finalize: salvage picks from findings even after invoke failures
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016DvdRZkyCy9NJpHYDdPqmS