mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-07-12 13:04:57 +00:00
b68b3b12d7
Stale recovery sweeps traces by `start_time < NOW() - threshold`, which measures trace age rather than inactivity. Any threshold low enough to be useful (2-10 min) kills legitimate long-running agent runs: research chains, large code generation, extended shell commands routinely exceed 10 minutes. Disabled in Start() — function kept in place for easy re-enable once a `last_span_at` column is added so recovery can gate on "no activity for N minutes" instead of "started > N min ago". Trade-off: zombie traces from gateway crashes may remain `running` in DB. Accepted: primary abort path (router 2-phase + trace.status WS event) handles the common case; safety-net gap preferred over false kills of healthy runs. Integration test RecoverStaleNow() still works (manual trigger, not loop-dependent) so coverage of the recovery function itself is preserved for when it's re-enabled.