Skip to content

Commit e5cee2c

Browse files
committed
restore behavior of reset aitask if unknown app id
1 parent 835049c commit e5cee2c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

coderd/provisionerdserver/provisionerdserver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,6 +2029,7 @@ func (s *server) completeWorkspaceBuildJob(ctx context.Context, job database.Pro
20292029

20302030
if !slices.Contains(appIDs, appID) {
20312031
unknownAppID = appID
2032+
hasAITask = false
20322033
} else {
20332034
// Only parse for valid app and agent to avoid fk violation.
20342035
id, err := uuid.Parse(appID)

coderd/provisionerdserver/provisionerdserver_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2965,8 +2965,8 @@ func TestCompleteJob(t *testing.T) {
29652965
},
29662966
isTask: true,
29672967
expectTaskStatus: database.TaskStatusInitializing,
2968-
expectHasAiTask: true,
2969-
expectUsageEvent: true, // We no longer reset hasAITask if the app doesn't exist.
2968+
expectHasAiTask: false,
2969+
expectUsageEvent: false,
29702970
},
29712971
{
29722972
name: "has_ai_task is set to true, but transition is not start",

0 commit comments

Comments
 (0)