feat(jetbrains): register Toggle Auto-Approve action - #12643
Open
kilo-code-bot[bot] wants to merge 1 commit into
Open
feat(jetbrains): register Toggle Auto-Approve action#12643kilo-code-bot[bot] wants to merge 1 commit into
kilo-code-bot[bot] wants to merge 1 commit into
Conversation
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.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 byPermission.Service.allowEverything) to a/auto-approveslash command.On that PR, @marius-kilocode asked: "would we not also want to add this consistently in jetbrains, vscode and am as well?"
Investigation
packages/kilo-vscode/): already has a fully-wired, discoverable toggle —kilo-code.new.toggleAutoApproveis registered incontributes.commands(Command Palette) andcontributes.keybindings(Ctrl+Alt+A/Cmd+Alt+A), backed by a sharedAutoApproveController. No change needed.src/agent-manager/), not a separate client. It reuses the exact sameAutoApproveControllerinstance and the sameChatView/PromptInputtoggle button as the sidebar (src/extension.ts:agentManagerHost.setAutoApproveController(autoApprove)), so it already gets the command/keybinding above for free. No change needed.packages/kilo-jetbrains/): had a per-sessionautoApprovetoggle (SessionController.setAutoApprove,KiloPluginSettings) wired only to a prompt-bar shield button (PromptPanel.AutoApproveButton). There was no registeredAnAction, so the toggle wasn't reachable from the keyboard or IDE action search — the JetBrains gap the reviewer was referring to.Changes (JetBrains only)
SendPromptContextwithisAutoApproveEnabledandtoggleAutoApprove().PromptPanelby delegating to the existingautoApprovefield andonAutoApproveTogglecallback (no new state, no behavior change to the existing button).ToggleAutoApproveAction(Kilo.ToggleAutoApprove, default shortcutAlt+A), following the existingStopSessionAction/SendPromptActionpattern of readingPromptDataKeys.SENDfrom the data context.kilo.jetbrains.frontend.xmland add its bundle strings.ToggleAutoApproveActionTest, updates toSendPromptActionTest/StopSessionActionTestfakes, aPromptPanelTestcase for the new members).@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 testcould not be run here. The change mirrors the existingStopSessionActionwiring exactly (sameDumbAwareActionshape, samePromptDataKeys.SENDlookup, same XML registration style) and adds tests following the existingStopSessionActionTestpattern. Please run./gradlew typecheck && ./gradlew testfrompackages/kilo-jetbrains/in CI/local review to confirm.Built for marius-kilocode by Kilo