Skip to content

feat(agent): add "enable-confirmations" meta-command to undo "don't ask me again" - #681

Open
PratikDhanave wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
PratikDhanave:feat/enable-confirmations-meta
Open

feat(agent): add "enable-confirmations" meta-command to undo "don't ask me again"#681
PratikDhanave wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
PratikDhanave:feat/enable-confirmations-meta

Conversation

@PratikDhanave

Copy link
Copy Markdown

What

Adds an enable-confirmations meta-command that turns action confirmations back on after the user selected "Yes, and don't ask me again".

Why

Fixes #305. Selecting "Yes, and don't ask me again" at a confirmation prompt sets SkipPermissions = true for the rest of the session (pkg/agent/conversation.go), and there was no way to undo it short of restarting kubectl-ai. This adds a first-class way to re-enable the safety prompts mid-session.

Change

New case in handleMetaQuery:

> enable-confirmations
Confirmations re-enabled: you'll be asked before commands that modify resources.
  • Clears SkipPermissions, so the agent resumes prompting before resource-modifying commands.
  • Idempotent — if confirmations are already on, it replies "Confirmations are already enabled." and changes nothing.

Testing

Adds TestHandleMetaQuery_EnableConfirmations (covers the toggle-off and the already-enabled/idempotent path). go build, go vet, and go test ./pkg/agent/ pass.

…sk me again"

After choosing "Yes, and don't ask me again" at a confirmation prompt,
SkipPermissions is set for the rest of the session with no way to turn
confirmations back on without restarting. Add an `enable-confirmations`
meta-command that clears SkipPermissions so the agent resumes asking before
commands that modify resources. Idempotent when confirmations are already on.

Fixes GoogleCloudPlatform#305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to reset the action confirmation dialogue after selecting "Yes and don't ask me again"

1 participant