app: frontend: Add runCmd support and plugin identification#693
Draft
illume wants to merge 1 commit into
Draft
Conversation
10d7ce8 to
4997d1c
Compare
Adds full runCmd integration for the ai-assistant plugin, including: - Consent handling for gh and az commands - New COMMANDS_WITH_CONSENT.ai_assistant entry - Support for runCmd-gh and runCmd-az secrets - Plugin-level runCommand wrapper for ai-assistant - Recognition of ai-assistant in identifyPackages - Updated tests across runCmd, plugin execution, and package detection
4997d1c to
4537423
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the app/plugin execution pipeline so the new ai-assistant plugin can be recognized and can execute gh/az commands (with consent + permission-secret gating), enabling auto-detection of AI providers like GitHub Copilot and Azure models.
Changes:
- Add
ai-assistantrecognition toidentifyPackagesand update related unit tests. - Add
ghsupport to the ElectronrunCmdIPC path (command validation + permission secret generation). - Pass
runCmd-gh/runCmd-azsecrets and apluginRunCommandwrapper specifically to theai-assistantplugin.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/plugin/runPlugin.ts | Adds ai-assistant to package/path identification logic. |
| frontend/src/plugin/runPlugin.test.ts | Updates and adds tests for identifyPackages including ai-assistant. |
| frontend/src/plugin/index.ts | Exposes runCmd-gh/runCmd-az secrets and a pluginRunCommand wrapper for ai-assistant. |
| app/electron/runCmd.ts | Adds ai_assistant consent entries, adds runCmd-gh secret, and allows gh in command validation. |
| app/electron/runCmd.test.ts | Adds a unit test covering validateCommandData accepting gh. |
| app/electron/main.ts | Auto-adds runCmd consent for the ai-assistant plugin at startup. |
Comments suppressed due to low confidence (1)
app/electron/runCmd.ts:208
addRunCmdConsentcurrently overwrites a previously saved user denial because it uses a falsy check (if (!settings.confirmedCommands[command])). If a user chose “Deny” earlier (stored asfalse), installing/starting the plugin will flip it back totrue, bypassing the user’s choice. This is especially relevant now that ai-assistant consents are being added.
for (const command of commands) {
if (!settings.confirmedCommands[command]) {
settings.confirmedCommands[command] = true;
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+683
to
+691
| if (isPackage['ai-assistant']) { | ||
| function pluginRunCommand( | ||
| command: string, | ||
| args: string[], | ||
| options: {} | ||
| ): ReturnType<typeof internalRunCommand> { | ||
| return internalRunCommand( | ||
| command as any, | ||
| args, |
Comment on lines
1483
to
+1485
| // add run cmd consent for aks-desktop to avoid consent dialogs for the aks-desktop plugin | ||
| addRunCmdConsent({ name: 'aks-desktop' }); | ||
| addRunCmdConsent({ name: 'ai-assistant' }); |
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.
Description
So the plugin can detect AI providers like GitHub Copilot, and azure models.
Related Issues
Changes Made
Testing