Commit graph

38 commits

Author SHA1 Message Date
Max Beizer
0d05a8acca Address Copilot review feedback
- Prioritize --json output over --log/--follow so JSON is not silently ignored
- Emit null for zero createdAt/updatedAt values, consistent with completedAt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-01 10:18:21 -06:00
Max Beizer
ceb8cf2561 Polish --json support for agent-task view
- Rename 'status' field to 'state' for consistency with struct and UI
- Add missing JSON fields: completedAt, user, pullRequestTitle, pullRequestState
- Add test for nil PullRequest with --json
- Expand existing JSON test to cover new fields

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-01 09:09:08 -06:00
Max Beizer
250d5a850a Fix gofmt alignment in view_test.go
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-01 08:57:53 -06:00
Max Beizer
7241b42ecf Add --json support to gh agent-task view
Add --json, --jq, and --template flags to `gh agent-task view`,
consistent with the pattern used by `gh pr view --json`,
`gh issue view --json`, etc.

This reuses the same ExportData interface and SessionFields defined
for list, applying them to the single-session view output.

Closes https://github.com/cli/cli/issues/12805 (partial)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 09:22:28 -06:00
Babak K. Shandiz
eb3c842818
test(agent-task view): populate Session.Name in all test cases
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 17:39:06 +01:00
Babak K. Shandiz
ecfbb67e99
fix(agent-task view): improve session overview
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 17:37:25 +01:00
Babak K. Shandiz
3e43a98814
refactor(agent-task view): merge empty println calls with next
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 16:47:40 +01:00
Babak K. Shandiz
3091c21320
fix(agent-task view): re-fetch session to get all pieces of data
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-19 16:45:42 +01:00
Ariel Deitcher
185e36c60f update agents resource route 2025-09-18 17:20:16 -07:00
Babak K. Shandiz
123c9eaba8
fix(agent-task view): improve session error
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 16:14:31 +01:00
Babak K. Shandiz
beba8f6387
fix(agent-task view): display session error
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-18 16:12:11 +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
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
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
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
Kynan Ware
0fb10fca7d Various log rendering improvements
Updated the LogRenderer interface and implementations to accept *iostreams.IOStreams instead of *iostreams.ColorScheme, enabling access to terminal theme and width for improved markdown rendering. Refactored related code, tests, and mocks to support this change, and enhanced log rendering to better handle markdown and code output for various tool calls.
2025-09-15 10:13:55 -06:00
Babak K. Shandiz
1ccbb0af83 feat(agent-task view): add --log and --follow flags
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-15 10:13:55 -06:00
Babak K. Shandiz
1c37ab9453
refactor(agent-task/shared): enhance symbol names
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-11 09:03:36 +01:00
Babak K. Shandiz
6b872923ea
refactor(agent-task view): rename resourceID to prID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 18:57:58 +01:00
Babak K. Shandiz
3798d98969
feat(agent-task view): support PR /agent-sessions/* URL as argument
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 18:57:58 +01:00
Babak K. Shandiz
6a5481368f
docs(agent-task view): improve --help docs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 13:53:45 +01:00
Babak K. Shandiz
88e2d0d7d9
fix(agent-task view): stop progress indicator before opening browser
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:41:49 +01:00
Babak K. Shandiz
b3b8697cf3
test(agent-task view): enhance naming and stubs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:29 +01:00
Babak K. Shandiz
ecbad7ecb9
test(agent-task view): add --web mode tests
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:29 +01:00
Babak K. Shandiz
57d9f1ff0e
feat(agent-task view): add --web mode
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:29 +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
Kynan Ware
1f107cec4f Fix default value in session selection prompt
Updated the call to Prompter.Select to use an empty string as the default value instead of options[0], ensuring no session is preselected by default.
2025-09-09 16:15:10 -06:00
Babak K. Shandiz
ec8f412cca
docs(agent-task view): explain test case rationale
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 12:24:09 +01:00
Babak K. Shandiz
f8ff42a3f1
docs(agent-task view): explain when condition is met
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 12:22:21 +01:00
Babak K. Shandiz
6e78b8d68f
test(agent-task view): update tests
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:51:38 +01:00
Babak K. Shandiz
d06d0262e6
fix(agent-task view): use lower limit for fetching sessions
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:51:14 +01:00
Babak K. Shandiz
c1beeb5d53
fix(agent-task view): use CapiClient.GetPullRequestDatabaseID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:50:47 +01:00
Babak K. Shandiz
8482e3d2a4
feat(agent-task view): support PR arg
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 17:03:59 +01:00
Babak K. Shandiz
d3fa0a70bc
test(agent-task view): add tests for the view command
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:55:15 +01:00
Babak K. Shandiz
92c7a56b82
feat(agent-task view): add view command
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:45:51 +01:00