Render streamed command output through preview iterators (#34357)

## What changed

- Encapsulate aggregated command output behind APIs for total and retained line
  counts, reversible preview iteration, and full transcript iteration.
- Build truncated command previews from the retained head and tail lines while
  preserving the logical omitted-line count.
- Cover head/tail rendering for long streamed agent and user-shell output.

GitOrigin-RevId: 54b23a19e4639e24c5e4778082edbbc6484ecf80
This commit is contained in:
Charlie Marsh authored and copyberry committed 2026-07-20 14:27:39 +00:00
1 parent 2661d8577e
commit 20440a0833
6 files changed
+104 -68

No files matched your search

+1 -4
View File
@@ -43,10 +43,7 @@ pub(crate) fn new_patch_apply_failure(stderr: String) -> PlainHistoryCell {
if !stderr.trim().is_empty() {
let output = output_lines(
Some(&CommandOutput {
exit_code: 1,
aggregated_output: stderr,
}),
Some(&CommandOutput::new(/*exit_code*/ 1, stderr)),
OutputLinesParams {
line_limit: TOOL_CALL_MAX_LINES,
only_err: true,
+2 -8
View File
@@ -1912,10 +1912,7 @@ fn stderr_tail_more_than_five_lines_snapshot() {
.join("\n");
cell.complete_call(
&call_id,
CommandOutput {
exit_code: 1,
aggregated_output: stderr,
},
CommandOutput::new(/*exit_code*/ 1, stderr),
Duration::from_millis(1),
);
@@ -1959,10 +1956,7 @@ fn ran_cell_multiline_with_stderr_snapshot() {
let stderr = "error: first line on stderr\nerror: second line on stderr".to_string();
cell.complete_call(
&call_id,
CommandOutput {
exit_code: 1,
aggregated_output: stderr,
},
CommandOutput::new(/*exit_code*/ 1, stderr),
Duration::from_millis(5),
);