Skip to content

ClaudeCode streaming generation has no process-level idle timeout (bypasses shared runCliProcess) #277

Description

@ProfSynapse

Problem

AnthropicClaudeCodeAdapter's streaming generation path spawns its CLI child process directly via spawnDesktopProcess (~AnthropicClaudeCodeAdapter.ts:151) with its own close listener / readline loop — it does not go through the shared runCliProcess helper.

PR #276 added an idle/inactivity watchdog to runCliProcess (default 120s, re-armed on output → PROVIDER_TIMEOUT). That guards gemini generation + the two auth status callers, but not Claude Code streaming generation. So a wedged Claude Code process that never closes is bounded by neither the runner watchdog nor the chat-state clear (the placeholder isLoading is only cleared on terminal events that, by definition, never arrive for a hung process).

The chat-state fix in #276 still cures the common terminal-but-no-first-token case for Claude Code; this issue is specifically about the process-hang class.

Proposed direction

Bring AnthropicClaudeCodeAdapter's direct streaming spawn under the same idle/inactivity timeout discipline as the shared runner — either by routing it through a streaming-aware variant of runCliProcess, or by adding an equivalent re-armed idle watchdog to its own readline loop that surfaces PROVIDER_TIMEOUT.

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions