Ask agents to reply to mid-turn messages before their next tool call

This commit is contained in:
Ian Gulliver
2026-10-23 14:07:01 -07:00
parent dc1769aaeb
commit 89c30c383e
+4 -4
View File
@@ -310,18 +310,18 @@ func (m *Manager) recordQueued(ctx context.Context, l *live, msgs []queued) stri
b.WriteString("\n\n")
}
if q.actor == boardActor {
fmt.Fprintf(b, "While you were working, %s\n\nTake it into account now.", q.text)
fmt.Fprintf(b, "While you were working, %s\n\nReply to it now, before your next tool call, then continue or change course as it says.", q.text)
continue
}
if isLeadActor(q.actor) {
fmt.Fprintf(b, "%s (not %s) sent you this message while you were working; take it into account now:\n\n%s", actorName(q.actor), leadOwner(q.actor), q.text)
fmt.Fprintf(b, "%s (not %s) interrupted you with this message. Reply to it now, before your next tool call, then continue or change course as it says:\n\n%s", actorName(q.actor), leadOwner(q.actor), q.text)
continue
}
if q.client != "" {
fmt.Fprintf(b, "%s sent you this message from %s while you were working; take it into account now:\n\n%s", q.actor, m.clientName(q.client), q.text)
fmt.Fprintf(b, "%s interrupted you from %s with this message. Reply to it now, before your next tool call, then continue or change course as it says:\n\n%s", q.actor, m.clientName(q.client), q.text)
continue
}
fmt.Fprintf(b, "%s sent you this message while you were working; take it into account now:\n\n%s", q.actor, q.text)
fmt.Fprintf(b, "%s interrupted you with this message. Reply to it now, before your next tool call, then continue or change course as it says:\n\n%s", q.actor, q.text)
}
slog.Info("queued messages sent mid-turn", "session", l.id, "count", len(msgs))
return b.String()