Run discards on the state-driven coordinator

This commit is contained in:
Ian Gulliver
2026-10-21 11:53:37 -07:00
parent f3a0e28763
commit 1b5f42a01a
8 changed files with 141 additions and 191 deletions
+1 -6
View File
@@ -110,12 +110,7 @@ func (m *Manager) handoff(ctx context.Context, sessionID, handoff string) error
next.State = api.AgentSessionStateRunning
err = m.store.ReplaceSession(ctx, sess.Id, next, task.ProjectId, "byre")
if errors.Is(err, store.ErrStateChanged) {
err = transition(ctx, m.store, sess.Id, api.AgentSessionStateRunning, api.AgentSessionStateIdle, "byre")
if err != nil {
return err
}
m.startDiscard(task.Id)
return nil
return transition(ctx, m.store, sess.Id, api.AgentSessionStateRunning, api.AgentSessionStateIdle, "byre")
}
if err != nil {
return err