Skip to content

Bundled CLI v2.1.88 broken on Cloud Run — subprocess transport timeout #2

@sugi-chan

Description

@sugi-chan

Problem

The Claude CLI bundled with claude-agent-sdk (v2.1.88) has a broken subprocess transport that causes Control request timeout: initialize when spawning judge board panelists on Cloud Run.

shutil.which("claude") returns None on Cloud Run (no system CLI installed), so simmer-sdk falls back to the bundled binary, which fails intermittently or consistently depending on the environment.

Observed behavior

  • Judge board panelists time out during initialization
  • The error is flaky — sometimes works, sometimes doesn't, depending on resource contention (2 CLI processes competing for CPU/memory)
  • When it does "work" with the broken CLI, judges may return stale/default scores (possibly related to Regression detection should use primary criterion, not just composite #1's flat scoring issue)

Workaround

Install the system Claude CLI in the Docker image:

RUN apt-get update && apt-get install -y nodejs npm && \
    npm install -g @anthropic-ai/claude-code

This gives shutil.which("claude") a path to v2.1.90+ which works correctly.

Suggested fixes

  1. Detect broken version — if the bundled CLI is < v2.1.90, warn and suggest installing system CLI
  2. Add cli_path parameter to refine() — let callers specify a known-good binary path
  3. Update bundled CLI — ship a working version with claude-agent-sdk
  4. Fallback to direct API — if CLI init times out, fall back to AsyncAnthropic.messages.create() without tool access (degrades quality but doesn't crash)

Environment

  • Cloud Run Jobs (1 CPU, 2GB memory)
  • Python 3.13
  • claude-agent-sdk bundled CLI v2.1.88
  • System CLI v2.1.90 (installed via npm) fixes the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions