Skip to content

Commit 315ca31

Browse files
ziggyclaude
andcommitted
fix: reset idle timer on stderr activity, not just stdout
The idle timer was only resetting on stdout (user-facing results). The agent-runner logs all activity — tool calls, task notifications, SDK messages — to stderr. This meant the idle timer tracked 'time since last result sent' rather than 'time since any agent activity', causing false stall timeouts during legitimate long-running work like Task sub-agent research. Now any stderr output resets the idle timer. The absolute timeout (45min) remains as the hard ceiling. A genuine stall (frozen process, hung MCP server) still produces no stderr and is correctly caught by the idle timeout. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 71a1fc9 commit 315ca31

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/container-runner.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ export async function runContainerAgent(
365365

366366
agentProcess.stderr.on('data', (data) => {
367367
const chunk = data.toString();
368+
// Any stderr output means the agent is alive and working (tool calls,
369+
// task notifications, internal logs). Reset idle timer so long-running
370+
// sub-agent tasks don't trigger a false stall timeout.
371+
resetIdleTimer();
368372
const lines = chunk.trim().split('\n');
369373
for (const line of lines) {
370374
if (line) logger.debug({ agent: group.folder }, line);

0 commit comments

Comments
 (0)