mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 21:03:05 -07:00
fix(core): allow /memory add to work in plan mode (#20353)
This commit is contained in:
@@ -119,6 +119,7 @@ These are the only allowed tools:
|
||||
- **Planning (Write):** [`write_file`] and [`replace`] only allowed for `.md`
|
||||
files in the `~/.gemini/tmp/<project>/<session-id>/plans/` directory or your
|
||||
[custom plans directory](#custom-plan-directory-and-policies).
|
||||
- **Memory:** [`save_memory`]
|
||||
- **Skills:** [`activate_skill`] (allows loading specialized instructions and
|
||||
resources in a read-only manner)
|
||||
|
||||
@@ -277,6 +278,7 @@ performance. You can disable this automatic switching in your settings:
|
||||
[`google_web_search`]: /docs/tools/web-search.md
|
||||
[`replace`]: /docs/tools/file-system.md#6-replace-edit
|
||||
[MCP tools]: /docs/tools/mcp-server.md
|
||||
[`save_memory`]: /docs/tools/memory.md
|
||||
[`activate_skill`]: /docs/cli/skills.md
|
||||
[subagents]: /docs/core/subagents.md
|
||||
[policy engine]: /docs/reference/policy-engine.md
|
||||
|
||||
@@ -50,7 +50,7 @@ priority = 70
|
||||
modes = ["plan"]
|
||||
|
||||
[[rule]]
|
||||
toolName = ["ask_user", "exit_plan_mode"]
|
||||
toolName = ["ask_user", "exit_plan_mode", "save_memory"]
|
||||
decision = "ask_user"
|
||||
priority = 70
|
||||
modes = ["plan"]
|
||||
|
||||
@@ -2601,6 +2601,12 @@ describe('PolicyEngine', () => {
|
||||
priority: 70,
|
||||
modes: [ApprovalMode.PLAN],
|
||||
},
|
||||
{
|
||||
toolName: 'save_memory',
|
||||
decision: PolicyDecision.ASK_USER,
|
||||
priority: 70,
|
||||
modes: [ApprovalMode.PLAN],
|
||||
},
|
||||
{
|
||||
toolName: 'exit_plan_mode',
|
||||
decision: PolicyDecision.ASK_USER,
|
||||
@@ -2638,6 +2644,7 @@ describe('PolicyEngine', () => {
|
||||
'web_fetch',
|
||||
'write_todos',
|
||||
'memory',
|
||||
'save_memory',
|
||||
'read_tool',
|
||||
'write_tool',
|
||||
]);
|
||||
@@ -2667,6 +2674,7 @@ describe('PolicyEngine', () => {
|
||||
expect(excluded.has('activate_skill')).toBe(false);
|
||||
expect(excluded.has('ask_user')).toBe(false);
|
||||
expect(excluded.has('exit_plan_mode')).toBe(false);
|
||||
expect(excluded.has('save_memory')).toBe(false);
|
||||
// Read-only MCP tool allowed by annotation rule (matched via _serverName)
|
||||
expect(excluded.has('read_tool')).toBe(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user