fix(core): add platform-aware shell guidance#26998
Conversation
Summary of ChangesHello, 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 enhances the Gemini CLI system prompt by providing context-aware shell guidance. By detecting the host platform at runtime, the model is now explicitly instructed to use appropriate shell commands, preventing Windows users from receiving Unix-centric advice while maintaining existing functionality for other platforms. 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 the 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 counterproductive. 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. Footnotes
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
🛑 Action Required: Evaluation ApprovalSteering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged. Maintainers:
Once approved, the evaluation results will be posted here automatically. |
There was a problem hiding this comment.
Code Review
This pull request introduces shell efficiency guidelines into the core system prompts to improve how the AI agent interacts with the terminal. It adds a new 'Shell tool usage' section to the operational guidelines, providing platform-specific advice for both Unix-like and Windows environments, such as recommending targeted inspection tools like 'grep' or 'findstr' for large outputs. The implementation includes updates to the prompt rendering logic in 'packages/core', new test cases for Windows platform detection, and corresponding snapshot updates. I have no feedback to provide as there were no review comments to assess.
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Summary
Adds platform-aware shell guidance to the modern Gemini CLI system prompt so the model is reminded which host OS it is running on before choosing shell commands.
This keeps Windows users from getting nudged toward Unix-only commands in the modern prompt path, while preserving the existing Unix-style examples on non-Windows hosts.
Details
Shell tool usagesection to the modern operational guidelines when shell output efficiency guidance is enabled.process.platformto render Windows-specific inspection examples (type,findstr,Get-Content,Select-String) onwin32.Related Issues
Fixes #26591
How to Validate
npm test --workspace @google/gemini-cli-core -- prompts.test.ts promptProvider.test.tsnpm run typecheck --workspace @google/gemini-cli-corenpm run lint --workspace @google/gemini-cli-core -- src/prompts/snippets.ts src/core/prompts.test.tsPre-Merge Checklist