[GH-ISSUE #204] kiro-acp backend: orphaned processes, garbled TUI, missing output #77

Open
opened 2026-02-27 10:22:05 +03:00 by kerem · 1 comment
Owner

Originally created by @jsamuel1 on GitHub (Feb 26, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/204

Summary

Multiple issues when using the kiro-acp backend, particularly in subprocess TUI mode (the default).

Issues

1. Orphaned kiro-acp processes

After ralph exits (normal completion or Ctrl+C), kiro-cli acp and its MCP subprocess trees remain running as orphans (PPID=1). Repeated runs accumulate dozens of zombie process trees.

MCP subprocesses are spawned in separate process groups, so they escape standard process group signals during cleanup.

No graceful ACP shutdown is attempted — the session is never cancelled, so kiro-cli has no opportunity to clean up its MCP subprocesses.

2. Garbled TUI display

Two separate causes:

a) Subprocess stderr bleeds into the TUI. The child process (ralph run --rpc) logs to stderr, which is inherited by the parent TUI process. Log lines render directly on the terminal, overlapping the ratatui alternate screen layout.

b) Fragmented markdown rendering. Text deltas from the RPC event stream are individually parsed through termimad markdown rendering and appended as separate line groups. Markdown that spans multiple delta chunks (headings, lists, code blocks) renders incorrectly — broken formatting, duplicate elements, garbled output.

3. No content displayed in TUI with kiro-acp backend

The TUI content pane stays completely empty even though kiro-acp is actively working. The ACP executor does not emit JSON-RPC events to stdout when running in --rpc mode — it falls through to a console text handler instead. The parent TUI expects JSON lines and silently discards everything.

4. Tool call display issues

  • Tool call headers show no summary (e.g., ⚙ [ls] with no path) because ACP uses lowercase tool names (read, shell, ls, glob) that don't match the existing PascalCase mappings (Read, Bash, Glob).
  • Tool results display raw ACP JSON envelopes ({"items":[{"Json":{"exit_status":"exit status: 0","stdout":"..."}}]}) instead of the extracted meaningful content.
Originally created by @jsamuel1 on GitHub (Feb 26, 2026). Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/204 ## Summary Multiple issues when using the `kiro-acp` backend, particularly in subprocess TUI mode (the default). ## Issues ### 1. Orphaned kiro-acp processes After ralph exits (normal completion or Ctrl+C), `kiro-cli acp` and its MCP subprocess trees remain running as orphans (PPID=1). Repeated runs accumulate dozens of zombie process trees. MCP subprocesses are spawned in separate process groups, so they escape standard process group signals during cleanup. No graceful ACP shutdown is attempted — the session is never cancelled, so kiro-cli has no opportunity to clean up its MCP subprocesses. ### 2. Garbled TUI display Two separate causes: **a) Subprocess stderr bleeds into the TUI.** The child process (`ralph run --rpc`) logs to stderr, which is inherited by the parent TUI process. Log lines render directly on the terminal, overlapping the ratatui alternate screen layout. **b) Fragmented markdown rendering.** Text deltas from the RPC event stream are individually parsed through termimad markdown rendering and appended as separate line groups. Markdown that spans multiple delta chunks (headings, lists, code blocks) renders incorrectly — broken formatting, duplicate elements, garbled output. ### 3. No content displayed in TUI with kiro-acp backend The TUI content pane stays completely empty even though kiro-acp is actively working. The ACP executor does not emit JSON-RPC events to stdout when running in `--rpc` mode — it falls through to a console text handler instead. The parent TUI expects JSON lines and silently discards everything. ### 4. Tool call display issues - Tool call headers show no summary (e.g., `⚙ [ls]` with no path) because ACP uses lowercase tool names (`read`, `shell`, `ls`, `glob`) that don't match the existing PascalCase mappings (`Read`, `Bash`, `Glob`). - Tool results display raw ACP JSON envelopes (`{"items":[{"Json":{"exit_status":"exit status: 0","stdout":"..."}}]}`) instead of the extracted meaningful content.
Author
Owner

@jsamuel1 commented on GitHub (Feb 26, 2026):

These issues are a result of the parallel TUI subprocess refactor (#200) landing alongside the kiro-acp backend (#199) — the two features were developed in parallel and the integration points were missed. Fixes are in progress and will be pushed shortly.

<!-- gh-comment-id:3969309888 --> @jsamuel1 commented on GitHub (Feb 26, 2026): These issues are a result of the parallel TUI subprocess refactor (#200) landing alongside the kiro-acp backend (#199) — the two features were developed in parallel and the integration points were missed. Fixes are in progress and will be pushed shortly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ralph-orchestrator#77
No description provided.