From fb6a8c70d8b0b2c767bc184c248b3a0e0e120a08 Mon Sep 17 00:00:00 2001 From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com> Date: Sun, 31 May 2026 21:51:52 +0000 Subject: [PATCH] fix(coderd/x/chatd/chattool): clarify complete goal ID schema --- coderd/x/chatd/chattool/goal.go | 4 ++-- coderd/x/chatd/chattool/goal_test.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/coderd/x/chatd/chattool/goal.go b/coderd/x/chatd/chattool/goal.go index ba78cb2a6e..60d58903ff 100644 --- a/coderd/x/chatd/chattool/goal.go +++ b/coderd/x/chatd/chattool/goal.go @@ -32,7 +32,7 @@ type GoalToolOptions struct { type getGoalArgs struct{} type completeGoalArgs struct { - GoalID string `json:"goal_id" description:"The expected current goal ID. The tool fails if the current goal changed."` + GoalID string `json:"goal_id" description:"The expected current goal ID as a UUIDv4 string. The tool fails if the current goal changed."` Summary string `json:"summary" description:"A concise non-empty summary of how the goal was completed."` } @@ -80,7 +80,7 @@ func CompleteGoal(db database.Store, options GoalToolOptions) fantasy.AgentTool } goalID, err := uuid.Parse(goalIDStr) if err != nil { - return fantasy.NewTextErrorResponse("invalid goal_id"), nil + return fantasy.NewTextErrorResponse("goal_id is required"), nil } summary := strings.TrimSpace(args.Summary) if summary == "" { diff --git a/coderd/x/chatd/chattool/goal_test.go b/coderd/x/chatd/chattool/goal_test.go index df858f9268..8734e5028e 100644 --- a/coderd/x/chatd/chattool/goal_test.go +++ b/coderd/x/chatd/chattool/goal_test.go @@ -89,6 +89,7 @@ func TestCompleteGoalSchemaUsesStringGoalID(t *testing.T) { goalIDParam, ok := info.Parameters["goal_id"].(map[string]any) require.True(t, ok) require.Equal(t, "string", goalIDParam["type"]) + require.Contains(t, goalIDParam["description"], "UUIDv4 string") } func TestGetGoalReturnsNullWithoutCurrentGoal(t *testing.T) { @@ -152,7 +153,7 @@ func TestCompleteGoalValidatesInput(t *testing.T) { { name: "invalid goal id", input: `{"goal_id":"not-a-uuid","summary":"done"}`, - message: "invalid goal_id", + message: "goal_id is required", }, { name: "empty summary",