Skip to content

Comments

feat(plan): support configuring custom plans storage directory#19577

Merged
jerop merged 1 commit intomainfrom
feat/configure-plan-directory
Feb 19, 2026
Merged

feat(plan): support configuring custom plans storage directory#19577
jerop merged 1 commit intomainfrom
feat/configure-plan-directory

Conversation

@jerop
Copy link
Contributor

@jerop jerop commented Feb 19, 2026

  • Added 'plan' setting nested under 'general' in settings schema
  • Implemented support for custom plans directory in Storage and Config classes
  • Added PlanSettings interface to core config
  • Updated Plan Mode documentation with examples for custom directory and policy overrides
  • Added unit tests for new configuration in both core and cli packages
  • Regenerated settings schema and documentation

Fixes #18937


Tested with instructions in doc:

image

@jerop jerop requested review from a team as code owners February 19, 2026 22:06
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jerop, 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 introduces the capability for users to define a custom directory for storing planning artifacts, moving away from a fixed temporary location. This enhancement provides greater control over file management while incorporating essential security measures to prevent unauthorized access or modification of files outside the project's scope. The changes span configuration, storage logic, and user documentation, all supported by new unit tests to ensure reliability and safety.

Highlights

  • Custom Plan Directory Configuration: Introduced a new general.plan.directory setting, allowing users to specify a custom storage location for planning artifacts instead of the default temporary directory.
  • Secure Path Handling: Implemented robust security checks within the Storage and Config classes to ensure that user-configured plan directories remain within the project root, preventing path traversal vulnerabilities.
  • Documentation Updates: Updated Plan Mode documentation and general settings guides to reflect the new configuration option, including examples for setting custom directories and necessary policy overrides.
  • Unit Test Coverage: Added comprehensive unit tests across core and CLI packages to validate the new configuration, custom directory resolution, and security checks.
  • Schema Regeneration: Regenerated the settings schema to formally include the new general.plan.directory property, ensuring consistency across the system.
Changelog
  • docs/cli/plan-mode.md
    • Added a new section detailing how to configure a custom plan directory and the necessary policy updates for write access.
  • docs/cli/settings.md
    • Updated the settings table to include the new general.plan.directory setting.
  • docs/get-started/configuration.md
    • Documented the new general.plan.directory setting with its description, default value, and restart requirement.
  • packages/cli/src/config/config.test.ts
    • Added a test case to verify that the planSettings.directory from user settings is correctly passed to the configuration.
  • packages/cli/src/config/config.ts
    • Modified loadCliConfig to pass planSettings from the merged settings to the core Config constructor.
  • packages/cli/src/config/settingsSchema.test.ts
    • Added a test to confirm the presence and type of the general.plan.directory property in the settings schema.
  • packages/cli/src/config/settingsSchema.ts
    • Extended the SETTINGS_SCHEMA to include the new plan object under general with a directory property.
  • packages/cli/src/ui/commands/planCommand.test.ts
    • Replaced calls to getProjectTempPlansDir with the new getPlansDir method in tests.
  • packages/cli/src/ui/commands/planCommand.ts
    • Updated the planCommand to use config.storage.getPlansDir() for retrieving the plans directory.
  • packages/cli/src/ui/components/ExitPlanModeDialog.test.tsx
    • Updated tests to use getPlansDir instead of getProjectTempPlansDir.
  • packages/cli/src/ui/components/ExitPlanModeDialog.tsx
    • Modified usePlanContent to use config.storage.getPlansDir() for path validation and content processing.
  • packages/cli/src/ui/components/ToolConfirmationQueue.test.tsx
    • Updated mock configuration to use getPlansDir for plan directory retrieval.
  • packages/core/src/config/config.test.ts
    • Added new test suite for Plan Settings to verify setCustomPlansDir is called correctly.
    • Updated existing tests to use getPlansDir.
  • packages/core/src/config/config.ts
    • Introduced PlanSettings interface.
    • Added planSettings to ConfigParameters.
    • Initialized storage.setCustomPlansDir in the Config constructor.
    • Updated initialize method to use getPlansDir.
  • packages/core/src/config/storage.test.ts
    • Added extensive test cases for the new getPlansDir method, covering custom relative/absolute paths, path traversal attempts, and symbolic link security.
  • packages/core/src/config/storage.ts
    • Imported isSubpath and resolveToRealPath utilities.
    • Added setCustomPlansDir to store the custom directory.
    • Implemented getPlansDir with logic to resolve and validate the custom path against the project root, falling back to the temporary directory if no custom path is set.
  • packages/core/src/core/prompts.test.ts
    • Updated mock config.storage to use getPlansDir in tests.
  • packages/core/src/prompts/promptProvider.test.ts
    • Updated mock config.storage to use getPlansDir in tests.
  • packages/core/src/prompts/promptProvider.ts
    • Modified PromptProvider to use config.storage.getPlansDir() when providing the plans directory to the planning workflow.
  • packages/core/src/tools/enter-plan-mode.test.ts
    • Updated enter plan mode tests to use the new getPlansDir method.
  • packages/core/src/tools/exit-plan-mode.test.ts
    • Updated exit plan mode tests to use the new getPlansDir method.
  • packages/core/src/tools/exit-plan-mode.ts
    • Updated ExitPlanModeTool and ExitPlanModeInvocation to use config.storage.getPlansDir() for retrieving the plans directory and for path validation.
  • schemas/settings.schema.json
    • Added the plan object with a directory property under general in the JSON schema definition.
Activity
  • The author, jerop, implemented the feature to support configuring a custom plans storage directory.
  • The author provided a detailed list of changes in the PR description, including schema updates, implementation in Storage and Config, new interface, documentation updates, and unit tests.
  • The author regenerated settings schema and documentation.
  • The author tested the changes and provided a screenshot demonstrating the functionality.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 19, 2026

Size Change: +1.42 kB (+0.01%)

Total Size: 24.5 MB

Filename Size Change
./bundle/gemini.js 24.5 MB +1.42 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

@jerop jerop force-pushed the feat/configure-plan-directory branch 2 times, most recently from b7b0f41 to c20b960 Compare February 19, 2026 22:13
@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Feb 19, 2026
@jerop jerop enabled auto-merge February 19, 2026 22:17
@jerop jerop changed the title feat: support configuring custom plans storage directory feat(plan): support configuring custom plans storage directory Feb 19, 2026
- Added 'plan' setting nested under 'general' in settings schema
- Implemented support for custom plans directory in Storage and Config classes
- Added PlanSettings interface to core config
- Updated Plan Mode documentation with examples for custom directory and policy overrides
- Added unit tests for new configuration in both core and cli packages
- Regenerated settings schema and documentation

Fixes #18937
@jerop jerop force-pushed the feat/configure-plan-directory branch from c20b960 to c4b75d1 Compare February 19, 2026 22:19
@jerop jerop added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit 537e56f Feb 19, 2026
26 of 27 checks passed
@jerop jerop deleted the feat/configure-plan-directory branch February 19, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configuring the plans storage directory

2 participants