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

Commit6f1b36c

Browse files
committed
feat: include latest build id in task responses
1 parentb48e367 commit6f1b36c

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

‎coderd/aitasks.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ func taskFromWorkspace(ws codersdk.Workspace, initialPrompt string) codersdk.Tas
272272
WorkspaceAgentID:taskAgentID,
273273
WorkspaceAgentLifecycle:taskAgentLifecycle,
274274
WorkspaceAgentHealth:taskAgentHealth,
275+
LatestBuildID: uuid.NullUUID{Valid:true,UUID:ws.LatestBuild.ID},
275276
CreatedAt:ws.CreatedAt,
276277
UpdatedAt:ws.UpdatedAt,
277278
InitialPrompt:initialPrompt,

‎coderd/aitasks_test.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ func TestTasks(t *testing.T) {
270270
assert.Equal(t,wantPrompt,got.InitialPrompt,"task prompt should match the AI Prompt parameter")
271271
assert.Equal(t,workspace.Name,got.Name,"task name should map from workspace name")
272272
assert.Equal(t,workspace.ID,got.WorkspaceID.UUID,"workspace id should match")
273+
assert.Equal(t,workspace.LatestBuild.ID,got.LatestBuildID,"latest build id should match")
273274
// Status should be populated via app status or workspace status mapping.
274275
assert.NotEmpty(t,got.Status,"task status should not be empty")
275276
})
@@ -320,6 +321,7 @@ func TestTasks(t *testing.T) {
320321
assert.Equal(t,workspace.Name,task.Name,"task name should map from workspace name")
321322
assert.Equal(t,wantPrompt,task.InitialPrompt,"task prompt should match the AI Prompt parameter")
322323
assert.Equal(t,workspace.ID,task.WorkspaceID.UUID,"workspace id should match")
324+
assert.Equal(t,workspace.LatestBuild.ID,task.LatestBuildID,"latest build id should match")
323325
assert.NotEmpty(t,task.Status,"task status should not be empty")
324326

325327
// Stop the workspace

‎codersdk/aitasks.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ type Task struct {
119119
WorkspaceAgentID uuid.NullUUID`json:"workspace_agent_id" format:"uuid" table:"workspace agent id"`
120120
WorkspaceAgentLifecycle*WorkspaceAgentLifecycle`json:"workspace_agent_lifecycle" table:"workspace agent lifecycle"`
121121
WorkspaceAgentHealth*WorkspaceAgentHealth`json:"workspace_agent_health" table:"workspace agent health"`
122+
LatestBuildID uuid.NullUUID`json:"latest_build_id" format:"uuid" table:"latest build id"`
122123
InitialPromptstring`json:"initial_prompt" table:"initial prompt"`
123124
StatusWorkspaceStatus`json:"status" enums:"pending,starting,running,stopping,stopped,failed,canceling,canceled,deleting,deleted" table:"status"`
124125
CurrentState*TaskStateEntry`json:"current_state" table:"cs,recursive_inline"`

‎site/src/api/typesGenerated.ts‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp