gemini-cli - ✅(Solved) Fix Clean up plan toml rules [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25039Fetched 2026-04-10 03:45:06
View on GitHub
Comments
0
Participants
1
Timeline
13
Reactions
0
Author
Participants
Assignees
Timeline (top)
labeled ×3added_to_project_v2 ×1assigned ×1closed ×1

Fix Action

Fixed

PR fix notes

PR #25037: refactor(plan) Clean default plan toml

Description (problem / solution / changelog)

Summary

This PR simplifies the plan.toml policy file by consolidating the regex patterns for plan file access and removing redundant "deny" rules for non-interactive mode.

Details

  • Consolidated Plan File Regex: Merged two separate rules for write_file and replace in Plan Mode into a single rule. The updated argsPattern uses a non-capturing group (?:[\\w-]+[\\\\/]+[\\w-]+|[\\w-]+) to handle both path formats (with and without session IDs) across platforms.
  • Removed Redundant Rules: Eliminated rules that explicitly denied tools in non-interactive mode (interactive = false). These cases are already covered by higher-priority rules or the default catch-all rule (priority 40) in Plan Mode, making the explicit "deny" rules unnecessary and the configuration cleaner.

Related Issues

#25039

How to Validate

  1. Run core policy tests: npm test -w @google/gemini-cli-core -- src/policy/toml-loader.test.ts src/policy/config.test.ts
  2. Verify that plan file access still works as expected in Plan Mode (validated via existing tests).
  3. Ensure linting and type checking pass: npm run lint && npm run typecheck.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

Changed files

  • packages/core/src/policy/policies/plan.toml (modified, +3/-16)
RAW_BUFFERClick to expand / collapse

What would you like to be added?

Currently some dups and we should keep it as clean as possible

Why is this needed?

Clean up plan.toml file and make sure there is no regression

Additional context

No response

extent analysis

TL;DR

Remove duplicates from the plan.toml file to maintain cleanliness and prevent regression.

Guidance

  • Review the plan.toml file to identify and remove duplicate entries.
  • Verify the file's syntax and content after removal to ensure no data corruption or loss.
  • Consider implementing a validation or normalization step during the file's generation or update process to prevent future duplicates.

Notes

The exact method of removing duplicates depends on the file's format and the tools available, which are not specified in the issue.

Recommendation

Apply workaround: Manually remove duplicates from the plan.toml file and consider automating this process in the future to prevent reoccurrence.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING