mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: add status watcher to MCP server (#18320)
This is meant to complement the existing task reporter since the LLM does not call it reliably. It also includes refactoring to use the common agent flags/env vars.
This commit is contained in:
@ -72,7 +72,14 @@ func TestTools(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("ReportTask", func(t *testing.T) {
|
||||
tb, err := toolsdk.NewDeps(memberClient, toolsdk.WithAgentClient(agentClient), toolsdk.WithAppStatusSlug("some-agent-app"))
|
||||
tb, err := toolsdk.NewDeps(memberClient, toolsdk.WithTaskReporter(func(args toolsdk.ReportTaskArgs) error {
|
||||
return agentClient.PatchAppStatus(setupCtx, agentsdk.PatchAppStatus{
|
||||
AppSlug: "some-agent-app",
|
||||
Message: args.Summary,
|
||||
URI: args.Link,
|
||||
State: codersdk.WorkspaceAppStatusState(args.State),
|
||||
})
|
||||
}))
|
||||
require.NoError(t, err)
|
||||
_, err = testTool(t, toolsdk.ReportTask, tb, toolsdk.ReportTaskArgs{
|
||||
Summary: "test summary",
|
||||
|
Reference in New Issue
Block a user