X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/59948b44c0fe2165b90e3aa0d18646f6c3d74af3..c781f79f3c8cb9a7577ee1574d196988da2719b3:/subagent_run.go diff --git a/subagent_run.go b/subagent_run.go index faa6207..3df12ce 100644 --- a/subagent_run.go +++ b/subagent_run.go @@ -78,6 +78,25 @@ type SubagentRuns struct { workers sync.WaitGroup } +// SubagentRun is one run of a subagent: the view that its requests get, its +// effort, the end of its context, the messages of Tell that wait for a request, +// whether Stop ended it, and the time it started. The mutex of SubagentRuns +// protects the messages and the stop. +type SubagentRun struct { + subagent *Subagent + view []string + effort string + cancel context.CancelFunc + pending []Message + stopped bool + started time.Time +} + +// SubagentWorkFile is the content of work.json. +type SubagentWorkFile struct { + Running []string `json:"running"` +} + // Spawn starts one subagent for each task and returns their names at once. It // waits until the view has no pending summary, and gives the view to each // subagent. A nil effort is the effort of the agent. @@ -551,25 +570,6 @@ func (r *SubagentRuns) take(run *SubagentRun) []Message { return messages } -// SubagentRun is one run of a subagent: the view that its requests get, its -// effort, the end of its context, the messages of Tell that wait for a request, -// whether Stop ended it, and the time it started. The mutex of SubagentRuns -// protects the messages and the stop. -type SubagentRun struct { - subagent *Subagent - view []string - effort string - cancel context.CancelFunc - pending []Message - stopped bool - started time.Time -} - -// SubagentWorkFile is the content of work.json. -type SubagentWorkFile struct { - Running []string `json:"running"` -} - // subagentReport returns the report of the subagent name with its replies: the // name in brackets, a new line, the replies, and the zoom that gives its whole // chat.