Consolidate command execution output into aggregated_output (#50402)

## What changed

- Remove `stdout`, `stderr`, and `formatted_output` from `CommandExecutionItem` and `ExecCommandEndEvent`, retaining `aggregated_output` as the output field.
- Update command event producers, legacy conversion, rollout traces, and the precomputed schema. Use aggregated output for terminal trace results.
- Clear `interaction_input` in emitted and migrated command completion items.

## Testing

Update command execution and trace tests to use aggregated output, and assert that legacy rollout migration preserves `aggregatedOutput`.

GitOrigin-RevId: ed59827d4a5ec9a767084ee4feac72c2042440f2
This commit is contained in:
Owen Lin
2026-10-02 18:48:49 +00:00
committed by copyberry
parent d61c7a824f
commit c5d242fa79
20 changed files with 47 additions and 167 deletions
@@ -277,16 +277,12 @@ pub(super) fn completed_item(
cwd: event.cwd.clone(),
parsed_cmd: event.parsed_cmd.clone(),
source: event.source,
interaction_input: event.interaction_input.clone(),
interaction_input: None,
status: event.status.clone().into(),
stdout: (!event.stdout.is_empty()).then(|| event.stdout.clone()),
stderr: (!event.stderr.is_empty()).then(|| event.stderr.clone()),
aggregated_output: (!event.aggregated_output.is_empty())
.then(|| event.aggregated_output.clone()),
exit_code: Some(event.exit_code),
duration: Some(event.duration),
formatted_output: (!event.formatted_output.is_empty())
.then(|| event.formatted_output.clone()),
}),
Some(event.turn_id.clone()),
)),
@@ -471,6 +471,7 @@ async fn migration_projects_explicit_and_implicit_legacy_completed_items() {
let reasoning: serde_json::Value =
serde_json::from_slice(&items.items[1].item_json).expect("parse projected reasoning");
assert_eq!(command["type"], "commandExecution");
assert_eq!(command["aggregatedOutput"], "ok");
assert_eq!(reasoning["type"], "reasoning");
assert_eq!(reasoning["summary"], json!(["summary"]));
assert_eq!(reasoning["content"], json!(["raw"]));