Skip to content

gh agent-task view: accept /agent-sessions/* URL as argument#11707

Merged
babakks merged 8 commits intogithub-cli-epic-990from
babakks/accept-agent-sessions-url-in-view-cmd
Sep 11, 2025
Merged

gh agent-task view: accept /agent-sessions/* URL as argument#11707
babakks merged 8 commits intogithub-cli-epic-990from
babakks/accept-agent-sessions-url-in-view-cmd

Conversation

@babakks
Copy link
Copy Markdown
Member

@babakks babakks commented Sep 10, 2025

This PR adds support for PR agent-session URLs, in the form of:

https://github.com/OWNER/REPO/pull/NUMBER/agent-sessions/SESSION-ID

A/C verification

When I run gh agent-task view https://github.com/OWNER/REPO/pull/NUMBER/agent-sessions/SESSION-ID
Then I see the details of the session identified by SESSION-ID

Confirmed:

gh-agent-task-view-pr-agent-session-url

Copilot AI review requested due to automatic review settings September 10, 2025 17:50
@babakks babakks requested a review from a team as a code owner September 10, 2025 17:50
@babakks babakks requested a review from BagToad September 10, 2025 17:50
@babakks babakks changed the base branch from trunk to github-cli-epic-990 September 10, 2025 17:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for accepting PR agent-session URLs in the gh agent-task view command, allowing users to pass URLs like https://github.com/OWNER/REPO/pull/NUMBER/agent-sessions/SESSION-ID as arguments to directly view specific agent sessions.

  • Extends the existing URL parsing functionality in PR commands to handle additional path segments after the pull request number
  • Adds new agent-task functionality including create, list, and view commands for GitHub Copilot agent tasks
  • Implements URL parsing for PR agent-session URLs to extract session IDs

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/cmd/root/root.go Adds agent-task command registration to the CLI root
pkg/cmd/pr/shared/finder.go Extends ParseURL to return additional path segments and adds ParseFullReference function
pkg/cmd/pr/shared/finder_test.go Adds comprehensive tests for URL parsing with additional path segments
pkg/cmd/pr/edit/edit.go Updates ParseURL call to handle new return signature
Multiple agent-task files Implements complete agent-task command suite with create, list, and view functionality
api/queries_*.go Adds Repository field to PullRequest and DatabaseID to GitHubUser structs
go.mod Adds msgpack dependency for GraphQL node ID encoding

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
@babakks babakks force-pushed the babakks/accept-agent-sessions-url-in-view-cmd branch from 5cc2432 to 6b87292 Compare September 10, 2025 17:58
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Copy link
Copy Markdown
Member

@BagToad BagToad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Left some comments but it's really mostly about naming stuff so take it or leave it 👍 🍻

Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
@babakks babakks merged commit bfa0975 into github-cli-epic-990 Sep 11, 2025
7 of 8 checks passed
@babakks babakks deleted the babakks/accept-agent-sessions-url-in-view-cmd branch September 11, 2025 08:16
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.

3 participants