Show a task running while its agent answers a finished subagent
This commit is contained in:
@@ -1217,7 +1217,23 @@ func (m *Manager) trackSubagents(ctx context.Context, l *live, raw map[string]an
|
||||
if len(l.subagents) == n {
|
||||
return nil
|
||||
}
|
||||
return m.store.SetSubagents(ctx, l.id, len(l.subagents), agentActor)
|
||||
err := m.store.SetSubagents(ctx, l.id, len(l.subagents), agentActor)
|
||||
if err != nil || len(l.subagents) > n {
|
||||
return err
|
||||
}
|
||||
return m.notifiedTurn(ctx, l)
|
||||
}
|
||||
|
||||
func (m *Manager) notifiedTurn(ctx context.Context, l *live) error {
|
||||
err := m.store.TransitionSession(ctx, l.id, api.AgentSessionStateIdle, api.AgentSessionStateRunning, agentActor)
|
||||
if errors.Is(err, store.ErrStateChanged) {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
m.beginTurn(l, false)
|
||||
return nil
|
||||
}
|
||||
|
||||
type endResult struct {
|
||||
|
||||
Reference in New Issue
Block a user