Skip to content

🌟 Nova: TableExporter for CLI Trajectory Inspection#622

Open
madmax983 wants to merge 1 commit into
trunkfrom
nova/table-exporter-14103917948409284119
Open

🌟 Nova: TableExporter for CLI Trajectory Inspection#622
madmax983 wants to merge 1 commit into
trunkfrom
nova/table-exporter-14103917948409284119

Conversation

@madmax983
Copy link
Copy Markdown
Owner

💡 The Spark: "Trajectories can be dense and long. We already use comfy-table for aggregate metrics, but we don't have a way to view a single agent run as a high-level summary table."
🚀 The Feature: "Implemented TableExporter for max bench inspect --format table that 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."
⚠️ Risk: "Low. Isolated in src/trajectory/export.rs and src/cli/mod.rs."


PR created automatically by Jules for task 14103917948409284119 started by @madmax983

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/trajectory/export.rs
Comment on lines +268 to +272
let snippet = if content.chars().count() > 100 {
format!("{}...", content.chars().take(97).collect::<String>())
} else {
content
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

❌ Patch coverage is 86.36364% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.40%. Comparing base (e98c81c) to head (0d2428c).

Files with missing lines Patch % Lines
src/cli/mod.rs 57.14% 3 Missing ⚠️
src/trajectory/export.rs 91.89% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant