mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-07-30 15:01:15 +00:00
Slow local models (e.g. 27B quantised MLX models) can take 3–4+ minutes per iteration, well beyond the default 180s heartbeat timeout. Because last_active was only updated at the end of an iteration — never during it — the heartbeat monitor would flag the agent as unresponsive mid-call and initiate crash/recovery while the loop was still running correctly. Changes: - Add `touch()` to `AgentRegistry`: refreshes `last_active` with no other side-effects. - Add `touch_agent(&self, agent_id: &str)` to `KernelHandle` trait with a default no-op, so existing mock implementations require no changes. - Implement `touch_agent` on `OpenFangKernel`: parses the UUID and delegates to `registry.touch()`. - Call `kernel.touch_agent(agent_id)` at the top of each agent loop iteration, immediately before the `call_with_retry` LLM call. This resets the inactivity clock at the start of every iteration rather than only at completion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>