@@ -28,15 +28,28 @@ type AgentTask struct {
2828 Name * string `json:"name,omitempty"`
2929 Creator * User `json:"creator,omitempty"`
3030 CreatorType * string `json:"creator_type,omitempty"`
31- Owner * User `json:"owner,omitempty"`
32- Repository * Repository `json:"repository,omitempty"`
31+ Owner * AgentTaskOwner `json:"owner,omitempty"`
32+ Repository * AgentTaskRepository `json:"repository,omitempty"`
3333 State string `json:"state"`
3434 SessionCount * int `json:"session_count,omitempty"`
3535 Artifacts []* AgentTaskArtifact `json:"artifacts,omitempty"`
3636 ArchivedAt * Timestamp `json:"archived_at,omitempty"`
3737 CreatedAt Timestamp `json:"created_at"`
3838 UpdatedAt * Timestamp `json:"updated_at,omitempty"`
3939 Sessions []* AgentTaskSession `json:"sessions,omitempty"`
40+
41+ // Deprecated: UserCollaborators is deprecated by GitHub.
42+ UserCollaborators []* User `json:"user_collaborators,omitempty"`
43+ }
44+
45+ // AgentTaskOwner represents an agent task owner.
46+ type AgentTaskOwner struct {
47+ ID * int64 `json:"id,omitempty"`
48+ }
49+
50+ // AgentTaskRepository represents an agent task repository.
51+ type AgentTaskRepository struct {
52+ ID * int64 `json:"id,omitempty"`
4053}
4154
4255// AgentTaskArtifact represents an artifact produced by an agent task.
@@ -48,25 +61,27 @@ type AgentTaskArtifact struct {
4861
4962// AgentTaskSession represents a session associated with an agent task.
5063type AgentTaskSession struct {
51- ID string `json:"id"`
52- Name * string `json:"name,omitempty"`
53- User * User `json:"user,omitempty"`
54- Owner * User `json:"owner,omitempty"`
55- Repository * Repository `json:"repository,omitempty"`
56- TaskID * string `json:"task_id,omitempty"`
57- State string `json:"state"`
58- CreatedAt Timestamp `json:"created_at"`
59- UpdatedAt * Timestamp `json:"updated_at,omitempty"`
60- CompletedAt * Timestamp `json:"completed_at,omitempty"`
61- Prompt * string `json:"prompt,omitempty"`
62- HeadRef * string `json:"head_ref,omitempty"`
63- BaseRef * string `json:"base_ref,omitempty"`
64- Model * string `json:"model,omitempty"`
64+ ID string `json:"id"`
65+ Name * string `json:"name,omitempty"`
66+ User * User `json:"user,omitempty"`
67+ Owner * AgentTaskOwner `json:"owner,omitempty"`
68+ Repository * AgentTaskRepository `json:"repository,omitempty"`
69+ TaskID * string `json:"task_id,omitempty"`
70+ State string `json:"state"`
71+ CreatedAt Timestamp `json:"created_at"`
72+ UpdatedAt * Timestamp `json:"updated_at,omitempty"`
73+ CompletedAt * Timestamp `json:"completed_at,omitempty"`
74+ Prompt * string `json:"prompt,omitempty"`
75+ HeadRef * string `json:"head_ref,omitempty"`
76+ BaseRef * string `json:"base_ref,omitempty"`
77+ Model * string `json:"model,omitempty"`
6578}
6679
6780// AgentTaskList represents a list of agent tasks.
6881type AgentTaskList struct {
69- Tasks []* AgentTask `json:"tasks"`
82+ Tasks []* AgentTask `json:"tasks"`
83+ TotalActiveCount * int `json:"total_active_count,omitempty"`
84+ TotalArchivedCount * int `json:"total_archived_count,omitempty"`
7085}
7186
7287// AgentTaskListOptions specifies optional parameters to AgentTasksService.List.
@@ -84,7 +99,7 @@ type AgentTaskListOptions struct {
8499 IsArchived bool `url:"is_archived,omitempty"`
85100
86101 // Since filters tasks updated at or after this time.
87- Since time.Time `url:"since,omitempty"`
102+ Since * time.Time `url:"since,omitempty"`
88103
89104 ListOptions
90105}
@@ -97,7 +112,7 @@ type AgentTaskListByRepoOptions struct {
97112 CreatorID int64 `url:"creator_id,omitempty"`
98113}
99114
100- // CreateAgentTaskOptions represents the parameters for creating an agent task.
115+ // CreateAgentTaskRequest represents the parameters for creating an agent task.
101116type CreateAgentTaskRequest struct {
102117 // Prompt is the user's prompt for the agent.
103118 Prompt string `json:"prompt"`
@@ -114,6 +129,8 @@ type CreateAgentTaskRequest struct {
114129
115130// ListByRepo lists tasks for a repository.
116131//
132+ // This endpoint is in public preview and is subject to change.
133+ //
117134// GitHub API docs: https://docs.github.com/rest/agent-tasks/agent-tasks?apiVersion=2026-03-10#list-tasks-for-repository
118135//
119136//meta:operation GET /agents/repos/{owner}/{repo}/tasks
@@ -140,10 +157,12 @@ func (s *AgentTasksService) ListByRepo(ctx context.Context, owner, repo string,
140157
141158// Create starts a new Copilot cloud agent task for a repository.
142159//
160+ // This endpoint is in public preview and is subject to change.
161+ //
143162// GitHub API docs: https://docs.github.com/rest/agent-tasks/agent-tasks?apiVersion=2026-03-10#start-a-task
144163//
145164//meta:operation POST /agents/repos/{owner}/{repo}/tasks
146- func (s * AgentTasksService ) Create (ctx context.Context , owner , repo string , req CreateAgentTaskRequest ) (* AgentTask , * Response , error ) {
165+ func (s * AgentTasksService ) Create (ctx context.Context , owner , repo string , opts * CreateAgentTaskRequest ) (* AgentTask , * Response , error ) {
147166 u := fmt .Sprintf ("agents/repos/%v/%v/tasks" , owner , repo )
148167
149168 req , err := s .client .NewRequest (ctx , "POST" , u , opts , WithVersion (agentTasksAPIVersion ))
@@ -162,10 +181,12 @@ func (s *AgentTasksService) Create(ctx context.Context, owner, repo string, req
162181
163182// GetByRepoAndID gets a repository task by ID.
164183//
184+ // This endpoint is in public preview and is subject to change.
185+ //
165186// GitHub API docs: https://docs.github.com/rest/agent-tasks/agent-tasks?apiVersion=2026-03-10#get-a-task-by-repo
166187//
167188//meta:operation GET /agents/repos/{owner}/{repo}/tasks/{task_id}
168- func (s * AgentTasksService ) GetByRepo (ctx context.Context , owner , repo , taskID string ) (* AgentTask , * Response , error ) {
189+ func (s * AgentTasksService ) GetByRepoAndID (ctx context.Context , owner , repo , taskID string ) (* AgentTask , * Response , error ) {
169190 u := fmt .Sprintf ("agents/repos/%v/%v/tasks/%v" , owner , repo , taskID )
170191
171192 req , err := s .client .NewRequest (ctx , "GET" , u , nil , WithVersion (agentTasksAPIVersion ))
@@ -184,6 +205,8 @@ func (s *AgentTasksService) GetByRepo(ctx context.Context, owner, repo, taskID s
184205
185206// List lists tasks for the authenticated user.
186207//
208+ // This endpoint is in public preview and is subject to change.
209+ //
187210// GitHub API docs: https://docs.github.com/rest/agent-tasks/agent-tasks?apiVersion=2026-03-10#list-tasks
188211//
189212//meta:operation GET /agents/tasks
@@ -210,6 +233,8 @@ func (s *AgentTasksService) List(ctx context.Context, opts *AgentTaskListOptions
210233
211234// Get gets a task by ID for the authenticated user.
212235//
236+ // This endpoint is in public preview and is subject to change.
237+ //
213238// GitHub API docs: https://docs.github.com/rest/agent-tasks/agent-tasks?apiVersion=2026-03-10#get-a-task-by-id
214239//
215240//meta:operation GET /agents/tasks/{task_id}
0 commit comments