Add Away mode and an agent fork tool
This commit is contained in:
@@ -218,8 +218,8 @@ func (s *Store) EnsureUser(ctx context.Context, login, displayName string) (api.
|
||||
func (s *Store) GetUser(ctx context.Context, login string) (api.User, error) {
|
||||
u := api.User{}
|
||||
prefs := ""
|
||||
err := s.db.QueryRowContext(ctx, `SELECT login, display_name, git_name, git_email, notification_prefs, default_model, review_model, second_review_model FROM users WHERE login = ?`, login).
|
||||
Scan(&u.Login, &u.DisplayName, &u.GitName, &u.GitEmail, &prefs, &u.DefaultModel, &u.ReviewModel, &u.SecondReviewModel)
|
||||
err := s.db.QueryRowContext(ctx, `SELECT login, display_name, git_name, git_email, notification_prefs, default_model, review_model, second_review_model, away FROM users WHERE login = ?`, login).
|
||||
Scan(&u.Login, &u.DisplayName, &u.GitName, &u.GitEmail, &prefs, &u.DefaultModel, &u.ReviewModel, &u.SecondReviewModel, &u.Away)
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return u, ErrNotFound
|
||||
}
|
||||
@@ -751,9 +751,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') != ?)
|
||||
AND ((e.kind = 'snapshot.created' AND json_extract(e.payload, '$.trigger') NOT IN (?, ?))
|
||||
OR (e.kind = 'user.message' AND e.actor NOT IN ('byre', ?) AND e.actor NOT LIKE '% (lead)'))
|
||||
)`, id, string(api.SnapshotTriggerAnswer), agentActor).Scan(&due)
|
||||
)`, id, string(api.SnapshotTriggerAnswer), string(api.SnapshotTriggerFork), agentActor).Scan(&due)
|
||||
return due, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user