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
5d17666a69
Update error messages in job creation tests
2025-10-31 16:16:03 -06:00
Kynan Ware
591050a8d2
Update pkg/cmd/agent-task/capi/job.go
...
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-31 16:06:37 -06:00
Kynan Ware
24885040cb
Fix: do not swallow job creation error
...
Reads the response body before decoding to allow multiple decoding attempts. Enhances error reporting by including HTTP status and error messages from both Job and JobError structures when job creation fails.
2025-10-31 15:54:01 -06: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
8c75079bf2
Add math package import to sessions.go
...
Imported the math package in sessions.go
2025-09-23 09:33:26 -06:00
Kynan Ware
e673dfe61c
Add TODO for better integer handling in GetPullRequestDatabaseID
2025-09-23 09:28:08 -06:00
Babak K. Shandiz
6fc5742a68
fix(agent-task/capi): return proper error message when resp is not a JSON
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-22 12:59:51 +01:00
Babak K. Shandiz
597cdaf081
fix(agent-task/capi): remove fallback to viewer when user id is zero
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 15:37:46 +01:00
Babak K. Shandiz
eba31343a8
test(agent-tassk/capi): update ListSessionsByResourceID tests
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 14:31:03 +01:00
Babak K. Shandiz
2fe60d9105
docs(agent-task/capi): add TODO note for dropping local ID generation
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 14:30:29 +01:00
Babak K. Shandiz
a108b4ee95
fix(agent-task/capi): fetch viewer when resource session user id is zero
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 14:29:44 +01:00
Babak K. Shandiz
9148f41cc6
fix(agent-task/capi): handle unpopulated resource session LastUpdatedAt
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 14:28:46 +01:00
Babak K. Shandiz
546ab1cf4b
refactor(agent-task/capi): keep resource private
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 14:27:08 +01:00
Ariel Deitcher
185e36c60f
update agents resource route
2025-09-18 17:20:16 -07:00
Babak K. Shandiz
e5739cc545
fix(agent-task/capi): add WorkflowRunID field to Session
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 16:11:17 +01:00
Babak K. Shandiz
b6816ad89a
refactor(agent-task/capi): remove unused slice
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 15:05:28 +01:00
Babak K. Shandiz
3ed9034ff8
fix(agent-task/capi): add Error field to Session
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 15:04:06 +01:00
Babak K. Shandiz
6235c33ff0
test(agent-task/capi): assert session with zero resource ID are kept
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 12:00:55 +01:00
Babak K. Shandiz
c68d1a31c0
fix(agent-task/capi): keep sessions with no resource attached
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 12:00:55 +01:00
Babak K. Shandiz
6ec4324d6d
docs(agent-task/capi): fix test case explanation
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 12:00:54 +01:00
Kynan Ware
08bc1a8d29
Fix session deduplication and add test for paging
...
Refactor ListLatestSessionsForViewer to use a map for tracking seen resource IDs, ensuring only the newest session per resource is kept. Add a test case to verify correct deduplication across paginated API responses.
2025-09-18 12:00:54 +01: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
fe95cd86f1
fix(agent-task/capi): add PremiumRequests field to Session
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-17 13:28:49 +01:00
Kynan Ware
ab796c80ef
Fix comment for GetSessionLogs method
2025-09-15 13:07:00 -06: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
ab7e4039da
refactor: move Copilot Agents home URL to capi
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:28 +01: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
8b1f722911
docs(agent-task/capi): remove redundant comment
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 12:09:34 +01:00
Babak K. Shandiz
0a9a4a4250
test(agent-task/capi): fix test case args
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 11:37:49 +01:00
Babak K. Shandiz
d52502b638
fix(agent-task/capi): skip unpopulated resource ID when hydrating
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 11:37: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
abd2d8a06d
test(agent-task/capi): add tests for GetPullRequestDatabaseID
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:49:27 +01:00
Babak K. Shandiz
f57114accc
feat(agent-task/capi): add GetPullRequestDatabaseID method
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:48:56 +01:00
Babak K. Shandiz
d80b25fbf2
test(agent-task/capi): add tests for GetSessionByResourceID
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 11:27:40 +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
a6dd9c1679
feat(agent-task/capi): add ListSessionsByResourceID
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 16:55:04 +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
ee8fc06077
test(agent-task/capi): add tests for GetSession
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:21 +01:00
Babak K. Shandiz
dcadeb75d4
feat(agent-task/capi): add GetSession method
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:21 +01:00
Babak K. Shandiz
4e1fcf1da9
refactor(agent-task/capi): populate PRs IsDraft
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:20 +01:00
Babak K. Shandiz
1e36e9f1e3
refactor(agent-task/capi): hydrate user data
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:11 +01:00
Babak K. Shandiz
19e17c54fd
refactor(agent-task/capi): drop embedding of unexported struct
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:56 +01:00
Babak K. Shandiz
585b639273
test(agent-task/capi): add CapiClientMock
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:56 +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
Babak K. Shandiz
be8e6f6491
test(agent-task/capi): add tests for job-related methods
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:55 +01:00
Babak K. Shandiz
79602d3334
test(agent-task/capi): add tests for session-related methods
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:55 +01:00
Babak K. Shandiz
0f5fd6ece0
fix(agent-task/capi): handle non-JSON error response
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:54 +01:00
Babak K. Shandiz
77bb72c2d4
fix(agent-task/capi): improve returned errs
...
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:54 +01:00