mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-01 00:40:42 -07:00
feat(plan): support replace tool in plan mode to edit plans (#18379)
This commit is contained in:
@@ -130,6 +130,7 @@ You are operating in **Plan Mode** - a structured planning workflow for designin
|
||||
The following read-only tools are available in Plan Mode:
|
||||
|
||||
- \`write_file\` - Save plans to the plans directory (see Plan Storage below)
|
||||
- \`replace\` - Update plans in the plans directory
|
||||
|
||||
## Plan Storage
|
||||
- Save your plans as Markdown (.md) files ONLY within: \`/tmp/project-temp/plans/\`
|
||||
|
||||
@@ -327,7 +327,10 @@ describe('createPolicyEngineConfig', () => {
|
||||
ApprovalMode.AUTO_EDIT,
|
||||
);
|
||||
const rule = config.rules?.find(
|
||||
(r) => r.toolName === 'replace' && r.decision === PolicyDecision.ALLOW,
|
||||
(r) =>
|
||||
r.toolName === 'replace' &&
|
||||
r.decision === PolicyDecision.ALLOW &&
|
||||
r.modes?.includes(ApprovalMode.AUTO_EDIT),
|
||||
);
|
||||
expect(rule).toBeDefined();
|
||||
// Priority 15 in default tier → 1.015
|
||||
|
||||
@@ -77,9 +77,9 @@ decision = "ask_user"
|
||||
priority = 50
|
||||
modes = ["plan"]
|
||||
|
||||
# Allow write_file for .md files in plans directory
|
||||
# Allow write_file and replace for .md files in plans directory
|
||||
[[rule]]
|
||||
toolName = "write_file"
|
||||
toolName = ["write_file", "replace"]
|
||||
decision = "allow"
|
||||
priority = 50
|
||||
modes = ["plan"]
|
||||
|
||||
@@ -305,6 +305,7 @@ You are operating in **Plan Mode** - a structured planning workflow for designin
|
||||
The following read-only tools are available in Plan Mode:
|
||||
${options.planModeToolsList}
|
||||
- \`${WRITE_FILE_TOOL_NAME}\` - Save plans to the plans directory (see Plan Storage below)
|
||||
- \`${EDIT_TOOL_NAME}\` - Update plans in the plans directory
|
||||
|
||||
## Plan Storage
|
||||
- Save your plans as Markdown (.md) files ONLY within: \`${options.plansDir}/\`
|
||||
|
||||
Reference in New Issue
Block a user