feat(core): conditionally include ctrl+f prompt based on interactive shell setting#18561
Conversation
Summary of ChangesHello @NTaylorMullen, 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 refines the user experience by making the Highlights
Changelog
Activity
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 correctly implements the conditional inclusion of the ctrl + f instruction in the system prompt. The changes ensure the instruction is only shown when both the CLI is in interactive mode and interactive shells are enabled. The logic is sound, with the new interactiveShellEnabled option correctly propagated from the configuration to the prompt rendering snippets. The addition of unit tests to verify both scenarios (enabled/disabled) is a great practice and ensures the change is robust. The updated snapshots reflect the intended changes accurately. Overall, this is a well-executed feature enhancement.
|
Size Change: +1.25 kB (+0.01%) Total Size: 23.9 MB
ℹ️ View Unchanged
|
e79e71c to
118ab40
Compare
…shell setting - Update system prompt snippets to support interactiveShellEnabled option - Conditionally render ctrl+f instruction in toolUsageInteractive - Pass isInteractiveShellEnabled() from PromptProvider - Add unit tests and update snapshots to verify behavior
118ab40 to
e5408c6
Compare
Summary
This PR updates the system prompt to conditionally include the
ctrl + finstruction. Currently, this instruction is shown whenever the CLI is in interactive mode. However, it only makes sense if interactive shells are also enabled. This change ensures the instruction is only displayed when both conditions are met.Details
enableInteractiveShelltointeractiveShellEnabledinOperationalGuidelinesOptions.toolUsageInteractiveto acceptinteractiveShellEnabledand conditionally render thectrl + fsentence.renderOperationalGuidelinesto pass the new option.PromptProviderto retrieve the setting fromconfig.isInteractiveShellEnabled().prompts.test.tsto verify the logic and updated snapshots.snippets.legacy.tsfor consistency.Related Issues
N/A
How to Validate
Run the following command to execute the tests:
npm test -w @google/gemini-cli-core -- src/core/prompts.test.tsVerify that the tests for
ctrl + finstructions pass and that snapshots are correct.Pre-Merge Checklist