constsummaryRequest="Call set_task_summary with a summary of the whole task, not just this turn, for whoever searches closed tasks later: what it set out to do, what was built or tried, the key decisions and why, and what was deliberately left out."
constdiscardPrompt="This task is being discarded: when this turn ends, byre stops this session and deletes the worktree and branch without merging. Don't change any files. "+
summaryRequest+" Say why it is being dropped, as far as you know. Then end your turn."
constdiscardRestartPrompt="byre restarted while this turn was running. "+discardPrompt
Description:"Set the summary of this whole task that byre keeps after it is merged or discarded, where agents find it with search_closed_tasks. "+
"Cover what the task set out to do, what was built or tried, the key decisions and why, and what was deliberately left out. It replaces any earlier summary.",
InputSchema:json.RawMessage(`{
"type": "object",
"properties": {
"summary": {"type": "string", "description": "Markdown, a few short paragraphs or a bulleted list."}
return"",fmt.Errorf("%w: this task is closed",ErrConflict)
}
iferr!=nil{
return"",err
}
return"Task summary saved.",nil
},
}
}
constsearchClosedDescription="Search tasks that were merged or discarded, newest closed first. A task matches when query appears, ignoring case, in its title, merge commit title, TODO item, summary or merge commit; without query every closed task matches. "+
"Each result has the task's id, outcome, merge commit, close time, titles, TODO item and the summary its agent wrote when it was merged or discarded (tasks closed before byre kept summaries have none). "+
"Use it to check whether something was already done or tried, and why."
constsearchClosedProperties=`
"query": {"type": "string"},
"limit": {"type": "integer", "description": "At most this many tasks, default 20, at most 100."}`
typesearchClosedArgsstruct{
ProjectIDstring`json:"project_id"`
Querystring`json:"query"`
Limitint`json:"limit"`
}
func(m*Manager)searchClosedTool(l*live)mcp.Tool{
returnmcp.Tool{
Name:"search_closed_tasks",
Description:searchClosedDescription+" Searches this task's project.",