Skip to content

Conversation

@joshspicer
Copy link
Member

@joshspicer joshspicer commented Jan 28, 2026

fixes microsoft/vscode#279098
ctx https://vscodeteam.slack.com/archives/C04PKH0BDQS/p1769541405028749

Implements /agents/swe/jobs/{owner}/{repo}/enabled

  • Friendlier messages, eg:
Screenshot 2026-01-28 at 12 28 01 PM
  • Does not continue fetching against other endpoints (/models) if 401/403/422 returned

Copilot AI review requested due to automatic review settings January 28, 2026 20:34
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 28, 2026
Copy link
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 implements the /agents/swe/jobs/{owner}/{repo}/enabled endpoint check to provide better user experience when the Copilot cloud agent (CCA) is disabled for a repository. It adds early validation with friendlier error messages and prevents unnecessary API calls to other endpoints when access is denied.

Changes:

  • Adds isCCAEnabled method to check CCA availability before operations
  • Implements caching of CCA enabled status per repository
  • Provides user-friendly error messages for different failure scenarios (401/403/422)
  • Early returns in provideChatSessionProviderOptions to avoid fetching models/agents when CCA is disabled

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/platform/github/common/githubService.ts Adds CCAEnabledResult interface and isCCAEnabled method signature to IOctoKitService
src/platform/github/common/octoKitServiceImpl.ts Implements isCCAEnabled method that calls the new endpoint and handles status codes
src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts Integrates CCA enabled check with caching, provides friendly error messages, and implements early exit when disabled
src/extension/agents/vscode-node/test/mockOctoKitService.ts Updates mock to include isCCAEnabled method returning enabled by default
package.json Updates @vscode/copilot-api from 0.2.9 to 0.2.12 to support new RequestType.CopilotAgentJobEnabled
package-lock.json Reflects the dependency version update

lszomoru
lszomoru previously approved these changes Jan 28, 2026
@joshspicer joshspicer added this pull request to the merge queue Jan 28, 2026
Merged via the queue into main with commit 59ee298 Jan 28, 2026
19 checks passed
@joshspicer joshspicer deleted the joshspicer/cca/enabled branch January 28, 2026 21:20
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.

Cloud Agent: Provide action for a 4XX error

5 participants