🌟 Nova: TableExporter for CLI Trajectory Inspection#622
Conversation
Introduces `TableExporter` leveraging `comfy-table` to summarize agent trajectories directly in the CLI using `max bench inspect --format table`. Safely handles string truncation and avoids panics on multi-byte UTF-8 boundaries. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new table output format for the inspect command, allowing trajectory messages to be exported as formatted UTF-8 tables using the comfy_table crate. It includes CLI argument updates, error handling adjustments, the implementation of TableExporter, and a corresponding unit test. Feedback on the changes suggests optimizing the string truncation logic in TableExporter by using .chars().nth(100).is_some() instead of .chars().count() to avoid traversing extremely large strings entirely, which could otherwise cause performance bottlenecks.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| let snippet = if content.chars().count() > 100 { | ||
| format!("{}...", content.chars().take(97).collect::<String>()) | ||
| } else { | ||
| content | ||
| }; |
There was a problem hiding this comment.
Using content.chars().count() to check if the string exceeds 100 characters requires traversing the entire string. Since trajectory messages (such as tool outputs or system prompts) can be extremely large, this can cause a significant performance bottleneck.
Using .chars().nth(100).is_some() is much more efficient as it stops iterating as soon as it finds the 101st character.
| let snippet = if content.chars().count() > 100 { | |
| format!("{}...", content.chars().take(97).collect::<String>()) | |
| } else { | |
| content | |
| }; | |
| let snippet = if content.chars().nth(100).is_some() { | |
| format!("{}...", content.chars().take(97).collect::<String>()) | |
| } else { | |
| content | |
| }; |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #622 +/- ##
=======================================
Coverage 85.40% 85.40%
=======================================
Files 116 116
Lines 67035 67076 +41
=======================================
+ Hits 57250 57288 +38
- Misses 9785 9788 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
💡 The Spark: "Trajectories can be dense and long. We already use
⚠️ Risk: "Low. Isolated in
comfy-tablefor aggregate metrics, but we don't have a way to view a single agent run as a high-level summary table."🚀 The Feature: "Implemented
TableExporterformax bench inspect --format tablethat summarizes a trajectory run with Turn, Role, and a snippet of Content."🔮 The Potential: "Allows rapid visual scanning of conversational cadence and tool loops directly in the terminal."
src/trajectory/export.rsandsrc/cli/mod.rs."PR created automatically by Jules for task 14103917948409284119 started by @madmax983