Skip to content

Kiro usage refresh can hang on process termination or inherited pipes #1533

@steipete

Description

@steipete

Problem

Kiro's usage command runner has two unbounded waits in the provider refresh path:

  • after timeout/idle termination it calls waitUntilExit() after only sending terminate
  • after process exit it calls readDataToEndOfFile() for stdout/stderr, which waits indefinitely when a descendant retains either inherited pipe

That can hold a Kiro provider refresh open after the parent CLI has exited or ignored SIGTERM.

Source reproduction

  • a short parent prints output, launches a detached child inheriting stdout/stderr, then exits; the current final EOF reads wait for the child
  • a process that ignores SIGTERM can leave the current timeout path blocked in waitUntilExit()

Fix shape

  • keep incremental stdout/stderr capture and idle-activity tracking
  • bound TERM-to-KILL escalation and post-exit drains
  • preserve completed no-output exit statuses for existing caller validation
  • add regressions for inherited pipes, ignored SIGTERM, and completed no-output failures
  • validate without live Kiro credentials or Keychain access

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExempts this issue from stale automation.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions