You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e578131
Browse filesBrowse the repository at this point in the historyBrowse files
fix(server): idle reaper no longer kills in-flight background agent work
ProviderSessionReaper stopped any provider session after 30 min of
last_seen_at inactivity, with session.activeTurnId as its only busy
guard. Background work (dynamic workflows, subagents, background
shells) outlives the foreground turn, and nothing refreshed
last_seen_at from runtime activity - not even later foreground or
synthetic follow-up turns - so live sessions were torn down mid-run
and their background orchestration silently lost.
- Refresh last_seen_at from provider runtime events via a targeted
touchLastSeen (throttled per thread, armed only on a successful
write of a live row, never resurrecting stopped rows, bounded by a
timeout so a stalled write cannot block the event pump).
- Track started-but-not-terminal background tasks in memory and have
the reaper skip threads with outstanding tasks, even if a task is
temporarily quiet; a staleness ceiling (3x the reap threshold of
total task-event silence) settles presumed-dead entries so a
stranded entry cannot pin a thread forever.
- On stopSession/runStopAll/session.exited, publish synthetic
terminal task.completed(status: "stopped") events for whatever is
still outstanding, so a torn-down task records a terminal activity
instead of leaving an orphaned spinner.
The activeTurnId guard is preserved unchanged. Regression tests cover
the reaper guard (not reaped while a task is outstanding, reapable
after it settles), touch semantics, throttling, and the backstop.
Closes#4198
Co-authored-by: Chamaru Amasara <[email protected]>
0 commit comments