fix(coderd): ensure a newly created task can be fetched (#19670)

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.
This commit is contained in:
Danielle Maywood
2025-09-02 13:25:32 +01:00
committed by GitHub
parent 06cbb2890f
commit 12bce12952
2 changed files with 27 additions and 3 deletions
-1
View File
@@ -253,7 +253,6 @@ func TestTasks(t *testing.T) {
{Name: codersdk.AITaskPromptParameterName, Value: wantPrompt},
}
})
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspace.LatestBuild.ID)
// Fetch the task by ID via experimental API and verify fields.
exp := codersdk.NewExperimentalClient(client)