gemini-cli - ✅(Solved) Fix Extension plan directory config clases with default directory when extension is not used. [1 pull requests, 1 comments, 2 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#24961Fetched 2026-04-09 08:16:47
View on GitHub
Comments
1
Participants
2
Timeline
11
Reactions
0
Timeline (top)
labeled ×3cross-referenced ×2added_to_project_v2 ×1assigned ×1

Fix Action

Fixed

PR fix notes

PR #24854: fix(core): handle nested plan files by resolving paths correctly

Description (problem / solution / changelog)

Summary

This fixes a bug where path.basename was incorrectly stripping directory structures from plan files (e.g., trying to write to plans/nested/file.md would incorrectly write to plans/file.md). By using path.resolve and verifying with isSubpath, nested files are now handled securely and correctly.

Details

  • Replaced path.basename logic in edit.ts, write-file.ts, and planUtils.ts with proper path resolution.
  • Updated the path boundary validations to ensure malicious paths still fail securely.

Fixes #24975

Changed files

  • evals/plan_mode.eval.ts (modified, +37/-0)
  • packages/core/src/tools/edit.test.ts (modified, +2/-2)
  • packages/core/src/tools/edit.ts (modified, +15/-3)
  • packages/core/src/tools/write-file.ts (modified, +18/-3)
  • packages/core/src/utils/planUtils.test.ts (modified, +5/-5)
  • packages/core/src/utils/planUtils.ts (modified, +40/-13)

Code Example

> /about
# paste output here
RAW_BUFFERClick to expand / collapse

What happened?

Extensions with custom plan directories could not write nested files inside plan directory.

What did you expect to happen?

Files can be written at any path under teh custom plan directory.

Client information

<details> <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about
# paste output here
</details>

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

  • Verify the custom plan directory configuration to ensure it allows writing nested files.

Guidance

  • Check the permissions and access control settings for the custom plan directory to ensure that extensions have the necessary rights to write files.
  • Review the directory structure and path settings to confirm that the extension is attempting to write files to the correct location within the custom plan directory.
  • Test writing files to the root of the custom plan directory to isolate if the issue is specific to nested files.

Example

  • No code snippet is provided as the issue does not include specific code or technical details.

Notes

  • The solution may depend on the specific configuration and implementation of the custom plan directory and extensions.

Recommendation

  • Apply workaround: Modify the custom plan directory configuration to explicitly allow writing nested files, if possible, to resolve the issue.

FAIL-SAFE

Given the lack of detailed technical information, the provided guidance focuses on general troubleshooting steps related to directory permissions and structure.

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