Skip to content

Conversation

DanielleMaywood
Copy link
Contributor

Due to how we currently label a workspace as a task, there is a delay between when a task workspace is created and when it is labelled as a task.

This PR introduces fallback check for when a workspace does not have HasAITask set. This fallback check tests to see if the special "AI Prompt" parameter is present in the workspace's build parameters.

@DanielleMaywood DanielleMaywood changed the title fix(coderd): allow fetching a newly created task fix(coderd): ensure a newly created task can be fetched Sep 2, 2025
Due to how we currently label a workspace as a task, there is a delay
between when a task workspace is created and when it is labelled as
a task.

This PR introduces fallback check for when a workspace does _not_ have
`HasAITask` set. This fallback check tests to see if the special "AI
Prompt" parameter is present in the workspace's build parameters.
@DanielleMaywood DanielleMaywood force-pushed the danielle/tasks/fix-tasks-get branch from c8583d8 to caf9000 Compare September 2, 2025 11:28
@@ -253,7 +253,6 @@ func TestTasks(t *testing.T) {
{Name: codersdk.AITaskPromptParameterName, Value: wantPrompt},
}
})
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspace.LatestBuild.ID)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing this call effectively tests that we can fetch a task prior to the build job being finished

@DanielleMaywood DanielleMaywood marked this pull request as ready for review September 2, 2025 11:47
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

:shipit:

@DanielleMaywood DanielleMaywood merged commit 12bce12 into main Sep 2, 2025
52 of 53 checks passed
@DanielleMaywood DanielleMaywood deleted the danielle/tasks/fix-tasks-get branch September 2, 2025 12:25
@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2025
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

post-merge 🦭 of 👍

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.

3 participants