Always notify the lead when a task completes
This commit is contained in:
@@ -408,7 +408,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
"Merge a task as the human: its agent merges the default branch in, then byre squashes it into one commit, pushes it to origin and closes the task. "+
|
||||
"While another task in the project is merging, byre holds the merge and starts it when that one is done. "+
|
||||
"For a subtask, target parent instead asks its parent task's agent to merge it into the parent's branch, and the subtask closes once the parent has. "+
|
||||
"Refused for a task with active subtasks. Only when the human asks. Its merged signal arrives only alongside another signal unless you call wake_on for the task; failures show as errors in the task's transcript, and you get a signal for each."+stoppedRefusal,
|
||||
"Refused for a task with active subtasks. Only when the human asks. Its merged signal wakes you; failures show as errors in the task's transcript, and you get a signal for each."+stoppedRefusal,
|
||||
`{"type": "object", "properties": {
|
||||
"task_id": {"type": "string"},
|
||||
"target": {"type": "string", "enum": ["main", "parent"], "description": "Default main."}
|
||||
@@ -489,29 +489,6 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
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("wake_on",
|
||||
"Make an active task's next merged or discarded signal wake you, once, whoever merged or discarded it. "+
|
||||
"Without it, a merge or discard by the human only arrives alongside another signal. Use it when something waits on that task closing, "+
|
||||
"for example \"after that merge, deploy\".",
|
||||
taskOnly,
|
||||
func(ctx context.Context, user api.User, raw json.RawMessage) (string, error) {
|
||||
task, _, err := m.taskArg(ctx, raw)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if task.Background {
|
||||
return "", fmt.Errorf("%w: %s is a background task, whose signals never reach you", ErrInvalid, task.Id)
|
||||
}
|
||||
err = m.store.AddLeadWake(ctx, user.Login, task.Id)
|
||||
if errors.Is(err, store.ErrNotFound) {
|
||||
return "", fmt.Errorf("%w: %s has already been merged or discarded", ErrInvalid, task.Id)
|
||||
}
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return fmt.Sprintf("You'll be woken when %s is merged or discarded.", task.Id), nil
|
||||
}),
|
||||
|
||||
tool("show",
|
||||
"Point the human's right pane at a task, which shows its transcript (a workflow stage task's run: its graph and each stage's state, attempts and outputs), or at a project with no task, which shows the project's dashboard: its active tasks and its TODO.md items. "+
|
||||
"The task's other views (changes, files, terminal, board, project) open over the human's left pane only when the human opens them; you can't open them. "+
|
||||
|
||||
Reference in New Issue
Block a user