// work.json in the directory of the agent holds the names of the running
// subagents. Each start and each end of a run writes it whole, but Close does
// not, so after a stop of the daemon it names the runs that the stop cut, and
-// Resume goes on with them. The logs alone cannot tell this, because a stop
-// can cut a run just after its final reply.
+// Resume goes on with them. The logs alone cannot tell this, because a stop can
+// cut a run just after its final reply.
//
// Spawn and Tell split the view with the layout of the agent, which has no
// lock. They are tools, so they run in the goroutine of the turns, as each
return file.Running, nil
}
-// save writes the names of the running subagents to work.json. The caller
-// holds the mutex.
+// save writes the names of the running subagents to work.json. The caller holds
+// the mutex.
func (r *SubagentRuns) save() error {
file := SubagentWorkFile{
Running: append([]string{}, slices.Sorted(maps.Keys(r.running))...),
return chain.Run(ctx, input)
}
-// take returns the messages of Tell that wait for a request of run, and
-// removes them.
+// take returns the messages of Tell that wait for a request of run, and removes
+// them.
func (r *SubagentRuns) take(run *SubagentRun) []Message {
r.mutex.Lock()
defer r.mutex.Unlock()