fix(core): publish policy update on auto-edit transition Removes an early return in updatePolicy to ensure the UPDATE_POLICY message is broadcast when entering AUTO_EDIT mode.#19074
Conversation
Removes an early return in `updatePolicy` to ensure the `UPDATE_POLICY` message is broadcast when entering `AUTO_EDIT` mode.
Summary of ChangesHello @ahsanfarooq210, 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 addresses a critical bug preventing session-based permissions for edit tools from persisting. By modifying the updatePolicy function to remove a premature exit, it ensures that the necessary policy updates are fully processed and broadcast, thereby eliminating repetitive permission prompts for users who select "Allow for this session." 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 fixes a bug where session-level permissions for edit tools were not being persisted. Removing the early return in updatePolicy ensures that the policy update message is correctly published. The change is logical and directly addresses the issue. However, I've noticed a potential issue in the accompanying test case where an incorrect tool name is used, which could cause the test to fail or not accurately verify the intended behavior. Please see my detailed comment.
Summary for #18727
Fixes a bug where "Allow for this session" for edit tools (write_file, edit) wasn't persisting the permission, causing repeated prompts. The issue occurred because the code was returning early after setting AUTO_EDIT mode, skipping the session rule creation.
Details
Related Issues
Fixes #18727
How to Validate
Pre-Merge Checklist