[PR #188] [CLOSED] feat: improve TUI tool result rendering for ACP backend #186

Closed
opened 2026-02-27 10:22:38 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/188
Author: @jsamuel1
Created: 2/25/2026
Status: Closed

Base: mainHead: feat/tui-tool-result-rendering-and-kiro-acp-rename


📝 Commits (1)

  • 99fd178 feat: improve TUI tool result rendering for ACP backend

📊 Changes

1 file changed (+153 additions, -1 deletions)

View changed files

📝 crates/ralph-adapters/src/stream_handler.rs (+153 -1)

📄 Description

Summary

Parse ACP tool result JSON envelopes for readable TUI display

Previously, tool results from the ACP backend showed raw JSON in the TUI:

✓ {"items":[{"Json":{"exit_status":"exit status: 0","stderr":"","stdout":"diff --git..."}}]}

Now extracts and displays the meaningful content:

✓ diff --git a/ralph-config.txt b/ralph-config.txt...

Handles four ACP response patterns:

  • Shell results (Json with stdout/stderr): shows stdout, or stderr on failure
  • Glob results (Json with filePaths): shows 2 files: config.txt, notes.md
  • Text results: shows content directly
  • Empty text: suppresses the line entirely (e.g. successful file edits)

Falls back to raw string for non-JSON output (backwards compatible with Claude and other backends).

Also renames the internal backend identifier to kiro-acp for clarity.

Testing

  • 7 new unit tests for format_tool_result covering all ACP response patterns
  • All 402 existing tests pass (1 pre-existing failure in ralph-e2e unrelated)
  • Real ACP responses captured from live kiro-cli to validate JSON parsing
  • Passes cargo fmt, clippy, and pre-commit hooks

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mikeyobrien/ralph-orchestrator/pull/188 **Author:** [@jsamuel1](https://github.com/jsamuel1) **Created:** 2/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/tui-tool-result-rendering-and-kiro-acp-rename` --- ### 📝 Commits (1) - [`99fd178`](https://github.com/mikeyobrien/ralph-orchestrator/commit/99fd1786f0a310096d39b6e997be2d007993ced9) feat: improve TUI tool result rendering for ACP backend ### 📊 Changes **1 file changed** (+153 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/ralph-adapters/src/stream_handler.rs` (+153 -1) </details> ### 📄 Description ## Summary ### Parse ACP tool result JSON envelopes for readable TUI display Previously, tool results from the ACP backend showed raw JSON in the TUI: ``` ✓ {"items":[{"Json":{"exit_status":"exit status: 0","stderr":"","stdout":"diff --git..."}}]} ``` Now extracts and displays the meaningful content: ``` ✓ diff --git a/ralph-config.txt b/ralph-config.txt... ``` Handles four ACP response patterns: - **Shell results** (Json with stdout/stderr): shows stdout, or stderr on failure - **Glob results** (Json with filePaths): shows `2 files: config.txt, notes.md` - **Text results**: shows content directly - **Empty text**: suppresses the line entirely (e.g. successful file edits) Falls back to raw string for non-JSON output (backwards compatible with Claude and other backends). Also renames the internal backend identifier to `kiro-acp` for clarity. ### Testing - 7 new unit tests for `format_tool_result` covering all ACP response patterns - All 402 existing tests pass (1 pre-existing failure in ralph-e2e unrelated) - Real ACP responses captured from live kiro-cli to validate JSON parsing - Passes cargo fmt, clippy, and pre-commit hooks --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:22:38 +03:00
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#186
No description provided.