Skip to content

feat(jetbrains): register Toggle Auto-Approve action - #12643

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
feat/jetbrains-toggle-auto-approve-action
Open

feat(jetbrains): register Toggle Auto-Approve action#12643
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
feat/jetbrains-toggle-auto-approve-action

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Context

Follow-up to #12444 (feat(tui): register /auto-approve slash command for toggling auto-approve mode), which promoted the TUI's existing Ctrl+P → "Enable/Disable auto-approve mode" palette entry (backed by Permission.Service.allowEverything) to a /auto-approve slash command.

On that PR, @marius-kilocode asked: "would we not also want to add this consistently in jetbrains, vscode and am as well?"

Investigation

  • VS Code (packages/kilo-vscode/): already has a fully-wired, discoverable toggle — kilo-code.new.toggleAutoApprove is registered in contributes.commands (Command Palette) and contributes.keybindings (Ctrl+Alt+A / Cmd+Alt+A), backed by a shared AutoApproveController. No change needed.
  • Agent Manager ("am"): this is a feature inside the VS Code extension (src/agent-manager/), not a separate client. It reuses the exact same AutoApproveController instance and the same ChatView/PromptInput toggle button as the sidebar (src/extension.ts: agentManagerHost.setAutoApproveController(autoApprove)), so it already gets the command/keybinding above for free. No change needed.
  • JetBrains (packages/kilo-jetbrains/): had a per-session autoApprove toggle (SessionController.setAutoApprove, KiloPluginSettings) wired only to a prompt-bar shield button (PromptPanel.AutoApproveButton). There was no registered AnAction, so the toggle wasn't reachable from the keyboard or IDE action search — the JetBrains gap the reviewer was referring to.

Changes (JetBrains only)

  • Extend SendPromptContext with isAutoApproveEnabled and toggleAutoApprove().
  • Implement both on PromptPanel by delegating to the existing autoApprove field and onAutoApproveToggle callback (no new state, no behavior change to the existing button).
  • Add ToggleAutoApproveAction (Kilo.ToggleAutoApprove, default shortcut Alt+A), following the existing StopSessionAction/SendPromptAction pattern of reading PromptDataKeys.SEND from the data context.
  • Register the action in kilo.jetbrains.frontend.xml and add its bundle strings.
  • Add/extend unit tests (ToggleAutoApproveActionTest, updates to SendPromptActionTest/StopSessionActionTest fakes, a PromptPanelTest case for the new members).
  • Add a changeset for @kilocode/kilo-jetbrains.

Not changed

VS Code and Agent Manager already satisfy the request end-to-end, so no VS Code/webview changes or changesets were needed for those surfaces.

Verification

No Java/JDK toolchain was available in this environment, so ./gradlew :frontend:compileKotlin / ./gradlew test could not be run here. The change mirrors the existing StopSessionAction wiring exactly (same DumbAwareAction shape, same PromptDataKeys.SEND lookup, same XML registration style) and adds tests following the existing StopSessionActionTest pattern. Please run ./gradlew typecheck && ./gradlew test from packages/kilo-jetbrains/ in CI/local review to confirm.


Built for marius-kilocode by Kilo

Follow-up to #12444, which added a TUI /auto-approve slash command
wrapping the existing Permission.Service.allowEverything toggle.
A reviewer asked whether the same discoverability should be added to
JetBrains, VS Code, and Agent Manager (am).

- VS Code already exposes kilo-code.new.toggleAutoApprove as both a
  Command Palette command and a keybinding, and the Agent Manager
  webview shares the same AutoApproveController and prompt bar toggle
  as the sidebar, so no changes are needed there.
- JetBrains had a per-session autoApprove toggle wired only to a
  prompt bar button, with no registered AnAction. Add
  Kilo.ToggleAutoApprove (Alt+A default shortcut), following the
  existing StopSessionAction/SendPromptAction pattern: extend
  SendPromptContext with isAutoApproveEnabled/toggleAutoApprove(),
  implement them on PromptPanel by delegating to the existing
  autoApprove field and onAutoApproveToggle callback, and register the
  action in kilo.jetbrains.frontend.xml.
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.

0 participants