Skip to content

Conversation

@joshspicer
Copy link
Member

Copilot AI and others added 6 commits January 9, 2026 12:42
- Add GraphQL queries for fetching assignable actors (suggestedActors and assignableUsers APIs)
- Add getAssignableActors method to IOctoKitService interface
- Implement dynamic partner agent detection in CopilotCloudSessionsProvider
- Add caching mechanism to avoid repeated API calls
- Update known Copilot agent logins based on spec
- Fall back to hardcoded list when API is unavailable

Co-authored-by: joshspicer <[email protected]>
- Create COPILOT_AGENT_METADATA mapping for known Copilot agent logins
- Look up `at` values from HARDCODED_PARTNER_AGENTS when available
- Preserve the `at` field structure from the hardcoded list

Co-authored-by: joshspicer <[email protected]>
- Delete COPILOT_AGENT_METADATA mapping
- Simplify getAvailablePartnerAgents to check HARDCODED_PARTNER_AGENTS directly
- Check if agent ID or name matches assignable actors
- Preserve all fields from HARDCODED_PARTNER_AGENTS including `at` values

Co-authored-by: joshspicer <[email protected]>
Copilot AI review requested due to automatic review settings January 9, 2026 20:43
@joshspicer joshspicer enabled auto-merge January 9, 2026 20:45
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 9, 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 adds GraphQL query functionality to detect partner agents (like Copilot, Claude, and Codex) that are available for assignment in a repository. The implementation queries GitHub's assignable actors API to determine which hardcoded partner agents should be shown to users.

Key Changes:

  • Adds GraphQL queries to fetch assignable actors from GitHub API with fallback support for older GitHub Enterprise Server instances
  • Implements caching of partner agent availability per repository
  • Integrates the detection logic into the Copilot Cloud sessions provider to filter available agents

Reviewed changes

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

Show a summary per file
File Description
src/platform/github/common/githubAPI.ts Adds AssignableActor interface and two new GraphQL query functions for fetching assignable actors with pagination support
src/platform/github/common/githubService.ts Adds getAssignableActors method to the IOctoKitService interface and makes base service properties protected for subclass access
src/platform/github/common/octoKitServiceImpl.ts Implements getAssignableActors with auth handling and fallback logic from suggestedActors to assignableUsers API
src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts Adds assignableActorLogin to partner agents config, implements caching and filtering logic to show only available agents
src/extension/agents/vscode-node/test/organizationAndEnterpriseAgentProvider.spec.ts Updates mock to include stub implementation of new getAssignableActors method
Comments suppressed due to low confidence (1)

src/platform/github/common/githubAPI.ts:481

  • The error handling in the GraphQL query functions doesn't distinguish between different failure modes. When makeGitHubGraphQLRequest returns undefined (which happens on non-OK responses or JSON parse errors), the function silently breaks out of the loop and returns whatever actors were accumulated so far. This could lead to incomplete results being cached and used without any indication that the fetch was partial or failed.

Consider logging when a partial result is returned, or propagating the error so callers know the operation didn't complete successfully.

		const result = await makeGitHubGraphQLRequest(fetcherService, logService, telemetry, host, query, token, variables);

		if (!result?.data?.repository?.suggestedActors) {
			break;
		}

Comment on lines +538 to +542
if (!result?.data?.repository?.assignableUsers) {
break;
}

const data = result.data.repository.assignableUsers;
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The error handling in the GraphQL query functions doesn't distinguish between different failure modes. When makeGitHubGraphQLRequest returns undefined (which happens on non-OK responses or JSON parse errors), the function silently breaks out of the loop and returns whatever actors were accumulated so far. This could lead to incomplete results being cached and used without any indication that the fetch was partial or failed.

Consider logging when a partial result is returned, or propagating the error so callers know the operation didn't complete successfully.

This issue also appears in the following locations of the same file:

  • line 477
Suggested change
if (!result?.data?.repository?.assignableUsers) {
break;
}
const data = result.data.repository.assignableUsers;
if (!result) {
logService.warn('[githubAPI] GitHub GraphQL request for assignableUsers returned no result; returning partial list of assignable actors.');
telemetry.publicLog2?.('githubAPI.assignableUsers.partialResult', { reason: 'noResult' });
break;
}
const assignableUsers = result.data?.repository?.assignableUsers;
if (!assignableUsers) {
logService.warn('[githubAPI] GitHub GraphQL response for assignableUsers was missing data; returning partial list of assignable actors.');
telemetry.publicLog2?.('githubAPI.assignableUsers.partialResult', { reason: 'missingAssignableUsers' });
break;
}
const data = assignableUsers;

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI commented Jan 9, 2026

@joshspicer I've opened a new pull request, #2776, to work on those changes. Once the pull request is ready, I'll request review from you.

@TylerLeonhardt TylerLeonhardt added this pull request to the merge queue Jan 9, 2026
Merged via the queue into main with commit 8912ddb Jan 9, 2026
19 checks passed
@TylerLeonhardt TylerLeonhardt deleted the joshspicer/agents-partner-2 branch January 9, 2026 22:10
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