Skip to content

Preserve project execution defaults per provider - #4085

Open
vznh wants to merge 3 commits into
get-bb:mainfrom
vznh:fix/provider-scoped-project-defaults
Open

vznh wants to merge 3 commits into
get-bb:mainfrom
vznh:fix/provider-scoped-project-defaults

Conversation

@vznh

@vznh vznh commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Human comments

The aim is switching providers keeps each provider’s saved settings, and that upgrading preserves existing settings.

Looks like a huge diff - 5,041 lines come from the migration.

What was wrong

Project execution defaults were unique by project alone, so using another provider overwrote the previous provider’s saved settings. Existing-thread model recovery could also receive another provider’s model.

What changed

Store defaults by project and provider, and scope server fallback reads to the selected provider. Unscoped reads still select the last-used provider. Migration 0131 preserves existing settings and supports replay.

Use atomic monotonic timestamps instead of the issue’s proposed rowid tie-breaker so A → B → A remains correct within one millisecond. Project-list queries select only each project’s latest row.

The generated Drizzle snapshot accounts for most of the diff and changes only the defaults table’s unique key. No UI, public API, CLI, or daemon protocol changes.

How you verified

Human and agent verified together.

  • Full database suite: 593 tests passed, including provider retention, same-millisecond recency, migration replay, and data preservation.
  • Server compatibility checks: 72 tests passed across defaults, policy, execution planning, and model recovery.
  • DB and server typechecks passed; formatting and git diff checks passed.
  • Additional SQLite checks passed rollback, restart, and deletion across provider rows.

Fixes #3463

AGENT GENERATED

@vznh vznh closed this Sep 22, 2026
@vznh vznh reopened this Sep 22, 2026
@vznh
vznh marked this pull request as draft September 22, 2026 18:37
@vznh
vznh marked this pull request as ready for review September 22, 2026 18:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project execution defaults are one row per project: using a second provider erases the first provider's remembered model and reasoning

1 participant