Skip to content

chore: add fields to codersdk.Task - #19619

Merged
DanielleMaywood merged 1 commit into
mainfrom
danielle/tasks/add-fields-to-codersdk-Task
Aug 28, 2025
Merged

DanielleMaywood merged 1 commit into
mainfrom
danielle/tasks/add-fields-to-codersdk-Task

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Aug 28, 2025 •

Copy link
Copy Markdown
Contributor

Closes coder/internal#949

Adds the following fields to codersdk.Task

  • OwnerName
  • TemplateName
  • TemplateDisplayName
  • TemplateIcon
  • WorkspaceAgentID
  • WorkspaceAgentLifecycle
  • WorkspaceAgentHealth

The implementation is unfortunately not compatible with multiple agents as we have no reliable way to tell which agent has the AI task running in it. For now we just pick the first agent found, but in the future this will need to be changed.

@DanielleMaywood
DanielleMaywood force-pushed the danielle/tasks/add-fields-to-codersdk-Task branch 3 times, most recently from fed0eb7 to d06b8ca Compare August 28, 2025 15:34
@DanielleMaywood
DanielleMaywood force-pushed the danielle/tasks/add-fields-to-codersdk-Task branch from d06b8ca to 585a338 Compare August 28, 2025 15:43
@DanielleMaywood
DanielleMaywood marked this pull request as ready for review August 28, 2025 16:02
@DanielleMaywood
DanielleMaywood requested review from BrunoQuaresma, johnstcn and mafredri and removed request for mafredri August 28, 2025 16:03
@DanielleMaywood
DanielleMaywood merged commit 4376586 into main Aug 28, 2025
@DanielleMaywood
DanielleMaywood deleted the danielle/tasks/add-fields-to-codersdk-Task branch August 28, 2025 16:28
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 28, 2025
Comment thread coderd/aitasks.go
var taskAgentLifecycle *codersdk.WorkspaceAgentLifecycle
var taskAgentHealth *codersdk.WorkspaceAgentHealth
for _, resource := range ws.LatestBuild.Resources {
for _, agent := range resource.Agents {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could at least filter out sub-agents. 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll make a follow-up PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks API: Add fields to codersdk.Task (required by the UI)

4 participants