Commit Graph

5385 Commits

Author SHA1 Message Date
Jarrod Whelan
77a5f3409b feat(ui): compact tool output implmentation
1. Scaffolding and Foundation Changes

- feat(cli): add compactToolOutput ui setting
- feat(cli): add DenseToolMessage component and supporting rendering logic
- feat(cli): implement compact tool output rendering logic in ToolGroupMessage
- feat(core): add tool display name constants and update tool constructors
- feat(cli): update compact output allowlist to use DISPLAY_NAME constants
- test(cli): add compact tool output rendering and spacing tests

2. Output Layout, Borders and Spacing

- fix(ui): update ToolGroupMessage to support stitched borders and dynamic margins
- fix(ui): implement border stitching in history pushing to eliminate gaps
- test(ui): update snapshots and test assertions for new layout
- style(ui): wrap dense tool payloads with vertical margins
    - Adds margins above and below dense payload content to allow compact output to consume a single line until expanded.
- fix(ui): unify spacing logic and border handling for tool groups
    - Corrects transitions between compact and standard tools to not add redundant empty lines and ensures history stitching respects boundaries.
- fix(ui): ensure top border is rendered within completed history for standard tool output when following compact tool output
    - Addresses an issue where non-compact tools pushed to history at the end of a batch (via onComplete) were missing their top border and proper margin if they followed compact tools already pushed to history.
    - The fix updates the onComplete callback in useGeminiStream.ts to be transition-aware. It now explicitly detects when a final push starts with a non-compact tool following a compact tool from the same batch, forcing borderTop: true in that case.
    - Previously, the logic relied solely on isFirstToolInGroupRef, which would be false if any earlier tools in the batch had already been pushed, causing the final non-compact tools to incorrectly inherit a borderless state from the preceding compact tools.

3. Tool Content Fixes/Changes

fix(core): use full file content for accurate diff stats in edit tool

 - Ensures the edit tool uses fully calculated new file content (instead of just the replacement snippet) when generating diff stats. This prevents the bug where 'mass deletion' were inaccurately reports in the UI.
 - The fix calculates the 'AI-recommended' full file state when user modifications are present. This allows getDiffStat to receive three full-file strings, maintaining accurate telemetry for AI vs. user contributions while fixing the visual bug.

feat(ui): structured compact payloads for list and grep tool output

 - leverages structured object return types (ReadManyFilesResult, ListDirectoryResult, GrepResult) to enable rich, expandable compact output in the CLI.
 - Updates the underlying core tools (read_many_files, ls, grep) to return these objects and wires up the UI in DenseToolMessage to parse and render them as expandable lists.

4. fix(cli,core): resolve build issues with structured tool result display

- Added `isStructuredToolResult` type guard to safely check for `summary` properties on tool results in `ToolResultDisplay`.
- Resolved `data.slice is not a function` errors in UI tests caused by structured tool results falling back to `AnsiOutput` parsing.
- Updated `DiffRenderer` assertions to include `disableColor: false`.
- Updated `ReadManyFilesTool` tests to assert against the new `ReadManyFilesResult` object structure instead of flat strings.
- wrap waitUntilReady in `act` to resolve spinner warnings

5. fix(cli): strengthen identity management and resolve key collisions / key duplication issues

- Improve history ID generation logic to be strictly increasing, preventing "Transition Race" collisions between pending and finalized items.
- Strengthen ID tracking to correctly handle session resumes by ensuring new IDs always start after the highest existing entry.
- Assign unique negative IDs and negatively indexed keys (`pending-${i}`) to pending history items in `MainContent`.
- Add a global `callIdCounter` to `acpClient` to safeguard against sub-millisecond tool call collisions.
- Harden `DenseToolMessage` rendering with stable string keys for conditional UI components.
- Update unit tests to verify strictly increasing ID generation and align with negatively indexed pending IDs.

6. consolidate Ctrl+O expansion toggle logic between shell tool and compact tool output; resolve rendering issues

Interaction:
- Unify SHOW_MORE_LINES (Ctrl+O) handler in AppContainer to atomically toggle height constraints and compact tool expansions.
- Update DenseToolMessage toggle text to "[click here to show/hide details]" for improved clarity.

Rendering:
- Adjust ToolGroupMessage and HistoryItemDisplay layout logic to correctly manage margins and spacing, especially after thinking blocks.
- Fix "Double Empty Line" issue by removing redundant top margins from the first tool in a group.
- Fix ToolStickyHeaderRegression test expectations to correctly account for 3-line headers.
- Update snapshots across multiple components to reflect layout and text refinements.
- Update generated docs and setting artifacts

Structural:
- Shifts large logic blocks within AppContainer.tsx to resolve functional dependencies related to keyboard handlers, user feedback events, and window titles.
- Hoist tool expansion state to AppContainer for centralized control and synchronized layout updates.
- Refactor ToolActionsContext.test.tsx to use real React state for verified behavior.

============================================

Rebase Cleanup

cleanup tasks
- remove redundant tool alias; simplify core tool error paths and data structures
- update default compact tool success summary text ("Returned")
- refactor ToolGroupMessage logic & border transitions across Compact, Standard, and Subagent output types

feat(ui): make result summary the *diff toggle target* and refine styling in dense output
- Makes the entire result summary (action word + stats) the clickable trigger for diff visibility.
- Styles the action word (e.g., "Accepted") with an underline to indicate interactivity.
- Removes the redundant "[click to show/hide details]" text to clean up the UI.
- Updates tests and snapshots to reflect the new interaction model.

fix(core): derive and preserve *diffstat* info for rejected edit operations
- Adds getDiffStatFromPatch utility to derive numeric stats from unified diff strings.
- Updates ToolEditConfirmationDetails to include an optional diffStat property.
- Modifies StateManager and CoreToolScheduler to populate diffStat when an edit/write is cancelled.
- Ensures the UI can display rich information (e.g., "+5, -2") for rejected operations.
- Adds a core test to verify correct stats derivation on tool rejection.

<<-- INTEGRATION OF SIGNIFICANT SUBAGENT CHANGES -->>

refactor(cli): consolidate pendingHistoryItems and remove shadowing in AppContainer

refactor(cli): refine tool layout and modernize test infrastructure

- fix(ui): remove default top margin (1 -> 0) for the first tool in a group
  - Aligns with dense output goal of reducing vertical whitespace.
  - Updates ToolGroupMessage.tsx to default borderTopOverride to false for margin calculation.
- refactor(test): modernize renderWithProviders and update affected tests
  - Removes the legacy useAlternateBuffer prop from renderWithProviders.
  - Shifts alternate buffer configuration to standard config and settings mocks for better consistency.
  - Updates DenseToolMessage.test.tsx and ShellToolMessage.test.tsx to use the new pattern.
  - Wraps waitUntilReady and waitFor calls in act to resolve React state update warnings.
- fix(ui): improve AskUserDialog layout and scroll visibility
  - Refines maxItemsToShow logic to properly account for available terminal height.
  - Ensures scroll arrows are correctly visible in alternate buffer mode.
- test(ui): update snapshots and assertions for tool layout regression tests
  - Updates ToolStickyHeaderRegression.test.tsx assertions to match the new 0-line margin layout.
  - Regenerates snapshots for AskUserDialog, DenseToolMessage, and ToolStickyHeaderRegression.

fix(ui): correct shell height calculation and modernize test utilities

- Update TOOL_RESULT_STANDARD_RESERVED_LINE_COUNT to 3 to match actual header overhead.
- Fix renderWithProviders to correctly respect useAlternateBuffer and dynamically load config.
- Ensure all tests await renderWithProviders for reliable component initialization.
- Refactor height calculation in tests to use layout constants and fix off-by-one errors.
- Add fake timer support to ShellToolMessage tests to resolve act() warnings from spinners.
- Refresh snapshots for MainContent, ShellToolMessage, and ToolResultDisplay.

refactor(cli): reduce code duplication while addressing /review-frontend feedback

fix(cli): resolve IDE client race condition and memory leak within `useEffect` hook in `ToolActionsContext.tsx`.

fix(cli): improve type safety for colorizeCode

- Adds function overloads to `colorizeCode` in `CodeColorizer.tsx` to correctly type the return value when `returnLines` is enabled.
- Removes unsafe `as React.ReactNode[]` cast and associated ESLint disable comment in `DenseToolMessage.tsx`.
- Adds a unit test in `CodeColorizer.test.tsx` to verify the `returnLines: true` contract.
2026-03-19 22:31:03 -07:00
gemini-cli-robot
46ec71bf0e Changelog for v0.35.0-preview.2 (#23142)
Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>
2026-03-19 19:43:48 +00:00
Sandy Tao
33f630111f feat(core): add experimental memory manager agent to replace save_memory tool (#22726)
Co-authored-by: Christian Gunderman <gundermanc@gmail.com>
2026-03-19 12:57:52 -07:00
Sam Roberts
b3ebab308e Docs: Minor style updates from initial docs audit. (#22872)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Jenna Inouye <jinouye@google.com>
2026-03-19 19:33:58 +00:00
Sandy Tao
4e5dfd0cb7 feat(core): cap JIT context upward traversal at git root (#23074) 2026-03-19 17:50:58 +00:00
Jacob Richman
524b1e39a5 Fix logging and virtual list. (#23080) 2026-03-19 17:50:49 +00:00
Abhi
32a123fc54 feat(core): inject memory and JIT context into subagents (#23032) 2026-03-19 17:16:09 +00:00
Tommaso Sciortino
23264ced9a refactor(cli): integrate real config loading into async test utils (#23040) 2026-03-19 17:05:33 +00:00
cynthialong0-0
7de0616229 fix(browser-agent): enable "Allow all server tools" session policy (#22343) 2026-03-19 16:32:35 +00:00
joshualitt
39d3b0e28c feat(cli): Partial threading of AgentLoopContext. (#22978) 2026-03-19 16:02:13 +00:00
Gaurav
5acaacad96 fix(core): narrow browser agent description to prevent stealing URL tasks from web_fetch (#23086) 2026-03-19 10:45:59 +00:00
Jason Matthew Suhari
a921bcd9ef fix(core): don't persist browser consent sentinel in non-interactive mode (#23073) 2026-03-19 06:47:13 +00:00
Sri Pasumarthi
e9171fd792 fix: circumvent genai sdk requirement for api key when using gateway auth via ACP (#23042) 2026-03-19 04:31:02 +00:00
Adam Weidman
2009fbbd92 feat(core): add content-utils (#22984) 2026-03-19 02:30:48 +00:00
Bryan Morgan
8db2948361 fix(cli): correctly handle auto-update for standalone binaries (#23038) 2026-03-19 01:52:23 +00:00
Abhi
5fa14dbe42 feat(core): resilient subagent tool rejection with contextual feedback (#22951) 2026-03-19 01:09:37 +00:00
Suraj Sahani
e6cd5d208c docs: add FAQ entry for checking Gemini CLI version (#21271) 2026-03-19 00:25:33 +00:00
Valery Teplyakov
c9d48026c4 fix(acp): provide more meta in tool_call_update (#22663)
Co-authored-by: Mervap <megavaprold@gmail.com>
Co-authored-by: Sri Pasumarthi <sripas@google.com>
2026-03-19 00:02:07 +00:00
Dev Randalpura
34f271504a fix(ui): fix flickering on small terminal heights (#21416)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
2026-03-18 21:28:21 +00:00
gemini-cli-robot
d68100e6bc Changelog for v0.35.0-preview.1 (#23012)
Co-authored-by: g-samroberts <158088236+g-samroberts@users.noreply.github.com>
2026-03-18 20:55:55 +00:00
ruomeng
94e6bf8591 fix(cli): resolve duplicate footer on tool cancel via ESC (#21743) (#21781) 2026-03-18 20:27:38 +00:00
Abhi
fd44718bfe docs: add additional notes (#23008) 2026-03-18 20:24:51 +00:00
Emily Hedlund
f6e21f50fd feat(core): implement strict macOS sandboxing using Seatbelt allowlist (#22832) 2026-03-18 20:07:54 +00:00
ruomeng
1725ec346b feat(plan): support plan mode in non-interactive mode (#22670) 2026-03-18 20:00:26 +00:00
AK
c12fc340c1 fix(core): explicitly map execution context in LocalAgentExecutor (#22949)
Co-authored-by: cynthialong0-0 <82900738+cynthialong0-0@users.noreply.github.com>
2026-03-18 19:54:48 +00:00
Aditya Bijalwan
b6d5374fb7 Feat/browser privacy consent (#21119) 2026-03-18 19:33:24 +00:00
Christian Gunderman
0082e1ec97 Fix issue where subagent thoughts are appended. (#22975) 2026-03-18 19:20:31 +00:00
ANIRUDDHA ADAK
0ed9f1e7f5 feat(ui): remove write todo list tool from UI tips (#22281)
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
Co-authored-by: anj-s <32556631+anj-s@users.noreply.github.com>
2026-03-18 19:06:42 +00:00
Sam Roberts
adf21df71e Docs: Remove references to stale Gemini CLI file structure info (#22976) 2026-03-18 18:43:56 +00:00
Keith Guerin
4dcca1ca10 feat(ui): format multi-line banner warnings with a bold title (#22955)
Co-authored-by: Sehoon Shon <sshon@google.com>
2026-03-18 18:39:12 +00:00
Tommaso Sciortino
a5a461c234 test(cli): simplify createMockSettings calls (#22952) 2026-03-18 18:12:44 +00:00
gemini-cli-robot
fac3661980 Changelog for v0.34.0 (#22860)
Co-authored-by: gemini-cli-robot <224641728+gemini-cli-robot@users.noreply.github.com>
2026-03-18 17:23:05 +00:00
Tommaso Sciortino
d7dfcf7f99 refactor(cli): simplify keypress and mouse providers and update tests (#22853) 2026-03-18 16:38:56 +00:00
Abhi
81a97e78f1 refactor(cli): group subagent trajectory deletion and use native filesystem testing (#22890) 2026-03-18 14:42:15 +00:00
jhhornn
1311e8c480 fix: updates Docker image reference for GitHub MCP server (#22938) 2026-03-18 14:32:57 +00:00
Abhi
4ecb4bb24b refactor(ui): extract SessionBrowser search and navigation components (#22377) 2026-03-18 04:44:01 +00:00
Abhi
be7c7bb83d fix(cli): resolve subagent grouping and UI state persistence (#22252) 2026-03-18 03:11:20 +00:00
AK
7bfe6ac418 feat(core): subagent local execution and tool isolation (#22718) 2026-03-18 02:34:44 +00:00
adithya32
bd34a42ec3 fix(cli): lazily load settings in onModelChange to prevent stale closure data loss (#20403)
Co-authored-by: Spencer <spencertang@google.com>
2026-03-18 00:40:38 +00:00
N. Taylor Mullen
e2658ccda8 refactor(cli): remove extra newlines in ShellToolMessage.tsx (#22868)
Co-authored-by: Spencer <spencertang@google.com>
2026-03-17 23:48:16 +00:00
anj-s
b8719bcd47 feat: add 'blocked' status to tasks and todos (#22735) 2026-03-17 23:24:26 +00:00
Sakshi semalti
e1eefffcf1 fix(cli): automatically add all VSCode workspace folders to Gemini context (#21380)
Co-authored-by: Spencer <spencertang@google.com>
2026-03-17 23:05:49 +00:00
Alisa
7ae39fd622 feat(a2a): add agent acknowledgment command and enhance registry discovery (#22389) 2026-03-17 22:47:05 +00:00
N. Taylor Mullen
fb9264bf80 chore: add posttest build hooks and fix missing dependencies (#22865) 2026-03-17 22:23:00 +00:00
anj-s
d4397dbfc5 feat(tracker): integrate task tracker protocol into core system prompt (#22442) 2026-03-17 22:19:36 +00:00
Spencer
5fb0d1f01d fix(core): add actionable warnings for terminal fallbacks (#14426) (#22211) 2026-03-17 21:57:37 +00:00
Abhi
95bca2c3b3 fix(cli): expand tilde in policy paths from settings.json (#22772) 2026-03-17 21:48:24 +00:00
matt korwel
e0be1b2afd fix(cli): use active sessionId in useLogger and improve resume robustness (#22606) 2026-03-17 21:42:40 +00:00
gemini-cli-robot
5d4e4c2814 chore(release): bump version to 0.36.0-nightly.20260317.2f90b4653 (#22858) 2026-03-17 21:18:21 +00:00
kevinjwang1
27a50191e3 Add support for dynamic model Resolution to ModelConfigService (#22578) 2026-03-17 21:15:50 +00:00