Skip to content

Duplicate tool approval entries in auto-saved.toml #19485

@Abhijit-2592

Description

@Abhijit-2592

What happened?

When a user selects the "Allow for all future sessions" option in a tool confirmation dialog, the corresponding policy entry is added twice to the auto-saved.toml file. This indicates that the policy saving logic is being triggered twice for a single user action.

Steps to reproduce

  1. Start Gemini CLI.
  2. Trigger a tool confirmation (e.g., by running a command like ls if shell confirmation is enabled, or asking for an edit).
  3. Choose the option "Allow for all future sessions".
  4. Open the auto-saved.toml policy file (typically in ~/.gemini/policies/auto-saved.toml).
  5. Observe that there are two identical entries for the tool or command prefix.

What did you expect to happen?

Only a single entry should be added to the auto-saved.toml file for each unique tool approval.

Additional context

Initial investigation suggests this is due to redundant UPDATE_POLICY triggers originating from both the individual tool's onConfirm callback and the centralized Scheduler loop.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions