summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.ts
AgeCommit message (Collapse)Author
2025-06-03feat: notify user when chat context is compressed (#724)Brandon Keiji
2025-06-03Refactor: Use config.getGeminiClient() for GeminiClient instantiation (#715)N. Taylor Mullen
2025-06-02refactor: maintain 1 GeminiChat per GeminiClient (#710)Brandon Keiji
2025-06-02feat(cli): add pro model availability check and fallback to flash (#608)Allen Hutchison
2025-06-02fix: Ensure all tool calls are complete before submitting responses (#689)N. Taylor Mullen
2025-06-01refactor: Centralize tool scheduling logic and simplify React hook (#670)N. Taylor Mullen
2025-05-30Rename server->core (#638)Tommaso Sciortino
2025-05-30tweaks to shell abort logic based on feedback (#618)Olcan
2025-05-30allow aborting of shell mode (!) commands, similar to shell tool commands. ↵Olcan
fix bug that prevented aborts after first abort. more robust killing logic (#616)
2025-05-29Refactor read-file and support images. (#480)Jacob Richman
2025-05-27live output from shell tool (#573)Olcan
2025-05-26Refactor(chat): Introduce custom Chat class for future modificationsTaylor Mullen
- Copied the `Chat` class from `@google/genai` into `packages/server/src/core/geminiChat.ts`. - This change is in preparation for future modifications to the chat handling logic. - Updated relevant files to use the new `GeminiChat` class. Part of https://github.com/google-gemini/gemini-cli/issues/551
2025-05-25Fix(cli): Prevent premature input box reactivation during tool confirmationTaylor Mullen
- Introduced a 'validating' state for tool calls to prevent the input box from reappearing while waiting for a tool's `shouldConfirmExecute` method to complete. - When a tool call is initiated, it's now immediately set to a 'validating' status. This ensures the UI remains in a busy/responding state. - `useGeminiStream` now considers the 'validating' state as part of `StreamingState.Responding`. - `useToolScheduler` has been updated to: - Set the initial status of new tool calls to 'validating'. - Asynchronously perform the `shouldConfirmExecute` check. - Transition to 'awaiting_approval' or 'scheduled' based on the check's outcome. - This resolves an issue where a slow `shouldConfirmExecute` could lead to the input prompt becoming active again before the tool call lifecycle was fully determined. While 'validating' is currently treated similarly to 'executing' in the UI, this new state provides a foundation for more customized user experiences during this phase in the future. Fixes https://github.com/google-gemini/gemini-cli/issues/527
2025-05-24Code review comment fixes and some refactors. (#525)Jacob Richman
No intentional different behavior aside for tweaks suggested from the code review of #506 Refactor: Extract console message logic to custom hook This commit refactors the console message handling from App.tsx into a new custom hook useConsoleMessages. This change improves the testability of the console message logic and declutters the main App component. Created useConsoleMessages.ts to encapsulate console message state and update logic. Updated App.tsx to utilize the new useConsoleMessages hook. Added unit tests for useConsoleMessages.ts to ensure its functionality. I deleted and started over on LoadingIndicator.test.tsx as I spent way too much time trying to fix it before just regenerating the tests as the code was easier to write tests for from scratch and the existing tests were not that good (I added them in the previous pull request).
2025-05-23feat: Modify loading indicator to support a paused state (#506)Jacob Richman
2025-05-23Refactor(cli): Move memory add logic to server tool call (#493)Allen Hutchison
2025-05-23Refactor: Update streaming state logic to hide loader during confirmationTaylor Mullen
- The streaming state logic in `useGeminiStream.ts` has been updated. - Previously, the loading indicator was displayed even when the system was waiting for user confirmation on a tool call. - This change introduces a `WaitingForConfirmation` state to ensure the loading indicator is hidden during these confirmation prompts, improving the user experience.
2025-05-22fix: cancel parallel tool calls mid-execution (#489)Brandon Keiji
2025-05-22fix: synchronization between executed tools and turn loops (#488)Brandon Keiji
2025-05-21feat: useToolScheduler hook to manage parallel tool calls (#448)Brandon Keiji
2025-05-21use pending history item for shell mode, update as output is received (#471)Olcan
2025-05-21Add Logger for command history (#435)Seth Troisi
2025-05-20fix(cli): Prevent request cancellation after multiple Esc pressesTaylor Mullen
- Ensures `abortControllerRef` is reset after a request is aborted or completed. - Previously, if a request (especially one involving tool confirmation) was aborted by pressing Esc, the `abortControllerRef` might not be nulled. - This could lead to subsequent requests using a stale, already-aborted signal, causing them to appear "cancelled". - The fix unconditionally sets `abortControllerRef.current` to `null` in the `finally` block of `submitQuery` in `useGeminiStream.ts`. - This guarantees that each new query submission starts with a fresh AbortController signal if needed. - Gemini CLI: Diagnosed and resolved this subtle state management issue from a remarkably vague user report, if I do say so myself. Fixes https://buganizer.corp.google.com/issues/418496499
2025-05-20Support Images and PDFs (#447)Jacob Richman
2025-05-19fix: Ensure user written `!` is treated opaquely if not in shell mode\n\n- ↵Taylor Mullen
Addresses an issue where commands prefixed with `!` (e.g., `!ls`) were incorrectly handled by the shell command processor if the `!` was added after initially typing the command.\n- Ensures that such commands are correctly forwarded to the Gemini model.\n- Updates `useGeminiStream` to be aware of shell mode to properly manage streaming state.\n\nFixes https://buganizer.corp.google.com/issues/418761305
2025-05-16fix: Ensure filename is available for diff rendering in write-fileTaylor Mullen
This commit resolves a bug where the `write-file` operation could fail to render content due to a missing filename. The fix involves: - Ensuring `fileName` is consistently passed to `DiffRenderer.tsx` through `ToolConfirmationMessage.tsx`, `ToolMessage.tsx`, and `useGeminiStream.ts`. - Modifying `edit.ts` and `write-file.ts` to include `fileName` in the `FileDiff` object. - Expanding the `FileDiff` interface in `tools.ts` to include `fileName`. Additionally, this commit enhances the diff rendering by: - Adding syntax highlighting based on file extension in `DiffRenderer.tsx`. - Adding more language mappings to `getLanguageFromExtension` in `DiffRenderer.tsx`. - Added lots of tests for all the above. Fixes https://b.corp.google.com/issues/418125982
2025-05-16refactor: derive streaming state from tool calls and isresponding state (#376)Brandon Keiji
2025-05-15refactor: remove unused props clearItems, openThemeDialog, onSubmit (#357)Brandon Keiji
2025-05-14refactor: break submitQuery into smaller functions (#350)Brandon Keiji
2025-05-14This commit introduces the hierarchical memory feature, allowing GEMI… (#327)Allen Hutchison
2025-05-13refactor: move nested debugmessage and slashcommand hooks outside of ↵Brandon Keiji
useGeminiStream (#341)
2025-05-13Prevent flickering on confirmation decline.Taylor Mullen
- When larger confirmations were shown and then declined you'd typicaly get large chunks of content flickering upon typing or sending a subsequent request. This was primarily due to us leaving the latest confirmation as "updateable" / pending. This changeset addresses that by flushing any pending confirmation to the static container. Part of https://b.corp.google.com/issues/414196943
2025-05-12When an error occurs stop processing.Taylor Mullen
2025-05-11feat: Integrate centralized error reporting for API interactionsTaylor Mullen
Implements robust error handling for Gemini API calls, integrating with the centralized error reporting system. - API errors are now caught and reported to dedicated log files, providing detailed diagnostics without cluttering the user interface. - A concise error message is surfaced to the user in the UI, indicating an API issue. - Ensures any pending UI updates are processed before an API error is displayed. This change improves our ability to diagnose API-related problems by capturing rich error context centrally, while maintaining a clean user experience. Signed-off-by: Gemini <[email protected]>
2025-05-10Show model decline/cancellation states.Taylor Mullen
- Upon decline / cancellation we weren't showing the model the cancellation status or states. Therefore it didn't know why things would or wouldn't happen Fixes https://b.corp.google.com/issues/416797704
2025-05-10Enable tools to cancel active execution.Taylor Mullen
- Plumbed abort signals through to tools - Updated the shell tool to properly cancel active requests by killing the entire child process tree of the underlying shell process and then report that the shell itself was canceled. Fixes https://b.corp.google.com/issues/416829935
2025-05-09Make cancel not explode.Taylor Mullen
- We were console.erroring, throwing and early aborting. Instead we now treat cancels like a normal user message and show an indicator in the UI Fixes https://b.corp.google.com/issues/416515841
2025-05-07initTae Hyung Kim
2025-05-07Remove unnecessary sleep.Taylor Mullen
- Code review comment: https://github.com/google-gemini/gemini-code/pull/271#pullrequestreview-2821741430
2025-05-07Fix bugs from useGeminiStream refactor (#284)Tae Hyung Kim
2025-05-07Fix flicker in iterm2 (#266)Tae Hyung Kim
2025-05-06Prevent UI hang on long tool confirmations.Taylor Mullen
Problem: When a tool confirmation dialog appeared for a potentially long-running operation (e.g., `npm install`), accepting the confirmation would cause the UI to appear to hang. The confirmation dialog would remain visible, and no further UI updates would occur until the long-running task completed. This provided a poor user experience as the application seemed unresponsive. Fix: This change addresses the issue by ensuring the UI is updated to remove the confirmation dialog *before* the long-running operation begins. It also marks the tool as executing so a spinner can be shown. Fixes https://b.corp.google.com/issues/415844994 Signed, sealed, delivered, it's yours! - Gemini, your friendly neighborhood code-slinger
2025-05-06Fix edit confirmation re-submission.Taylor Mullen
- This broke in [this commit](https://github.com/google-gemini/gemini-code/commit/7d13f242887f4204a2c8a0ca719e121621472db9#diff-e257a7e5e02896371ce002da8963abdb91f5c77990d38e3d2f7ea07e5b19e32eR428)
2025-05-06refactor(cli): Centralize history management via useHistoryManager hook (#261)Allen Hutchison
2025-05-06Refactor: Memoize hook callbacks, update dependencies, and fix lint errors ↵Allen Hutchison
(#268) Co-authored-by: N. Taylor Mullen <[email protected]>
2025-05-05Move Intro to Help and only display after help command.Seth Troisi
2025-05-05Remove passthroughCommands (#252)Seth Troisi
2025-05-05Have /clear clear <Static> content by remounting (#250)Seth Troisi
2025-05-02Cleanup low value comments. (#248)Jacob Richman
2025-04-30Moved theme to slashCommandSeth Troisi