Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdbc6c98

Browse files
authored
fix(coderd): filter out non-task workspaces in api.tasksList (#19559)
Quick fix for following issue in CLI:```$ go run ./cmd/coder exp task listEncountered an error running "coder exp task list", see "coder exp task list --help" for more informationerror: Trace=[list tasks: ]Internal error fetching task prompts and states.workspace 14d548f4-aaad-40dd-833b-6ffe9c9d31bc is not an AI task workspaceexit status 1```This occurs in a short time window directly after creating a new task.I took a stab at writing a test for this, but ran out of time. I'm notentirely sure what causes non-AI-task workspaces to be returned in thequery but I suspect it's when a workspace build is pending or running.
1 parent5f68807 commitdbc6c98

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

‎coderd/aitasks.go‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111

1212
"github.com/go-chi/chi/v5"
1313
"github.com/google/uuid"
14-
"golang.org/x/xerrors"
1514

1615
"cdr.dev/slog"
1716

@@ -196,13 +195,6 @@ func (api *API) tasksCreate(rw http.ResponseWriter, r *http.Request) {
196195
// prompts and mapping status/state. This method enforces that only AI task
197196
// workspaces are given.
198197
func (api*API)tasksFromWorkspaces(ctx context.Context,apiWorkspaces []codersdk.Workspace) ([]codersdk.Task,error) {
199-
// Enforce that only AI task workspaces are given.
200-
for_,ws:=rangeapiWorkspaces {
201-
ifws.LatestBuild.HasAITask==nil||!*ws.LatestBuild.HasAITask {
202-
returnnil,xerrors.Errorf("workspace %s is not an AI task workspace",ws.ID)
203-
}
204-
}
205-
206198
// Fetch prompts for each workspace build and map by build ID.
207199
buildIDs:=make([]uuid.UUID,0,len(apiWorkspaces))
208200
for_,ws:=rangeapiWorkspaces {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp