Skip to content

app: frontend: Add runCmd support and plugin identification#693

Draft
illume wants to merge 1 commit into
Azure:headlamp-downstreamfrom
illume:detect-ai-headlamp
Draft

app: frontend: Add runCmd support and plugin identification#693
illume wants to merge 1 commit into
Azure:headlamp-downstreamfrom
illume:detect-ai-headlamp

Conversation

@illume
Copy link
Copy Markdown
Collaborator

@illume illume commented May 29, 2026

Description

So the plugin can detect AI providers like GitHub Copilot, and azure models.

Related Issues

Changes Made

  • 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

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Performance tested (if applicable)
  • Accessibility tested (if applicable)

@illume illume force-pushed the detect-ai-headlamp branch from 10d7ce8 to 4997d1c Compare May 29, 2026 15:34
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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-assistant recognition to identifyPackages and update related unit tests.
  • Add gh support to the Electron runCmd IPC path (command validation + permission secret generation).
  • Pass runCmd-gh / runCmd-az secrets and a pluginRunCommand wrapper specifically to the ai-assistant plugin.

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

  • addRunCmdConsent currently overwrites a previously saved user denial because it uses a falsy check (if (!settings.confirmedCommands[command])). If a user chose “Deny” earlier (stored as false), installing/starting the plugin will flip it back to true, 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 thread app/electron/main.ts
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' });
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.

2 participants