Skip to content

utils: Fixes for the copilot work in ACA #2337

Open
motm32 wants to merge 3 commits into
mainfrom
meganmott/fixCopilotErrors
Open

utils: Fixes for the copilot work in ACA #2337
motm32 wants to merge 3 commits into
mainfrom
meganmott/fixCopilotErrors

Conversation

@motm32

@motm32 motm32 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

I noticed the "Deploy to Container app with Copilot..." wasn't working. Not sure if it is because I switched to Mac but these changes seemed to fix it.

I also upgraded the "vscode-tas-client" as a fix was put in for this error that was occuring: microsoft/tas-client#95.

Copilot AI review requested due to automatic review settings June 11, 2026 17:26
@motm32 motm32 requested a review from a team as a code owner June 11, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes issues with the “Deploy to Container app with Copilot…” flow by improving how the Copilot CLI binary is located/ensured, and updates vscode-tas-client to pick up fixes mentioned in microsoft/tas-client#95.

Changes:

  • Improve Copilot CLI discovery by falling back to the globally-installed copilot on PATH and prompting to install the CLI when missing.
  • Refine Copilot response validation and context parsing (response?.data check and RegExp.exec usage).
  • Upgrade vscode-tas-client from ^0.1.84 to ^0.2.1 (and lockfile updates), plus a minor type import cleanup in index.d.ts.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
utils/src/errors.ts Updates the Copilot-related error message to be more specific to CLI interaction failures.
utils/src/copilot/copilot.ts Adds Copilot CLI installation check and introduces PATH-based CLI resolution fallback.
utils/package.json Bumps vscode-tas-client dependency version.
utils/package-lock.json Updates lockfile to reflect the new vscode-tas-client / tas-client versions.
utils/index.d.ts Removes an unused vscode type import alias.
Files not reviewed (1)
  • utils/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread utils/src/copilot/copilot.ts Outdated
Comment on lines +28 to +40
try {
const fullPath = execFileSync(
process.platform === 'win32' ? 'where' : 'which',
['copilot'],
{ encoding: 'utf-8' },
).trim().split('\n')[0];
if (fullPath) {
return fullPath;
}
} catch {
// which/where failed, fall back to bare command name
}
return 'copilot';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you understand what it's concerned about here?

@MicroFish91 MicroFish91 Jun 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe it's referring to \r\n being the default line-ending sequence for Windows, while \n is the default for Linux and macOS

so split on \n has potential to leave a trailing \r in the path? something like that

@alexweininger

Copy link
Copy Markdown
Member

I think we should be using the @microsoft/vscode-processutils package here instead of directly importing and using child_process

Also, should we extract this as a util method and put it with the other related util methods in utils/src/copilot/installCopilotCli.ts?

Megan Mott added 2 commits June 17, 2026 09:43
…rrors

# Conflicts:
#	utils/src/copilot/installCopilotCli.ts
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.

5 participants