fix(core): explicitly allow codebase_investigator and cli_help in read-only mode#21157
fix(core): explicitly allow codebase_investigator and cli_help in read-only mode#21157
Conversation
|
Hi there! Thank you for your contribution to Gemini CLI. To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md. This pull request is being closed because it is not currently linked to an issue. Once you have updated the description of this PR to link an issue (e.g., by adding How to link an issue: Thank you for your understanding and for being a part of our community! |
|
Hi @Adib234, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
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 addresses a policy engine configuration issue to ensure that 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
The pull request correctly allows the codebase_investigator and cli_help tools in read-only mode by adding them to read-only.toml. This resolves an issue where they would otherwise require user confirmation. For improved maintainability, I've suggested consolidating the newly added policy rules into a single block, which aligns with the project's conventions.
Note: Security Review has been skipped due to the limited scope of the PR.
|
Thank you for linking an issue! This pull request has been automatically reopened. |
|
Size Change: -2 B (0%) Total Size: 26 MB ℹ️ View Unchanged
|
|
/patch preview |
1 similar comment
|
/patch preview |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
Summary
Explicitly allow
codebase_investigatorandcli_helpsubagents inread-only.toml.Details
Adding these tools to
plan.toml(restricted toplanmode) causesAgentRegistryto skip its dynamicALLOWrule for these local agents. This happens becauseAgentRegistryonly adds dynamic rules if no static rules (TOML/Settings) exist for the tool.Since the rule in
plan.tomlis restricted tomodes = ["plan"], it does not apply in default mode, leading the policy engine to fall back to the system'sdefaultDecision: PolicyDecision.ASK_USER.Adding them explicitly to
read-only.tomlensures they are correctly allowed across all modes as they are safe, read-only tools.Related Issues
Fixes #21158
How to Validate
packages/core/src/policy/policies/read-only.tomlcontains the new rules forcodebase_investigatorandcli_help.npm test -w @google/gemini-cli-core -- src/policy/policy-engine.test.ts src/policy/workspace-policy.test.ts src/availability/policyCatalog.test.tsAlso manually verified in default and auto-edit that no permission is needed to run
codebase_investigatorandcli_helpsubagentPre-Merge Checklist