Share snapshot classification across review and readiness queries
This commit is contained in:
@@ -772,9 +772,9 @@ func (s *Store) ReadyPromptDue(ctx context.Context, id string) (bool, error) {
|
||||
err := s.db.QueryRowContext(ctx, `SELECT EXISTS (
|
||||
SELECT 1 FROM events e, tasks t
|
||||
WHERE t.id = ? AND e.task_id = t.id AND e.seq > t.ready_prompt_seq
|
||||
AND ((e.kind = 'snapshot.created' AND json_extract(e.payload, '$.trigger') NOT IN (?, ?, ?))
|
||||
AND ((e.kind = 'snapshot.created' AND json_extract(e.payload, '$.trigger') NOT IN `+cutPointTriggers+`)
|
||||
OR (e.kind = 'user.message' AND e.actor != ? AND e.actor NOT LIKE '% (lead)' AND json_extract(e.payload, '$.bounce') IS NOT 1))
|
||||
)`, id, string(api.SnapshotTriggerAnswer), string(api.SnapshotTriggerFork), string(api.SnapshotTriggerAskHuman), agentActor).Scan(&due)
|
||||
)`, id, agentActor).Scan(&due)
|
||||
return due, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user