Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

Adds missing unit test coverage for the GraphQL-based partner agent detection methods introduced in #2775.

Test Coverage

githubAPI.spec.ts - Direct function tests (10 tests):

  • getAssignableActorsWithSuggestedActors: pagination, empty results, error propagation
  • getAssignableActorsWithAssignableUsers: fallback API with same coverage

octoKitServiceImpl.spec.ts - Integration tests (7 tests):

  • getAssignableActors: authentication flows, API fallback logic, error handling

Key Scenarios Tested

  • Pagination across multiple GraphQL pages
  • Empty result sets from both APIs
  • Authentication token absence
  • Network and GraphQL errors (properly propagated or caught depending on layer)
  • Fallback from suggestedActorsassignableUsers for older GHES instances
  • createIfNone authentication option

All 17 tests passing.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 7 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 changed the title [WIP] Update GraphQL query to detect partner agents Add unit tests for GraphQL assignable actors API Jan 9, 2026
Copilot AI requested a review from joshspicer January 9, 2026 21:48
Base automatically changed from joshspicer/agents-partner-2 to main 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.

2 participants