Advance workflow stages from the state-driven coordinator
This commit is contained in:
@@ -260,8 +260,14 @@ func (s *Store) StageOutput(ctx context.Context, sessionID string) (string, erro
|
||||
return output, err
|
||||
}
|
||||
|
||||
func (s *Store) FinishedStages(ctx context.Context) ([]string, error) {
|
||||
return queryIDs(ctx, s.db, `SELECT id FROM agent_sessions WHERE stage_finished = 1 ORDER BY created_at`)
|
||||
func (s *Store) StageFinished(ctx context.Context, sessionID string) (bool, error) {
|
||||
finished := false
|
||||
err := s.db.QueryRowContext(ctx, `SELECT stage_finished FROM agent_sessions WHERE id = ?`, sessionID).Scan(&finished)
|
||||
return finished, err
|
||||
}
|
||||
|
||||
func finishedStages(ctx context.Context, tx *sql.Tx) ([]string, error) {
|
||||
return queryIDs(ctx, tx, `SELECT id FROM agent_sessions WHERE stage_finished = 1 AND state != 'running' ORDER BY created_at`)
|
||||
}
|
||||
|
||||
func (s *Store) ClearStage(ctx context.Context, sessionID string) error {
|
||||
|
||||
Reference in New Issue
Block a user