Skip to content

feat: migrate agents storage to v2 main database#14159

Draft
vaayne wants to merge 3 commits intov2from
feat/agents-main-db-migration
Draft

feat: migrate agents storage to v2 main database#14159
vaayne wants to merge 3 commits intov2from
feat/agents-main-db-migration

Conversation

@vaayne
Copy link
Copy Markdown
Collaborator

@vaayne vaayne commented Apr 10, 2026

What this PR does

Before this PR:

  • The v2 migration imported legacy agents data into the main SQLite database, but the runtime agents services still read and wrote the deprecated standalone agents.db database.
  • Agents-only migration reruns could clear and rerun more state than necessary.

After this PR:

  • Legacy agents.db content is migrated into the main v2 SQLite database through dedicated agents_* tables.
  • Agents-only migration clears only the imported agents tables when re-running.
  • The existing agents service layer now reads and writes the main v2 database instead of the standalone agents database.

Fixes #

Why we need it and why it was done in this way

This finishes the storage-side portion of the agents v2 migration. The data import and the runtime storage backend need to point at the same database, otherwise migrated data is not the data the application actually uses.

The following tradeoffs were made:

  • The existing agents service/API surface was preserved and only its storage backend was retargeted.
  • This keeps the change small and lowers regression risk, at the cost of leaving the DataApi/UI migration for a follow-up PR.

The following alternatives were considered:

  • Migrate storage and renderer/API access in one PR.
  • Keep the standalone agents database and defer the backend storage cutover.

Links to places where the discussion took place: None

Breaking changes

None.

Special notes for your reviewer

This PR is intentionally limited to the database migration and runtime storage cutover. The follow-up API/UI migration is split into a second PR.

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note

NONE

vaayne added 3 commits April 10, 2026 14:25
Signed-off-by: Vaayne <liu.vaayne@gmail.com>
Signed-off-by: Vaayne <liu.vaayne@gmail.com>
Signed-off-by: Vaayne <liu.vaayne@gmail.com>
@vaayne vaayne requested a review from a team April 10, 2026 06:30
@vaayne vaayne requested a review from 0xfullex as a code owner April 10, 2026 06:30
@vaayne vaayne marked this pull request as draft April 10, 2026 06:31
@vaayne vaayne added the v2 label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant