From 1ca1e41844de5903a9c4762dd343efd385456866 Mon Sep 17 00:00:00 2001 From: viettranx Date: Tue, 17 Mar 2026 07:15:18 +0700 Subject: [PATCH] refactor(teams): slim down task list/detail JSON for model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove fields the model doesn't need from tool response DTOs: - owner_agent_id → model uses owner_agent_key - created_by_agent_id → model uses created_by_agent_key - task_number → model uses identifier (e.g. "T-018-5e65") Reduces context token consumption. UI (WS API) unaffected — uses separate TeamTaskData struct with all fields. --- internal/tools/team_tasks_read.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/internal/tools/team_tasks_read.go b/internal/tools/team_tasks_read.go index 2b9d78e0..69ae3e20 100644 --- a/internal/tools/team_tasks_read.go +++ b/internal/tools/team_tasks_read.go @@ -23,15 +23,14 @@ type blockerSummary struct { } // taskListItem is the slim view returned by list/search actions. +// Excludes UUIDs (owner_agent_id, created_by_agent_id) and task_number — model uses +// agent keys and identifier instead. type taskListItem struct { ID uuid.UUID `json:"id"` - TaskNumber int `json:"task_number"` Identifier string `json:"identifier"` Subject string `json:"subject"` Status string `json:"status"` - OwnerAgentID *uuid.UUID `json:"owner_agent_id,omitempty"` OwnerAgentKey string `json:"owner_agent_key,omitempty"` - CreatedByAgentID *uuid.UUID `json:"created_by_agent_id,omitempty"` CreatedByAgentKey string `json:"created_by_agent_key,omitempty"` ProgressPercent int `json:"progress_percent,omitempty"` ProgressStep string `json:"progress_step,omitempty"` @@ -42,15 +41,12 @@ type taskListItem struct { // taskDetailItem is the slim view returned by the get action. type taskDetailItem struct { ID uuid.UUID `json:"id"` - TaskNumber int `json:"task_number"` Identifier string `json:"identifier"` Subject string `json:"subject"` Description string `json:"description,omitempty"` Status string `json:"status"` Result *string `json:"result,omitempty"` - OwnerAgentID *uuid.UUID `json:"owner_agent_id,omitempty"` OwnerAgentKey string `json:"owner_agent_key,omitempty"` - CreatedByAgentID *uuid.UUID `json:"created_by_agent_id,omitempty"` CreatedByAgentKey string `json:"created_by_agent_key,omitempty"` ProgressPercent int `json:"progress_percent,omitempty"` ProgressStep string `json:"progress_step,omitempty"` @@ -107,13 +103,10 @@ func (t *TeamTasksTool) resolveBlockers(ctx context.Context, blockedBy []uuid.UU func (t *TeamTasksTool) toListItem(ctx context.Context, task store.TeamTaskData) taskListItem { return taskListItem{ ID: task.ID, - TaskNumber: task.TaskNumber, Identifier: task.Identifier, Subject: task.Subject, Status: task.Status, - OwnerAgentID: task.OwnerAgentID, OwnerAgentKey: task.OwnerAgentKey, - CreatedByAgentID: task.CreatedByAgentID, CreatedByAgentKey: task.CreatedByAgentKey, ProgressPercent: task.ProgressPercent, ProgressStep: task.ProgressStep, @@ -125,15 +118,12 @@ func (t *TeamTasksTool) toListItem(ctx context.Context, task store.TeamTaskData) func (t *TeamTasksTool) toDetailItem(ctx context.Context, task *store.TeamTaskData) taskDetailItem { return taskDetailItem{ ID: task.ID, - TaskNumber: task.TaskNumber, Identifier: task.Identifier, Subject: task.Subject, Description: task.Description, Status: task.Status, Result: task.Result, - OwnerAgentID: task.OwnerAgentID, OwnerAgentKey: task.OwnerAgentKey, - CreatedByAgentID: task.CreatedByAgentID, CreatedByAgentKey: task.CreatedByAgentKey, ProgressPercent: task.ProgressPercent, ProgressStep: task.ProgressStep,