Files
codex/codex-rs
T
jif 1547785657 app-server: clear stale thread watches after v2 agent interruption (#27166)
## Why

PR #27007 moved MultiAgentV2 interruption reporting from the legacy
collaboration close event to `SubAgentActivity::Interrupted`.
App-server's missing-thread cleanup still ran only for the legacy event,
so an interrupted child that had already been unloaded could remain
marked as loaded and running in `ThreadWatchManager`. That leaves thread
status and running-turn accounting stale, including the count used
during graceful shutdown.

## What changed

- Handle `SubAgentActivity::Interrupted` separately in app-server event
processing.
- Remove the child's thread watch when `ThreadManager` no longer has
that thread.
- Continue forwarding the same completed sub-agent activity notification
to clients.

## Testing

- Added a regression test that starts with a running watch for an
unloaded child, applies the interrupted activity event, and verifies the
watch is removed, the running count returns to zero, and the client
notification is still emitted.
1547785657 · 2026-06-09 13:27:53 +02:00
History
..
2026-06-08 16:33:41 -07:00
2026-05-18 21:33:05 -07:00
2026-06-08 16:33:41 -07:00
2026-06-08 16:33:41 -07:00
2026-06-04 09:16:03 -07:00