Commit Graph

140 Commits

Author SHA1 Message Date
Brandon Keiji e34b1fe782 infra: emit errors on no-explicit-any eslint rule (#516) 2025-05-23 22:35:50 +00:00
Taylor Mullen e68c69594e fix: Update dependencies to resolve deprecation warnings 2025-05-23 14:50:00 -07:00
cornmander a83ef4b13b MCP SSE support (#511)
Matches the config format used by other MCP clients.
2025-05-23 17:19:30 -04:00
Brandon Keiji 4bc9be3230 fix: do not retry cancelled tool calls (#504) 2025-05-23 17:30:09 +00:00
Jordan Demeulenaere 3370b38773 Mention Kotlin & Compose (Mutliplatform) in prompt.ts 2025-05-23 10:14:54 -07:00
Allen Hutchison 858be0e9c5 Refactor(server): Centralize GEMINI.md discovery logic in server (#498) 2025-05-23 08:53:22 -07:00
Allen Hutchison 80e61b941e Fix(server): Ensure debug responses are not recorded after cancellation (#491) 2025-05-22 16:34:32 -07:00
N. Taylor Mullen edb3edf6be Refactor: Consolidate and clarify core mandates and guidelines (#482)
Co-authored-by: Allen Hutchison <adh@google.com>
2025-05-22 22:42:33 +00:00
Brandon Keiji c087cba2c6 fix: add shell-quote to server deps (#492) 2025-05-22 20:44:51 +00:00
Allen Hutchison 68a5eec345 Fix: Prevent hang in large directories by using BFS for getFolderStru… (#470)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-05-22 10:47:21 -07:00
Brandon Keiji 4eea2e594b fix: synchronization between executed tools and turn loops (#488) 2025-05-22 02:51:07 -07:00
Taylor Mullen 495b3a7c56 feat: Update feedback mechanism to use /bug command
- Replaces the previous email-based feedback with a /bug command in the system prompt.
2025-05-21 23:32:54 -07:00
Brandon Keiji 3aa1485865 fix: forward entire tool call confirmation object through useToolScheduler (#481) 2025-05-22 06:00:36 +00:00
Brandon Keiji 854de99e34 feat: useToolScheduler hook to manage parallel tool calls (#448) 2025-05-21 22:57:53 -07:00
Allen Hutchison b0075bacba Feat: Add test coverage scripts and ignore reports (#477) 2025-05-21 17:03:22 -07:00
Jacob Richman 2ed6993f83 Remove unneeded linebreaks in tool description in read-many-files. (#476) 2025-05-21 16:59:23 -07:00
Allen Hutchison a2f7f14a9d Fix: Align WebSearchTool API key handling with GeminiClient (#474) 2025-05-21 15:50:53 -07:00
Olcan c6fdf8d23e switch to spawn for shell mode (#467) 2025-05-21 09:31:13 -07:00
Olcan 5885bbcf2e fix exit code for shell tool (#465) 2025-05-21 08:51:22 -07:00
Seth Troisi d913d44981 Add Logger for command history (#435) 2025-05-21 00:36:22 -07:00
Jacob Richman 125d12c368 Update docs and tool description for read-many-files. (#456) 2025-05-20 16:32:49 -07:00
Jacob Richman 042b85a4dc Support Images and PDFs (#447) 2025-05-20 13:02:41 -07:00
Allen Hutchison 7e52f72da1 Implementation of web search as a tool (#307) 2025-05-20 11:36:21 -07:00
Olcan 3273cbcb6c ui tweaks (#442) 2025-05-19 16:58:57 -07:00
Olcan 8d825eed26 fix SIGPIPE and race condition causing dropping of final output ( "command not found" error) on cloudtops (#429) 2025-05-19 13:16:11 -07:00
Olcan da4c0ee589 indicate system prompt override on bottom right; require GEMINI_SYSTEM_MD to make it more explicit; allow custom paths for read/write (#427) 2025-05-19 11:03:04 -07:00
Olcan 6eeb95b126 trim system prompt (#426) 2025-05-19 09:39:05 -07:00
Taylor Mullen ab827746d0 fix(server): Use console.debug in GrepTool for less verbose logging
- 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-18 23:19:15 -07:00
Taylor Mullen 197315d5ef fix(shell): Improve error reporting for shell command failures
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-18 00:25:53 -07:00
Taylor Mullen d7ebe73b9b fix(glob): Improve glob tool accuracy and output
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-18 00:10:56 -07:00
Taylor Mullen 732f4537ea refactor: Remove console.error from WriteFileTool
- 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-17 23:06:50 -07:00
Olcan cca0cca84e ability to write system prompt to file (#414) 2025-05-17 20:14:06 -07:00
Olcan 935686a278 ability to override core system prompt (via .gemini/system.md) and specify core tools via coreTools setting (e.g. coreTools:["ls", "GrepTool", ...]) ; added tests, but did not update docs for now (#413) 2025-05-17 19:45:16 -07:00
Olcan 5d33b95f55 added timeout setting to mcp server config, also switched to custom config type without "stderr" field that does not make sense in settings (#410) 2025-05-17 16:53:22 -07:00
olcan d5885d2e88 fix multiple mcp servers 2025-05-17 14:14:59 -07:00
Taylor Mullen dd434e0974 fix: Prevent WriteFileTool from writing to directory paths
- 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-17 00:01:35 -07:00
Taylor Mullen 24d1f6502d refactor: Unify file modification confirmation state
- 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-16 23:34:48 -07:00
Taylor Mullen f2abe1c7b8 Refactor: Use String.prototype.replaceAll() and update TS lib
- 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-16 22:43:50 -07:00
Taylor Mullen 76e2970a57 feat: Strip schema props from MCP tool definitions
- 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-16 22:14:51 -07:00
Taylor Mullen 06d99091fd Avoid console.log for MCP
- 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-16 21:19:33 -07:00
Taylor Mullen bb691aebc3 GC "add tool registry tests"
- Ok
2025-05-16 17:04:29 -07:00
Allen Hutchison 5af93cfb9c feat: Implement CLI and model memory management (#371)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-05-16 16:36:50 -07:00
Olcan 7db21fc49f improved mcp support, including standard "mcpServers" setting with multiple named servers with command/args/env/cwd (#392) 2025-05-16 16:29:03 -07:00
Sébastien Cevey fa76da7f89 Fix typo in server README.md (#379) 2025-05-16 14:27:25 -07:00
Taylor Mullen 7012c97710 fix: Ensure filename is available for diff rendering in write-file
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-16 10:13:13 -07:00
sasha-gitg 39e4455d94 feat: Add support for Vertex AI and Vertex express mode (#380) 2025-05-16 08:06:43 -07:00
N. Taylor Mullen 650be4381f feat: Enable CI test reporting and artifact management (#367) 2025-05-15 22:59:53 -07:00
Taylor Mullen 94da1c7b24 Fix(write-file): Ensure correct validation method is called in WriteFileTool
- 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-15 15:30:06 -07:00
Taylor Mullen 62e8371aab Update Gemini Code verbiage -> Gemini CLI
- Did not update details that impact GC execution. Meaning packages are still named gemini-code (for now) and things that import them still import them as gemini-code.
2025-05-14 22:07:03 -07:00
Seth Troisi 586585a606 Improve read-many-files display message 2025-05-14 23:56:49 +00:00