Lead messages mid-turn
This commit is contained in:
@@ -139,8 +139,9 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
}),
|
||||
|
||||
tool("send_message",
|
||||
"Send a message to a task's agent; it starts a turn. Starts the agent when the task has none. The agent must be idle: "+
|
||||
"if it is mid-turn, wait for it to finish the turn or interrupt it first.",
|
||||
"Send a message to a task's agent; it starts a turn. Starts the agent when the task has none. "+
|
||||
"If the agent is mid-turn, the message is queued like the human's: the agent reads it with its next tool call's result, "+
|
||||
"or as its next turn if it makes no further tool call, and gets it only once.",
|
||||
`{"type": "object", "properties": {
|
||||
"task_id": {"type": "string"},
|
||||
"text": {"type": "string"},
|
||||
@@ -174,10 +175,13 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
|
||||
}
|
||||
return fmt.Sprintf("Started an agent on %s with your message.", task.Id), nil
|
||||
}
|
||||
_, err = m.Send(ctx, sess.Id, leadActor(user.Login), args.Text, args.Model)
|
||||
_, queued, err := m.Message(ctx, sess.Id, leadActor(user.Login), args.Text, args.Model)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if queued {
|
||||
return fmt.Sprintf("Queued for %s's agent, which is mid-turn: it reads the message with its next tool call's result, or as its next turn.", task.Id), nil
|
||||
}
|
||||
return fmt.Sprintf("Sent to %s's agent.", task.Id), nil
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user