Commit graph

11279 commits

Author SHA1 Message Date
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
5f73d3b438
refactor(agent-task list): remove unused BaseRepo from ListOptions
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 12:00:54 +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
c02a8d8c94
Merge pull request #11760 from cli/kw/update-gh-agent-root-cmd-help
`gh agent-task`: update help text
2025-09-18 11:11:44 +01:00
Babak K. Shandiz
a7c8fa4b84
docs(agent-task): use heredoc.Doc
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 10:48:53 +01:00
Babak K. Shandiz
151b971933
Merge pull request #11755 from cli/babakks/polish-agent-task-view
`gh agent-task view`: polish and fix some issues
2025-09-18 10:38:15 +01:00
Babak K. Shandiz
6f698407fb
docs(pr/shared): add a TODO on decoupling PR finder from IO
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 10:25:49 +01:00
Babak K. Shandiz
f0a0c4b856
fix(agent-task view): display zero premium requests
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 10:18:40 +01:00
Babak K. Shandiz
6927d642f6
fix(agent-task/shared): make capitalised status names consistent
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 10:16:00 +01:00
Lucas
bf272305ff
feat(gist): retrieve full content for truncated gist files
* Added logic to fetch full content for truncated files when updating a gist.
* Utilizes `shared.GetRawGistFile` to retrieve the complete content based on the `RawURL`.
2025-09-18 06:35:35 +02:00
Lucas
704bb4164c
feat(gist): retrieve full content for truncated gist files
* Added logic to fetch the full content of a gist file if it is marked as truncated.
* Utilizes the `GetRawGistFile` function to obtain the complete content from the provided `RawURL`.
2025-09-18 06:35:31 +02:00
Lucas
62ea060590
feat(gist): add GetRawGistFile function to retrieve raw gist content
* Implements a new function to fetch the raw content of a gist using its `rawURL`.
* Handles HTTP requests and responses, including error management for non-200 status codes.
2025-09-18 06:35:16 +02:00
Lucas
b1fdb363ff
feat(gist): add RawURL and Truncated fields to GistFile
* Added `RawURL` to store the raw URL of the gist file.
* Added `Truncated` to indicate if the content is truncated.
2025-09-18 05:28:48 +02:00
Kynan Ware
7d2dfd3493
Update pkg/cmd/agent-task/agent_task.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-17 20:37:12 -06:00
Kynan Ware
562efc91c7
Update pkg/cmd/agent-task/agent_task.go 2025-09-17 20:34:03 -06:00
Kynan Ware
40a590773e Enhance agent-task command help and usage info
Updated the agent-task command to provide improved usage, long description, argument annotations, and examples. This enhances the CLI user experience by clarifying how to use the command and identify agent tasks.
2025-09-17 20:31:24 -06:00
Kynan Ware
0c3171c1ab
Merge pull request #11756 from cli/kw/pr-feedback-for-11752
`gh agent-task view`: PR feedback for #11752
2025-09-17 12:32:24 -06:00
Kynan Ware
25c0d0cf90 Refactor comments in stripDiffFormat function
Simplified and clarified comments in the stripDiffFormat function to improve readability and maintainability. No functional changes were made to the code.
2025-09-17 12:16:04 -06:00
Kynan Ware
f6b49858a2 Remove obsolete log-3 test data files
Deleted log-3-input.txt and log-3-want.txt from testdata as they are no longer needed for current tests.
2025-09-17 12:09:51 -06:00
Babak K. Shandiz
661817de50
fix(agent-task view): omit session overview in log mode
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-17 13:59:13 +01:00
Babak K. Shandiz
99a61618df
fix(agent-task view): display premium requests used
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-17 13:29:38 +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
Babak K. Shandiz
49ba21a366
fix(agent-task view): display session duration
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-17 12:20:40 +01:00
Babak K. Shandiz
87b310a881
fix(agent-task view): display completed sessions as "Ready for review"
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-17 11:58:04 +01:00
Babak K. Shandiz
897c2b12b4
fix(agent-task view): disable PR finder progress indicator
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-17 11:50:08 +01:00
Babak K. Shandiz
1f5cbc5dff
test(pr/shared): assert FindOptions.DisableProgress is respected
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-17 11:47:49 +01:00
Babak K. Shandiz
5b9d6ae3fc
fix(pr/shared): add DisableProgress field to FindOptions
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-17 11:47:18 +01:00
Babak K. Shandiz
6eafe9687c
Merge pull request #11752 from cli/kw/run-view-pr-feedback
`gh agent-task view`: Follow-up to #11743
2025-09-17 10:00:50 +01:00
Kynan Ware
c55003bba2
Merge pull request #11746 from cli/babakks/add-follow-option-to-agent-task-create
`gh agent-task create`: add `--follow` flag
2025-09-16 18:33:26 -06:00
Kynan Ware
b3401ffd74 Refactor stripDiffFormat guard clause logic
Rearranged the guard clause in stripDiffFormat to return early if no hunk header is found, improving code clarity and reducing nesting.
2025-09-16 17:46:43 -06:00
Kynan Ware
c0a2648436 Use filepath.Ext to detect file extension in markdown renderer
Replaces manual string splitting with filepath.Ext for determining the file extension in renderFileContentAsMarkdown. This improves accuracy, especially for files with multiple dots in their names.
2025-09-16 17:34:57 -06:00
Kynan Ware
65b45adbd8 Improve log rendering error handling and test coverage
Refactors log rendering to print errors to stderr and continue processing on JSON parse or rendering failures, instead of returning early. Updates tests to check both stdout and stderr outputs, and adds new test cases and testdata for tolerant parsing and error scenarios.
2025-09-16 17:21:01 -06:00
Benjamin Levesque
914531e6f1
fixup! examples 2025-09-16 23:07:11 +02:00
Benjamin Levesque
4449af614c
fix error missing in json output 2025-09-16 23:00:41 +02:00
Benjamin Levesque
5bb76e832b
examples 2025-09-16 22:00:07 +02:00
Benjamin Levesque
3cdd359987
remove showToken from authEntry 2025-09-16 21:57:28 +02:00
Kynan Ware
97d3253aaf Prefix rendered shell commands with '$ ' in logs
Shell commands in log output are now prefixed with '$ ' for improved readability and consistency with common shell output conventions. Updated related test data and test helper comments to reflect this change.
2025-09-16 11:58:58 -06:00
Kynan Ware
d636f4c213 Clarify comment on CRLF normalization in tests
Updated comments in log_test.go to clarify that CRLF is normalized to LF for OS-agnostic test behavior, improving code readability.
2025-09-16 11:47:48 -06:00
Kynan Ware
37d8e0a438 Refactor generic tool call titles map to package scope
Moved the genericToolCallNamesToTitles map from inside the renderGenericToolCall function to a package-level variable for improved readability and potential reuse. This change also updates the function signature order for consistency.
2025-09-16 11:46:16 -06:00
Kynan Ware
4d9038ad31 Add pager support to log output in printLogs
Introduces use of a pager for log output in the printLogs function. If the pager fails to start, an error message is printed to stderr. This improves log readability for long outputs.
2025-09-16 11:26:55 -06:00
Babak K. Shandiz
dab285c61a
test(agent-task create): add test for --follow
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-16 13:27:39 +01:00
Babak K. Shandiz
f5ed563a42
docs(agent-task create): add example for --follow flag
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-16 13:18:26 +01:00
Babak K. Shandiz
4f7d577b97
feat(agent-task create): add --follow flag
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-16 13:18:09 +01:00
Babak K. Shandiz
134ae31fea
refactor(agent-task create): extract session URL polling into a func
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-16 13:07:01 +01:00
Babak K. Shandiz
a0696dd211
Merge pull request #11743 from cli/kw-bs/1012-gh-agent-task-view-respects--f--follow-and---log
`gh agent-task view`: add support for `--log` and `--follow`
2025-09-16 11:40:13 +01:00
Kynan Ware
f779a3d16c Add TODO for bash-related tool call details
Inserted a TODO comment to consider including more details for bash-related tool calls in the log rendering function.
2025-09-15 14:23:12 -06:00
Kynan Ware
77509fcfb3 Update comment for reasoning text formatting
Clarifies that reasoning text should be formatted as a normal 'thought' message without a heading, improving code documentation.
2025-09-15 14:19:31 -06:00
Kynan Ware
887e842717 Enable Bash session tool handling in log rendering
Uncomments and activates support for Bash session tool calls (write_bash, read_bash, stop_bash, async_bash, read_async_bash, stop_async_bash) in the renderLogEntry function. Also defines the corresponding argument structs, enabling proper handling and display of these tool calls in the log output.
2025-09-15 14:18:42 -06:00