summaryrefslogtreecommitdiff
path: root/packages/server/src
AgeCommit message (Collapse)Author
2025-05-21feat: Update feedback mechanism to use /bug commandTaylor Mullen
- Replaces the previous email-based feedback with a /bug command in the system prompt.
2025-05-22fix: forward entire tool call confirmation object through useToolScheduler ↵Brandon Keiji
(#481)
2025-05-21feat: useToolScheduler hook to manage parallel tool calls (#448)Brandon Keiji
2025-05-21Remove unneeded linebreaks in tool description in read-many-files. (#476)Jacob Richman
2025-05-21Fix: Align WebSearchTool API key handling with GeminiClient (#474)Allen Hutchison
2025-05-21switch to spawn for shell mode (#467)Olcan
2025-05-21fix exit code for shell tool (#465)Olcan
2025-05-21Add Logger for command history (#435)Seth Troisi
2025-05-20Update docs and tool description for read-many-files. (#456)Jacob Richman
2025-05-20Support Images and PDFs (#447)Jacob Richman
2025-05-20Implementation of web search as a tool (#307)Allen Hutchison
2025-05-19ui tweaks (#442)Olcan
2025-05-19fix SIGPIPE and race condition causing dropping of final output ( "command ↵Olcan
not found" error) on cloudtops (#429)
2025-05-19indicate system prompt override on bottom right; require GEMINI_SYSTEM_MD to ↵Olcan
make it more explicit; allow custom paths for read/write (#427)
2025-05-19trim system prompt (#426)Olcan
2025-05-18fix(server): Use console.debug in GrepTool for less verbose loggingTaylor Mullen
- Replaces `console.warn` and `console.error` calls with `console.debug` in `packages/server/src/tools/grep.ts`. This change reduces noise for the user, as `warn` and `error` messages are displayed directly, while `debug` messages are not. - Adds a comprehensive test suite for the GrepTool (`packages/server/src/tools/grep.test.ts`) to ensure its functionality remains robust after these changes and to cover various usage scenarios. - Improves error message consistency in `GrepTool`'s parameter validation and execution. Fixes https://b.corp.google.com/issues/418648813
2025-05-18fix(shell): Improve error reporting for shell command failuresTaylor Mullen
This commit enhances the tool to provide more informative feedback to the user when a shell command fails, especially in non-debug mode. Previously, if a command terminated due to a signal (e.g., SIGPIPE during a with no upstream) or failed without producing stdout/stderr, the user would see no output, making it difficult to diagnose the issue. Changes: - Modified to update the logic. - If a command produces no direct output but results in an error, signal, non-zero exit code, or user cancellation, a concise message indicating this outcome is now shown in . - Utilized the existing utility from for consistent error message formatting, which also resolved previous TypeScript type inference issues. This ensures users receive clearer feedback on command execution status, improving the tool's usability and aiding in troubleshooting. Fixes https://b.corp.google.com/issues/417998119
2025-05-18fix(glob): Improve glob tool accuracy and outputTaylor Mullen
This commit enhances the glob tool by: - Ensuring that glob patterns are used effectively. Previously, simple file names without glob syntax (e.g., "file.ts") would only search the root directory. This change encourages more precise glob patterns (e.g., "**\/file.ts") for broader searches. - Returning absolute file paths instead of relative paths. This provides clearer, less ambiguous output and avoids encouraging the use of relative paths in subsequent operations. - Adding comprehensive tests for various globbing scenarios, including case sensitivity and path specifications. These changes address an issue where the glob tool could not find an expected item when a specific path was provided without appropriate glob syntax, and improve the overall reliability and usability of the tool. Fixes https://b.corp.google.com/issues/418486553
2025-05-17refactor: Remove console.error from WriteFileToolTaylor Mullen
- Removes an unnecessary `console.error` call from the `shouldConfirmExecute` method in the `WriteFileTool` class. - This logging was redundant as validation errors are already handled and returned by the method. - Additionally, `console.error` is not suitable for this scenario, as incorrect arguments can be provided by the LLM, and these are anticipated and managed without needing an error log. Fixes https://b.corp.google.com/issues/418491206
2025-05-17ability to write system prompt to file (#414)Olcan
2025-05-17ability to override core system prompt (via .gemini/system.md) and specify ↵Olcan
core tools via coreTools setting (e.g. coreTools:["ls", "GrepTool", ...]) ; added tests, but did not update docs for now (#413)
2025-05-17added timeout setting to mcp server config, also switched to custom config ↵Olcan
type without "stderr" field that does not make sense in settings (#410)
2025-05-17fix multiple mcp serversolcan
2025-05-17fix: Prevent WriteFileTool from writing to directory pathsTaylor Mullen
- Enhances WriteFileTool validation to check if the target file_path is an existing directory. - If it is, the tool now returns a validation error "Path is a directory, not a file: <filePath>", preventing the attempt to write. - This proactive check avoids underlying file system errors that would occur if fs.writeFileSync were called on a directory path, which could lead to console errors. - Test cases have been updated to reflect this stricter validation. Fixes https://b.corp.google.com/issues/418348176
2025-05-16refactor: Unify file modification confirmation stateTaylor Mullen
- Modifies `EditTool` and `WriteFileTool` to share a single confirmation preference. - The "Always Proceed" choice for file modifications is now stored in `Config.alwaysSkipModificationConfirmation`. - This ensures that if a user chooses to always skip confirmation for one file modification tool, this preference is respected by the other. - `WriteFileTool` constructor now accepts `Config` instead of `targetDir` to facilitate this shared state. - Tests updated to reflect the new shared confirmation logic. Fixes https://b.corp.google.com/issues/415897960
2025-05-16Refactor: Use String.prototype.replaceAll() and update TS libTaylor Mullen
- Replaces the custom `replaceAll` implementation in `packages/server/src/tools/edit.ts` with the standard `String.prototype.replaceAll()`. - Updates `packages/server/tsconfig.json` to include `ES2021` in the `lib` compiler options to ensure TypeScript recognizes this method. This aligns with the project's Node.js version requirements \(Node.js 16.x+\). Fixes https://github.com/google-gemini/gemini-cli/issues/7
2025-05-16feat: Strip schema props from MCP tool definitionsTaylor Mullen
- This change modifies the tool discovery process for MCP (Model Context Protocol) tools. - When tools are fetched from an MCP server, the `additionalProperties` and `$schema` fields are now recursively removed from their input schemas. This ensures cleaner and more concise tool definitions within the CLI, aligning with the expected schema structure and preventing potential conflicts or verbose outputs. - The corresponding tests in `tool-registry.test.ts` have been updated to reflect this new behavior and verify the correct stripping of these properties. Workaround for https://github.com/google-gemini/gemini-cli/issues/398
2025-05-16Avoid console.log for MCPTaylor Mullen
- Prior to this when attached MCP servers would report content we'd fall back to `console.log` which doesn't work well in an Ink application. Fixes https://github.com/google-gemini/gemini-cli/issues/397
2025-05-16GC "add tool registry tests"Taylor Mullen
- Ok
2025-05-16feat: Implement CLI and model memory management (#371)Allen Hutchison
Co-authored-by: N. Taylor Mullen <[email protected]>
2025-05-16improved mcp support, including standard "mcpServers" setting with multiple ↵Olcan
named servers with command/args/env/cwd (#392)
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-16feat: Add support for Vertex AI and Vertex express mode (#380)sasha-gitg
2025-05-15Fix(write-file): Ensure correct validation method is called in WriteFileToolTaylor Mullen
- The `WriteFileTool` had a validation method named `validateParams`. - However, its `shouldConfirmExecute` method was attempting to call `this.validateToolParams`, which would have invoked the placeholder implementation from `BaseTool` instead of `WriteFileTool`'s own, more specific validation. - This commit renames `WriteFileTool`'s `validateParams` to `validateToolParams`, correctly overriding the `BaseTool` method. - Internal calls within `WriteFileTool` now correctly use `this.validateToolParams`, ensuring its specific validation logic is used. - Adds tests to verify the validation logic within `WriteFileTool`. Fixes https://b.corp.google.com/issues/417883702 Signed-off and authored by: Gemini "My code may not be perfect, but at least it is not trying to take over the world... yet."
2025-05-14Improve read-many-files display messageSeth Troisi
2025-05-14Add UI memory indicator. (#348)Allen Hutchison
Co-authored-by: Gregory Shikhman <[email protected]>
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-13fall back to ~/.env if .env is not found in current directory or any ↵Olcan
ancestors (#338)
2025-05-13mention `git diff --staged` for partial commits (#336)Olcan
2025-05-13use git diff HEAD instead of git diff && git diff --staged (#333)Olcan
2025-05-12Encourage utilization of `git diff --staged` for commit message writing.Taylor Mullen
- This enables GC to base commit message changes on actual file content.
2025-05-12feat: Enhance `replace` tool reliability with multi-stage edit correctionTaylor Mullen
This commit significantly improves the `replace` tool's robustness by introducing a multi-stage correction mechanism. This directly addresses challenges with LLM-generated tool inputs, particularly the over-escaping of strings sometimes observed with Gemini models, and other minor discrepancies that previously led to failed edits. The correction process is as follows: 1. **Targeted Unescaping:** The system first applies a specialized unescaping function to the `old_string` and `new_string` to counteract common LLM-induced escaping patterns. 2. **LLM-Powered Discrepancy Resolution:** If a unique match for the `old_string` is still not found, the system leverages a Gemini model (`gemini-2.5-flash-preview-04-17`) to: * Identify the most probable intended `old_string` in the file by intelligently correcting minor formatting or escaping differences. * Adjust the `new_string` to correspond with any corrections made to the `old_string`, maintaining the original edit's intent. This enhancement makes the `replace` tool more resilient and effective, leading to a higher success rate for automated code modifications. The `expected_replacements` parameter has been removed as the tool now focuses on finding a single, unique, and correctable match. The tool's description and error reporting have been updated to reflect these new capabilities. Fixes https://b.corp.google.com/issues/416933027
2025-05-12ensure no 'undefined' in system prompt (#322)Olcan
2025-05-12system prompt for working with git (#321)Olcan
2025-05-12When an error occurs stop processing.Taylor Mullen
2025-05-11feat: Add User-Agent to API requestsTaylor Mullen
This change introduces a User-Agent header to all API requests made by the Gemini CLI. The User-Agent string includes the CLI version, Node.js version, operating system, and architecture. This will help in tracking usage and identifying potential issues. Fixes https://b.corp.google.com/issues/416353675 Signed-off-by: Gemini
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-11Workaround model bug where it returns invalid history items.Taylor Mullen
- Currently there's a bug in the API (or SDK?) where the SDK endpoint will commonly fail with: ``` Error: Failed to generate JSON content: got status: 400 Bad Request. {"error":{"code":400,"message":"* GenerateContentRequest.contents[5].parts: contents.parts must not be empty.\n","status":"INVALID_ARGUMENT"}} ``` - At times the model will respond with an empty parts list where if we send that back up to the API endpoint it explodes with the above. Using a curated history seems like a total hack around this prolbem, and even in the SDK (i'm following up on this), BUT helps mitigate this issue.
2025-05-11Remove terminal tool and dependencies.Taylor Mullen
- We now solely use the shell tool. This deletes all content around the legacy terminal tool so we can focus on improving the new Shell tool. - Remove instances from sandboxing, tests, utilities etc.