defer s.mutex.Unlock()
var err error
+
for name, subagent := range s.open {
err = errors.Join(err, subagent.close())
+
delete(s.open, name)
}
return a.syncer.Flush(ctx)
}
+// First returns the first message of the log.
+func (a *Subagent) First() (Message, error) {
+ a.mutex.Lock()
+ defer a.mutex.Unlock()
+
+ return a.log.Message(0)
+}
+
// Show returns the whole log, each message as "i|kind: text", with a blank line
// between messages.
func (a *Subagent) Show() (string, error) {