Skip to content

upstream tracking: claude-code#39700 (stream-json hangs, never exits) NOT_PLANNED — codify post-result/stuck-after-tool_result watchdog as permanent #569

Description

Summary

The _post_result_idle_watchdog + subcountdown + SIGTERM machinery (#333, #470) and the stuck-after-tool_result detector (#322) exist because Claude Code's --output-format stream-json intermittently hangs — the process stops producing output and never exits.

Surfaced by the v0.35.3 Claude Code workaround-retirement audit (umbrella tracking issue).

Upstream status (checked 2026-05-29)

anthropics/claude-code#39700 — "[BUG] --output-format stream-json intermittently hangs — process stops producing output and never exits" — CLOSED / NOT_PLANNED.

(Sibling: anthropics/claude-code#30333 — ResultMessage never emitted — also NOT_PLANNED.)

Implication: this is NOT a retirement

Upstream declined to fix #39700, so the watchdog/SIGTERM safety net is a permanent mitigation, not a temporary workaround. Actions:

  1. Codify it as permanent in code comments + docs so a future cleanup doesn't mistake it for retire-able dead code.
  2. Guard the safety net during tracking: unified predicate-based stall detector — supersede the whack-a-mole pattern across releases #527's refactor. tracking: unified predicate-based stall detector — supersede the whack-a-mole pattern across releases #527 ("unified predicate-based stall detector") refactors when Untether warns. Ensure that refactor — and any detector-cleanup it performs — does not drop the actual kill-the-hung-process path (_post_result_idle_watchdog → SIGTERM → SIGKILL). The detector decides messaging; the watchdog decides survival; they must stay decoupled.
  3. Consider re-escalating upstream with fresh repros — the channelo/nsd post-result-hang sessions captured during v0.35.3 rc16/rc17 instrumentation (claude.post_result_idle.tick / subprocess.state.* logs) — in case Anthropic reconsiders.

Affected code

Done when


Part of the v0.35.3 Claude Code workaround-retirement audit (umbrella tracking issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions