Add task summaries, closed-task search and a summary turn before discard

This commit is contained in:
Ian Gulliver
2026-10-16 10:08:08 -07:00
parent 2107a43ef2
commit fd63a0dfbc
25 changed files with 1013 additions and 268 deletions
+17 -4
View File
@@ -64,6 +64,18 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
return m.transcriptText(ctx, args.TaskID, args.AfterSeq, args.Limit)
}),
tool("search_closed_tasks",
searchClosedDescription+" Give project_id for one project's tasks; without it, every project's. read_transcript reads a closed task's transcript.",
`{"type": "object", "properties": {"project_id": {"type": "string"},`+searchClosedProperties+`}}`,
func(ctx context.Context, user api.User, raw json.RawMessage) (string, error) {
args := searchClosedArgs{}
err := json.Unmarshal(raw, &args)
if err != nil {
return "", err
}
return m.searchClosedText(ctx, args.ProjectID, args.Query, args.Limit)
}),
tool("read_inbox",
"Read open inbox items as JSON, with each question's full context, choices and responses. Give task_id for one task's items.",
`{"type": "object", "properties": {"task_id": {"type": "string"}}}`,
@@ -308,18 +320,19 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
}),
tool("discard_task",
"Discard a task: stop its agent and delete its worktree and branch without merging. This destroys its unmerged work. Only when the human asks.",
"Discard a task: its agent gets one turn to write the task summary, then byre stops it and deletes its worktree and branch without merging. This destroys its unmerged work. Only when the human asks. "+
"If the agent is mid-turn, the summary turn starts when that turn ends; no other turn runs in between.",
taskOnly,
func(ctx context.Context, user api.User, raw json.RawMessage) (string, error) {
task, project, err := m.taskArg(ctx, raw)
task, _, err := m.taskArg(ctx, raw)
if err != nil {
return "", err
}
_, err = m.Discard(ctx, task, project, user.Login)
_, err = m.Discard(ctx, task, user.Login)
if err != nil {
return "", err
}
return fmt.Sprintf("Discarded %s.", task.Id), nil
return fmt.Sprintf("Discarding %s: its agent gets a turn to write the task summary, and byre discards the task when that turn ends.", task.Id), nil
}),
tool("show",