Skip to content

utils: Changes to enable re running commands with copilot#2136

Open
motm32 wants to merge 8 commits intomainfrom
meganmott/rerunchanges
Open

utils: Changes to enable re running commands with copilot#2136
motm32 wants to merge 8 commits intomainfrom
meganmott/rerunchanges

Conversation

@motm32
Copy link
Contributor

@motm32 motm32 commented Dec 2, 2025

This PR includes a couple of changes:

  1. Edits to copilot prompts to extract subscription and activity log child items
  2. Edits to copilot user input to match up the picks based on label and subscription instead of the entire item (this makes the command run much faster)
  3. Wrapper to executeCommand so we can pass in additional context
  4. Add a run generic prompt step which preforms similarly to runQuickPickWizard but doesn't require the step to be a quick pick step.

Some of these changes are used in RG and others in the ACA extension.

}

function extractActivityChildren(context: string): string {
const activityLog = JSON.parse(context) as { children?: unknown };
Copy link
Member

Choose a reason for hiding this comment

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

Should probably try/catch this just in case the shape is corrupted.

async (context: types.IActionContext) => {
let injectedContext: Partial<types.IActionContext> | undefined;
if (args.length > 0) {
const metadata = args[args.length - 1];
Copy link
Member

Choose a reason for hiding this comment

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

Should we just do a .find on the metadata instead of assuming that it'll always be at the end if the arg list? I think that'll make this command a little more resilient.

@motm32
Copy link
Contributor Author

motm32 commented Feb 24, 2026

In the previous a number of changes were made:

  • Created copilotUtils which creates a canary property to mark and detect if a context uses CopilotUserInput see this PR comment for more info
  • requested changes
  • switched from using vscode llm to github copilot sdk. This allows us to create sessions and use the same session for each CopilotUserInput call

@motm32 motm32 marked this pull request as ready for review February 24, 2026 22:26
@motm32 motm32 requested a review from a team as a code owner February 24, 2026 22:26
"rootDir": ".",
"declaration": false
"declaration": false,
"skipLibCheck": true
Copy link
Contributor Author

@motm32 motm32 Feb 24, 2026

Choose a reason for hiding this comment

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

For some reason the @vscode-jsonrpc/node which the github copilot sdk has a dependency on causes issues. From what I have looked into the package does not have a proper package map so when we try to build the cjs it causes issues. I think this is mainly because the github copilot sdk is currently only using esm. If that is gonna cause problems for us I can revert this back to use the vscode llm.

Not sure if that is also the reason the tests are now failing.

Copy link
Contributor

Choose a reason for hiding this comment

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

We have seen a number of issues where the CJS and ESM types conflict but so far we've been able to just put a targeted @ts-ignore in the code. Is that possible here?

"vscode": "^1.105.0"
},
"dependencies": {
"@github/copilot-sdk": "0.1.19",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make sure this isn't wrecking our bundle size?

"rootDir": ".",
"declaration": false
"declaration": false,
"skipLibCheck": true
Copy link
Contributor

Choose a reason for hiding this comment

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

We have seen a number of issues where the CJS and ESM types conflict but so far we've been able to just put a targeted @ts-ignore in the code. Is that possible here?

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.

3 participants