feat(core): phase 2 - add interactive task tree visualization (WIP)#21595
feat(core): phase 2 - add interactive task tree visualization (WIP)#21595TravisHaa wants to merge 5 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience by introducing an interactive task tree visualization. This new feature provides a clear, hierarchical view of tool and sub-agent calls, improving the understanding of complex agent workflows. It ensures that the visualization remains consistent across multiple interaction rounds and offers intuitive keyboard controls for navigation and interaction. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces an interactive task tree visualization. It has a security vulnerability related to ANSI injection, as LLM/tool output is rendered without sanitization, which could allow terminal UI manipulation. Sanitizing this data at the point of collection is crucial. Additionally, a functional issue in the collapseAll logic needs to be addressed to ensure all nodes are collapsed as expected.
- Add TaskTreeNode interface to ui/types.ts (wraps IndividualToolCallDisplay with children[], depth, isCollapsed, isFocused) - Implement useTaskTree hook: builds parent-child hierarchy from IndividualToolCallDisplay[] via parentCallId; promotes orphan children to roots; manages collapse/expand state (Set<string>) and keyboard focus; holds last completed snapshot visible briefly after tool calls drain - Accumulate tool calls across entire agent turn: allCurrentTurnToolCalls reads from both uiState.history (completed batches) and uiState.pendingHistoryItems (live batch) so the tree persists across multi-round-trip tool sequences - Add TaskNode component: branch connectors (├─ / └─ / │), status glyphs (✓ ● ✗ ⊘ ◷ ◌) + spinner, padded tool name, inline ToolResultDisplay, recursive children - Add TaskTree component: wires TOGGLE_COLLAPSE, COLLAPSE_ALL, EXPAND_ALL keyboard commands; shows completion badge during hold window - Wire TaskTree into MainContent; suppress all current-turn tool_group history items when tree is active (index > lastUserPromptIndex) - Add TOGGLE_COLLAPSE / COLLAPSE_ALL / EXPAND_ALL keybindings (→/←, Ctrl+[, Ctrl+]) - Add useTaskTree unit tests (17 tests) - WIP: display logic and hold-timer still being refined
…e children nodes Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
a86e882 to
43cf587
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces an interactive task tree visualization for tool calls, which is a significant UI enhancement. The implementation includes new components for the tree and nodes, a custom hook to manage the tree state, and updates to keybindings and main content rendering. The code is well-structured and includes comprehensive unit tests for the new hook. I've identified one high-severity memory leak in the useTaskTree hook where tool call timings were not being cleared between turns, and the suggested fix addresses this issue appropriately.
Summary
Creates task tree visualization for tool/sub-agent calls
Closes Phase 2 of #21484
Details
Prevously, in MainContent.tsx:43-51 — allPendingToolCalls is built only from pendingHistoryItems. When a batch of tool calls completes, those items are committed to uiState.history and removed from pendingHistoryItems. The tree then only sees the new (empty) pending batch → resets.
New Design: pull tool_group items from uiState.history that belong to the current turn (everything after
lastUserPromptIndex), and combine them with the pending batch of tool calls. Suppressed all current-turn
history tool_group items (not just the last one), since the tree now renders them.
Pre-Merge Checklist
Build & Quality
npm run buildpassesnpm run lintpassesnpm run typecheckpassesnpm testpasses (useTaskTree — 17 tests)Visual / Manual
restart)
Keyboard Navigation
Platform
npm run start -w packages/cli)