Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions crates/goose-cli/src/session/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,37 @@ fn print_params(value: &Value, depth: usize, debug: bool) {
print_params(val, depth + 1, debug);
}
Value::Array(arr) => {
println!("{}{}:", indent, style(key).dim());
for item in arr.iter() {
println!("{}{}- ", indent, INDENT);
print_params(item, depth + 2, debug);
// Check if all items are simple values (not objects or arrays)
let all_simple = arr.iter().all(|item| {
matches!(
item,
Value::String(_) | Value::Number(_) | Value::Bool(_) | Value::Null
)
});

if all_simple {
// Render inline for simple arrays, truncation will be handled by print_value if needed
let values: Vec<String> = arr
.iter()
.map(|item| match item {
Value::String(s) => s.clone(),
Value::Number(n) => n.to_string(),
Value::Bool(b) => b.to_string(),
Value::Null => "null".to_string(),
_ => unreachable!(),
})
.collect();
let joined_values = values.join(", ");
print!("{}{}: ", indent, style(key).dim());
// Use print_value to handle truncation consistently
print_value(&Value::String(joined_values), debug);
} else {
// Use the original multi-line format for complex arrays
println!("{}{}:", indent, style(key).dim());
for item in arr.iter() {
println!("{}{}- ", indent, INDENT);
print_params(item, depth + 2, debug);
}
}
}
_ => {
Expand Down
Loading