feat: add file tools and grep search functionality#2
Conversation
Summary of ChangesHello @minpeter, 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 introduces an experimental script ( Highlights
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 a new experimental script src/exp.ts to run a code editing agent, and adds new file system and search tools. The implementation of the grep tool using ripgrep is robust. The main script is well-structured, but I've identified a high-severity issue with top-level error handling that could lead to an ungraceful process exit. My review includes a suggestion to properly handle promise rejections at the application's entry point. The other changes are minor formatting adjustments.
- Add showFinishReason to StreamRenderOptions interface - Include showFinishReason in RenderContext - Implement handleFinish function to conditionally display finish reason - Update renderFullStream to use the new option with default value true - Handle 'finish' stream part to invoke handleFinish
conversation context Add MessageHistory to manage conversation context and ensure proper message tracking in the agent loop. Update maxOutputTokens from 10 to 1024 to allow longer responses.
This change introduces a new MessageHistory class to track and manage user and model messages in the interaction module. The class provides methods to add messages, retrieve all messages, clear the history, and convert stored messages to the format required by the AI model. A factory function generates unique message IDs using a counter, and each message stores its creation timestamp, unique ID, and role-specific content.
- Remove deprecated `agent.ts` class and replace with `ToolLoopAgent` - Reorganize project structure: move files from `src/utils`, `src/interaction`, and `src/tools` to `src/context`, `src/interaction`, and `src/tools` - Update imports to reflect new module paths - Remove unused dependencies and utilities (`retry.ts`, `conversation-store.ts`, `model-selector.ts`, `unit-exp.ts`) - Simplify environment configuration by removing `DEBUG_CHUNK_LOG` - Fix tool import paths
Remove unused import and update module path for run-command tool Update import path from src/tools/command/run-command to src/tools/shell/run-command Clean up commented code and reorganize imports for consistency
dependencies ``` The changelog shows an update of the `@ai-sdk/openai-compatible` package from v2.0.2 to v2.0.4, along with updates to its peer dependencies (`@ai-sdk/provider` and `@ai-sdk/provider-utils`). This change ensures compatibility and benefits from bug fixes or improvements in the newer version. No changes to the application logic are required; this is a dependency update.
Add command parsing and execution support for user input Implement /help command to list available commands Remove unused experimental code
```text Add exported registerCommand and implement render command for raw prompt rendering ``` Add rendered command to system, export registerCommand for external use, and implement error handling for render command.
implementations - Refactor agent initialization and model management into AgentManager class - Extract model selection logic into command pattern - Integrate custom fetch implementation for chat rendering - Remove redundant model selector and consolidate command registration - Update main entry point to use centralized agent and command system - Ensure consistent API usage and error handling across modules
0723b8d to
1b7230a
Compare
trimming in message history The changes include: - Implementing the `trimTrailingNewlines` function to remove trailing newlines from assistant messages - Adding comprehensive unit tests to verify behavior for string and array content types - Supporting both text and tool call content arrays - Ensuring trailing newlines are trimmed only from text content, not other message types Add unit tests for trimTrailingNewlines function and implement newline trimming in message history
Add just-bash dependency and refactor shell command tool to use just-bash instead of node:child_process.exec for safer and more powerful command execution. Update command execution to support timeouts and improve error handling. Add just-bash for shell command execution Add support for executing shell commands via a just-bash-style tool, enabling safe command execution with user approval for potentially dangerous operations. Introduce tool approval workflow and message history tracking for tool responses.
- Reorganize tools into execute/, explore/, modify/ folders - Rename run_command to shell_command - Rename file-safety.ts to safety-utils.ts - Add needsApproval for modifier tools (write, edit, delete) and shell_command - Implement tool execution approval UI with Y/N prompt - Update system prompt and tests accordingly
…n- Add DEBUG_SHOW_FINISH_REASON boolean environment variable to src/env.ts\n- Update stream-renderer.ts to use env.DEBUG_SHOW_FINISH_REASON for showFinishReason option\n- This allows controlling whether to show finish reason in stream rendering via environment configuration
No description provided.