Fix stall watchdog killing agent during long LLM reasoning turns

Move emitter.touch() before the event filter in spawn_event_forwarder
so streaming events (TextDelta, AssistantTextStart, etc.) also reset
the watchdog timer. Previously these were filtered out, causing the
600s stall watchdog to fire during long generation turns with no
tool calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-07 16:49:54 -05:00
parent 8d4fcba6e4
commit 02a10b2f8d

View file

@ -43,6 +43,9 @@ fn spawn_event_forwarder(
let mut rx = session.subscribe();
tokio::spawn(async move {
while let Ok(event) = rx.recv().await {
// Reset watchdog on every event, including streaming deltas
emitter.touch();
// Track file changes from tool calls
match &event.event {
AgentEvent::ToolCallStarted {