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

Commit634fe1c

Browse files
committed
feat: add idle AI agent status
"Idle" is more accurate than "complete" since:1. AgentAPI only knows if the screen is active; it has no way of knowing if the task is complete.2. The LLM might be done with its current prompt, but that does not mean the task is complete either (it likely needs refinement).The "complete" state will be reserved for future definition.
1 parent82c14e0 commit634fe1c

File tree

18 files changed

+66
-12
lines changed

18 files changed

+66
-12
lines changed

‎cli/exp_mcp.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,10 @@ func (s *mcpServer) startWatcher(ctx context.Context, inv *serpent.Invocation) {
585585
caseevent:=<-eventsCh:
586586
switchev:=event.(type) {
587587
case agentapi.EventStatusChange:
588-
// If the screen is stable,assume complete.
588+
// If the screen is stable,report idle.
589589
state:=codersdk.WorkspaceAppStatusStateWorking
590590
ifev.Status==agentapi.StatusStable {
591-
state=codersdk.WorkspaceAppStatusStateComplete
591+
state=codersdk.WorkspaceAppStatusStateIdle
592592
}
593593
err:=s.queue.Push(taskReport{
594594
state:state,

‎cli/exp_mcp_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ func TestExpMcpReporter(t *testing.T) {
900900
{
901901
event:makeStatusEvent(agentapi.StatusStable),
902902
expected:&codersdk.WorkspaceAppStatus{
903-
State:codersdk.WorkspaceAppStatusStateComplete,
903+
State:codersdk.WorkspaceAppStatusStateIdle,
904904
Message:"doing work",
905905
URI:"https://dev.coder.com",
906906
},
@@ -948,7 +948,7 @@ func TestExpMcpReporter(t *testing.T) {
948948
{
949949
event:makeStatusEvent(agentapi.StatusStable),
950950
expected:&codersdk.WorkspaceAppStatus{
951-
State:codersdk.WorkspaceAppStatusStateComplete,
951+
State:codersdk.WorkspaceAppStatusStateIdle,
952952
Message:"oops",
953953
URI:"",
954954
},

‎coderd/apidoc/docs.go‎

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

‎coderd/apidoc/swagger.json‎

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/dump.sql‎

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-- It is not possible to delete enum values.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTERTYPE workspace_app_status_state ADD VALUE IF NOT EXISTS'idle';

‎coderd/database/models.go‎

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/workspaceagents.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,10 @@ func (api *API) patchWorkspaceAgentAppStatus(rw http.ResponseWriter, r *http.Req
359359
}
360360

361361
switchreq.State {
362-
casecodersdk.WorkspaceAppStatusStateComplete,codersdk.WorkspaceAppStatusStateFailure,codersdk.WorkspaceAppStatusStateWorking:// valid states
362+
casecodersdk.WorkspaceAppStatusStateComplete,
363+
codersdk.WorkspaceAppStatusStateFailure,
364+
codersdk.WorkspaceAppStatusStateWorking,
365+
codersdk.WorkspaceAppStatusStateIdle:// valid states
363366
default:
364367
httpapi.Write(ctx,rw,http.StatusBadRequest, codersdk.Response{
365368
Message:"Invalid state provided.",

‎codersdk/toolsdk/toolsdk.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Bad Tasks
191191
Use the "state" field to indicate your progress. Periodically report
192192
progress with state "working" to keep the user updated. It is not possible to send too many updates!
193193
194-
ONLY reporta "complete" or "failure" state if you have FULLY completed the task.
194+
ONLY reportan "idle" or "failure" state if you have FULLY completed the task.
195195
`,
196196
Schema: aisdk.Schema{
197197
Properties:map[string]any{
@@ -205,10 +205,10 @@ ONLY report a "complete" or "failure" state if you have FULLY completed the task
205205
},
206206
"state":map[string]any{
207207
"type":"string",
208-
"description":"The state of your task. This can be one of the following: working,complete, or failure. Select the state that best represents your current progress.",
208+
"description":"The state of your task. This can be one of the following: working,idle, or failure. Select the state that best represents your current progress.",
209209
"enum": []string{
210210
string(codersdk.WorkspaceAppStatusStateWorking),
211-
string(codersdk.WorkspaceAppStatusStateComplete),
211+
string(codersdk.WorkspaceAppStatusStateIdle),
212212
string(codersdk.WorkspaceAppStatusStateFailure),
213213
},
214214
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp