Save a default model per user, set from Settings
This commit is contained in:
@@ -474,6 +474,8 @@ DELETE FROM inbox_responses WHERE item_id IN (SELECT id FROM inbox_items WHERE k
|
||||
DELETE FROM inbox_items WHERE kind = 'client_run';
|
||||
ALTER TABLE inbox_responses DROP COLUMN client;
|
||||
ALTER TABLE inbox_responses DROP COLUMN exit_code;
|
||||
`}, {"add-user-default-model", `
|
||||
ALTER TABLE users ADD COLUMN default_model TEXT NOT NULL DEFAULT 'claude-opus-5-5';
|
||||
`}}
|
||||
|
||||
const (
|
||||
@@ -674,8 +676,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 FROM users WHERE login = ?`, login).
|
||||
Scan(&u.Login, &u.DisplayName, &u.GitName, &u.GitEmail, &prefs)
|
||||
err := s.db.QueryRowContext(ctx, `SELECT login, display_name, git_name, git_email, notification_prefs, default_model FROM users WHERE login = ?`, login).
|
||||
Scan(&u.Login, &u.DisplayName, &u.GitName, &u.GitEmail, &prefs, &u.DefaultModel)
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return u, ErrNotFound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user