fix(coderd/x/chatd/chattool): clarify complete goal ID schema

This commit is contained in:
Michael Suchacz
2026-05-31 21:51:52 +00:00
parent 1e5f6feeba
commit fb6a8c70d8
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -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 == "" {
+2 -1
View File
@@ -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",