Commit graph

15 commits

Author SHA1 Message Date
Kynan Ware
78b958f9ae
fix(agent-task): resolve Copilot API URL dynamically (#12956)
* fix(agent-task): resolve Copilot API URL dynamically

Query viewer.copilotEndpoints.api to get the correct Copilot API URL
for the user's host instead of hardcoding api.githubcopilot.com. This
fixes 401 errors for ghe.com tenancy users whose Copilot API lives at
a different endpoint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-18 18:14:02 +00:00
Babak K. Shandiz
4681b40e70
fix(agent-task/capi): fix capi API version
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-20 18:04:12 +00:00
William Martin
8a4154cfe7 Refactor cfg out of CAPI Client 2025-11-14 20:21:54 +01:00
Kynan Ware
17085d3c5e Add custom agent support to job creation
Introduces a 'customAgent' parameter to the CreateJob API, CLI options, and related mocks and tests.
2025-10-31 14:57:48 -06:00
Kynan Ware
680ebade59
Remove repo-scoped session listing and related code
This commit removes support for listing agent sessions scoped to a specific repository, including the ListSessionsForRepo method and related tests. The list command now always lists the latest sessions for the viewer, simplifying the code and user experience. Test and mock code have been updated accordingly.
2025-09-18 12:00:50 +01:00
Babak K. Shandiz
fbcdeed41f feat(agent-task/capi): add GetSessionLogs method
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-15 10:13:55 -06:00
Babak K. Shandiz
6b29c2905c
fix(agent-task/capi): also return PR URL from GetPullRequestDatabaseID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:28 +01:00
Babak K. Shandiz
f8f7b0e09b
fix(agent-task/capi): add GetPullRequestDatabaseID to CapiClient interface
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:50:09 +01:00
Babak K. Shandiz
9b2ecf4c0e
feat(agent-task/capi): add ListSessionsByResourceID method to CapiClient interface
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 16:55:46 +01:00
Babak K. Shandiz
87b772dc83
feat(agent-task/capi): add GetSession method to CapiClient interface
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:21 +01:00
Babak K. Shandiz
ab99ee530a
test(agent-task/capi): add go:generate directive to gen mock
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:56 +01:00
Kynan Ware
b2f506fd50 Add base branch option to agent task creation
Introduces a BaseBranch field to CreateOptions and updates the job creation flow to include the base branch in the payload if specified. The CapiClient and related methods are updated to accept and handle the baseBranch parameter, and tests are added to verify correct behavior when a base branch is provided.
2025-09-03 17:33:38 -06:00
Kynan Ware
3574ee9c30 Add agent task creation command and job API
Introduces the 'create' subcommand for agent tasks, allowing users to create agent jobs via the Copilot API. Adds job API client methods, job model, and polling logic to retrieve associated pull requests. Includes tests for various job creation scenarios.
2025-09-02 20:42:39 -06:00
Kynan Ware
e750e71288 Add repo-scoped agent session listing support
Introduces ListSessionsForRepo to CapiClient and CAPIClient, enabling listing agent sessions for a specific repository. Updates the list command and tests to support repo override and repo-scoped session queries, including error handling and test coverage for repo resolution.
2025-08-29 17:27:04 -06:00
Kynan Ware
dd424d85fd Add agent task listing command and CAPI client
Introduces a new 'list' subcommand under agent-task for listing agent tasks. Implements a Copilot API client for fetching agent sessions and hydrating them with pull request data. Updates PullRequest and PRRepository types to support new fields. Adds dependencies for msgpack and tagparser.

Co-Authored-By: Babak K. Shandiz <babakks@github.com>
2025-08-28 22:00:35 -06:00