Skip to content

Conversation

alexx-ftw
Copy link

@alexx-ftw alexx-ftw commented Jul 23, 2025

Description

Summary of Changes

This pull request primarily focuses on enhancing the cross-platform compatibility of the application, specifically addressing command execution issues on Windows. It also significantly improves the project's extensibility by introducing a unified tool registration system and several new utility tools. Furthermore, the PR refines dependency management and upgrades the testing infrastructure, contributing to overall code quality and maintainability.

Highlights

  • Windows Compatibility Fix: Implemented a crucial fix in src/utils/commandExecutor.ts (lines 15-17) to set shell: process. Platform === "win32" when spawning child processes. This resolves ENOENT errors encountered on Windows, improving cross-platform reliability. A new test tests/commandExecutor.test.ts was added to verify this behavior.
  • Unified Tool Registry and New Tools: Introduced a new src/tools/registry.ts and a set of new tools (ask-gemini, brainstorm, fetch-chunk, ping, help, timeout-test) to enhance functionality and simplify future tool additions. This includes logic for handling changeMode output and chunking large responses.
  • Dependency Management and Testing Improvements: Refactored package.json (lines 49-55, 65-67, 72-74) to move @modelcontextprotocol/sdk and zod to peerDependencies and devDependencies, ensuring better dependency hygiene. The testing framework was updated from a placeholder to vitest (line 14), enabling proper unit testing.
  • Documentation and Version Updates: Added new guidance in AGENTS.md and updated docs/resources/troubleshooting.md (lines 345-346) to reflect the Windows compatibility fix. The project version was bumped to 1.1.5 across package.json (line 3), CHANGELOG.md (line 5), src/index.ts (line 33), and docs/.vitepress/theme/Layout.vue (line 9).

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • I have tested these changes locally
  • My code follows the project's style
  • I have updated the documentation if needed

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @alexx-ftw, 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 delivers a substantial upgrade to the project's core functionality by introducing a flexible and extensible tool system. It significantly enhances the integration with Gemini, particularly for structured code modifications, and improves the overall user experience through better feedback and error handling. Critical platform compatibility issues have been resolved, and the project's underlying infrastructure has been modernized.

Highlights

  • Unified Tool Registry & New Tools: I've implemented a new UnifiedTool interface and toolRegistry to streamline tool development and management. This includes new tools like ask-gemini for core Gemini interactions, brainstorm for idea generation, fetch-chunk for handling large responses, and timeout-test for system stability checks, alongside basic ping and help utilities.
  • Enhanced Gemini Integration with 'ChangeMode': A significant feature, 'changeMode', has been introduced. This enables Gemini to provide structured code modifications in a precise OLD/NEW format. The system now includes robust parsing, validation, intelligent chunking for large responses, and a file-based caching mechanism for these edits, improving the workflow for applying AI-generated code changes.
  • Improved Windows Compatibility: To address ENOENT errors on Windows, the commandExecutor now explicitly sets shell: process.platform === "win32" when spawning child processes. This ensures commands are executed correctly across different operating systems.
  • Progress Notifications & Quota Fallback: Long-running tool executions now provide periodic progress notifications to the user, enhancing feedback. Additionally, the system includes an automatic fallback mechanism to the gemini-2.5-flash model if the gemini-2.5-pro quota is exceeded, ensuring continued operation.
  • Dependency Refinement & Testing Infrastructure: I've refined dependency management by moving @modelcontextprotocol/sdk and zod to devDependencies and peerDependencies. vitest has been added to devDependencies, and the test script updated, along with a new test for the commandExecutor.
  • Documentation Updates: New AGENTS.md guidance has been added, covering development practices, Windows compatibility, and repository scripts. The CHANGELOG.md and docs/resources/troubleshooting.md have also been updated to reflect the new version and compatibility fixes.
Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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 or fill out our survey to provide feedback.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

An excellent pull request that introduces a significant refactoring of the tool handling mechanism by creating a unified tool registry, which greatly improves maintainability. It also adds several new tools and a major changeMode feature for applying structured code edits, complete with response parsing, chunking, and caching. The Windows compatibility fix is a welcome addition, and the new tests and documentation are valuable.

My review focuses on improving the correctness of the new changeMode parser, ensuring consistent logging practices, and clarifying some parts of the new code. Overall, this is a substantial and well-architected update.

@alexx-ftw alexx-ftw changed the title @sourcery-ai Windows fix and other QoL improvements Jul 23, 2025
@alexx-ftw alexx-ftw marked this pull request as ready for review July 23, 2025 14:20
@alexx-ftw
Copy link
Author

/gemini summary

Copy link

Summary of Changes

This pull request primarily focuses on enhancing the cross-platform compatibility of the application, specifically addressing command execution issues on Windows. It also significantly improves the project's extensibility by introducing a unified tool registration system and several new utility tools. Furthermore, the PR refines dependency management and upgrades the testing infrastructure, contributing to overall code quality and maintainability.

Highlights

  • Windows Compatibility Fix: Implemented a crucial fix in src/utils/commandExecutor.ts (lines 15-17) to set shell: process.platform === "win32" when spawning child processes. This resolves ENOENT errors encountered on Windows, improving cross-platform reliability. A new test tests/commandExecutor.test.ts was added to verify this behavior.
  • Unified Tool Registry and New Tools: Introduced a new src/tools/registry.ts and a set of new tools (ask-gemini, brainstorm, fetch-chunk, ping, help, timeout-test) to enhance functionality and simplify future tool additions. This includes logic for handling changeMode output and chunking large responses.
  • Dependency Management and Testing Improvements: Refactored package.json (lines 49-55, 65-67, 72-74) to move @modelcontextprotocol/sdk and zod to peerDependencies and devDependencies, ensuring better dependency hygiene. The testing framework was updated from a placeholder to vitest (line 14), enabling proper unit testing.
  • Documentation and Version Updates: Added new guidance in AGENTS.md and updated docs/resources/troubleshooting.md (lines 345-346) to reflect the Windows compatibility fix. The project version was bumped to 1.1.5 across package.json (line 3), CHANGELOG.md (line 5), src/index.ts (line 33), and docs/.vitepress/theme/Layout.vue (line 9).
Changelog
  • AGENTS.md
    • New file providing development guidance and Windows compatibility notes.
  • CHANGELOG.md
    • Added an entry for version 1.1.5.
  • dist/
    • Updated compiled JavaScript and TypeScript declaration files reflecting the source code changes.
  • docs/.vitepress/theme/Layout.vue
    • Updated the displayed version tag to 1.1.5.
  • docs/resources/troubleshooting.md
    • Added a new troubleshooting tip for ENOENT errors on Windows, referencing the shell: process.platform === "win32" fix.
  • package.json
    • Version updated to 1.1.5.
    • test script changed to vitest run.
    • @modelcontextprotocol/sdk and zod moved from dependencies to devDependencies and peerDependencies.
    • vitest added to devDependencies.
  • src/index.ts
    • Updated the server version string to 1.1.5.
  • src/tools/
    • Added new tool source files (ask-gemini.tool.ts, brainstorm.tool.ts, fetch-chunk.tool.ts, registry.ts, simple-tools.ts, timeout-test.tool.ts, test-tool.example.ts) and an index.ts to register them.
  • src/utils/
    • Added new utility files (changeModeChunker.ts, changeModeParser.ts, changeModeTranslator.ts, chunkCache.ts, geminiExecutor.ts, logger.ts, timeoutManager.ts) to support the new tools and features, particularly for changeMode and caching.
  • src/utils/commandExecutor.ts
    • Modified the spawn options to set shell: true when running on Windows to correctly resolve command paths.
  • tests/commandExecutor.test.ts
    • New test file added to specifically verify the shell option behavior in commandExecutor.ts on Windows.
  • tsconfig.json
    • Added "node" to compilerOptions.types and reformatted include/exclude paths.
Activity
  • The author alexx-ftw requested an automated summary of the pull request.

@alexx-ftw alexx-ftw changed the title Windows fix and other QoL improvements Several Windows fixes and other QoL improvements Jul 23, 2025
@alexx-ftw
Copy link
Author

/Gemini summary

Copy link

Summary of Changes

This pull request significantly enhances the application's cross-platform compatibility, particularly for Windows users, by addressing command execution issues. It also introduces a robust and extensible unified tool registration system, alongside several new utility tools that expand the application's capabilities. Furthermore, the changes improve overall code quality through refined dependency management and an upgraded testing framework.

Highlights

  • Windows Compatibility Fix: Implemented a crucial fix in src/utils/commandExecutor.ts (lines 15-17) to set shell: process.platform === "win32" when spawning child processes. This resolves ENOENT errors encountered on Windows, improving cross-platform reliability. A new test tests/commandExecutor.test.ts was added to verify this behavior.
  • Unified Tool Registry and New Tools: Introduced a new src/tools/registry.ts and a set of new tools (ask-gemini, brainstorm, fetch-chunk, ping, help, timeout-test) to enhance functionality and simplify future tool additions. This includes logic for handling changeMode output and chunking large responses.
  • Dependency Management and Testing Improvements: Refactored package.json (lines 49-55, 65-67, 72-74) to move @modelcontextprotocol/sdk and zod to peerDependencies and devDependencies, ensuring better dependency hygiene. The testing framework was updated from a placeholder to vitest (line 14), enabling proper unit testing.
  • Documentation and Version Updates: Added new guidance in AGENTS.md and updated docs/resources/troubleshooting.md (lines 345-346) to reflect the Windows compatibility fix. The project version was bumped to 1.1.5 across package.json (line 3), CHANGELOG.md (line 5), src/index.ts (line 33), and docs/.vitepress/theme/Layout.vue (line 9).
Changelog
  • AGENTS.md
    • New file added, providing guidance for development, including notes on TypeScript, TDD, linting, building, ruff for Python, dependency hygiene, and Windows compatibility.
  • CHANGELOG.md
    • Updated to include version 1.1.5 with a "Bump version to 1.1.5" entry.
  • dist/
    • New compiled JavaScript and TypeScript declaration files (.js, .d.ts, .js.map, .d.ts.map) were added for various source files, reflecting the build output.
  • docs/.vitepress/theme/Layout.vue
    • The displayed version tag was updated from 1.1.4 to 1.1.5 (line 9).
  • docs/resources/troubleshooting.md
    • A new troubleshooting tip was added for Spawn ENOENT errors on Windows, advising to upgrade or ensure shell: process.platform === "win32" is set in the command executor (lines 345-346).
  • package.json
    • The project version was updated from 1.1.4 to 1.1.5 (line 3).
    • The test script was changed from a placeholder echo "No tests yet" to vitest run (line 14).
    • @modelcontextprotocol/sdk and zod were moved from dependencies to devDependencies and peerDependencies (lines 49-55, 65-67, 72-74).
    • vitest was added to devDependencies (line 67).
  • ruff.toml
    • New file added, configuring ruff linter with line-length = 120 and select = ["ALL"].
  • src/index.ts
    • The server version string was updated from 1.1.4 to 1.1.5 (line 33).
  • src/tools/
    • New tool files were added: ask-gemini.tool.ts, brainstorm.tool.ts, fetch-chunk.tool.ts, simple-tools.ts, timeout-test.tool.ts, and test-tool.example.ts.
    • A new registry.ts was introduced to manage tool definitions and execution.
    • index.ts was updated to register all new tools with the toolRegistry.
  • src/utils/
    • New utility files were added to support changeMode parsing, chunking, and translation: changeModeChunker.ts, changeModeParser.ts, changeModeTranslator.ts.
    • A new chunkCache.ts was added for caching large responses.
    • geminiExecutor.ts was introduced to handle Gemini CLI interactions, including changeMode logic and fallback models.
    • logger.ts was added for improved logging.
    • timeoutManager.ts was added.
  • src/utils/commandExecutor.ts
    • The spawn options were modified to set shell: process.platform === "win32" to correctly resolve command paths on Windows, addressing ENOENT errors (lines 15-17).
  • src/utils/geminiExecutor.ts
    • The logic for quoting prompts was updated to specifically handle Windows shell requirements by replacing double quotes and wrapping the prompt in quotes (lines 95-97, 115-117).
  • tests/commandExecutor.test.ts
    • New test file added to verify the shell option behavior in commandExecutor.ts on Windows.
  • tests/geminiExecutor.test.ts
    • New test file added to verify the prompt quoting behavior in geminiExecutor.ts on Windows.
  • tsconfig.json
    • types: ["node"] was added to compilerOptions (lines 16-18) to include Node.js type definitions, and include/exclude paths were reformatted.
Activity
  • The author alexx-ftw requested an automated summary of the pull request.
  • The gemini-code-assist[bot] provided a detailed summary, including highlights and a changelog.
  • The author alexx-ftw requested another summary.

@PhillipRt
Copy link

worked for me on win 11! But you probably want to remove the dist files from the PR

@alexx-ftw
Copy link
Author

worked for me on win 11! But you probably want to remove the dist files from the PR

Ups you're right my bad. Removing them rn

alexx-ftw and others added 19 commits August 11, 2025 12:57
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Use dedicated console methods in Logger
chore: remove placeholder comment from logger
…newline

Remove trailing newline from log messages
…provements

- Preserved type improvements from main branch (typed args, better type safety)
- Applied Prettier formatting from PR #20 (double quotes, consistent indentation)
- Resolved conflicts in: ask-gemini.tool.ts, brainstorm.tool.ts, fetch-chunk.tool.ts,
  registry.ts, simple-tools.ts, timeout-test.tool.ts
- Maintained functional changes: Number() casting, proper destructuring, type annotations

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants