Skip to content

fix: add migration for claudeCode to claudeAgent provider rename#1405

Open
urielkdev wants to merge 5 commits intopingdotgg:mainfrom
urielkdev:fix/migrate-claudeCode-to-claudeAgent
Open

fix: add migration for claudeCode to claudeAgent provider rename#1405
urielkdev wants to merge 5 commits intopingdotgg:mainfrom
urielkdev:fix/migrate-claudeCode-to-claudeAgent

Conversation

@urielkdev
Copy link
Copy Markdown

@urielkdev urielkdev commented Mar 25, 2026

Summary

  • Adds database migration 017_RenameClaudeCodeProvider to rename "claudeCode""claudeAgent" across all affected tables (provider_session_runtime, projection_thread_sessions, projection_threads, projection_projects, orchestration_events)
  • Adds backward-compatible fallback in decodeProviderKind mapping "claudeCode""claudeAgent"
  • Registers migration 017 in Migrations.ts

Context

Commit 33791cdf ("align branding guide lines") renamed the provider from claudeCode to claudeAgent in source code but didn't include a database migration. Any user who used the Claude provider before that commit has "claudeCode" persisted in their SQLite database, causing a crash loop on startup:

ProviderSessionDirectoryPersistenceError: Unknown persisted provider 'claudeCode'.
SchemaError: Expected { "provider": "codex", ... } | { "provider": "claudeAgent", ... }, got {"provider":"claudeCode","model":"claude-opus-4-6"}
[desktop] backend exited unexpectedly (code=1 signal=null); restarting in 500ms

Closes #534

Test plan

  • Verified locally: migration runs on startup, converts stale data, backend starts cleanly
  • Users who never used Claude provider → migration updates zero rows, harmless
  • Fresh installs → no claudeCode data exists, migration is a no-op

Note

Medium Risk
Runs data-rewriting SQL updates across multiple tables (including JSON fields) during migration; mistakes could leave persisted provider references inconsistent, though the change is narrow and covered by tests.

Overview
Fixes legacy persisted provider identifiers by adding migration 017_RenameClaudeCodeProvider, rewriting claudeCodeclaudeAgent in provider_session_runtime, projection_thread_sessions, projection_threads, projection_projects, and orchestration_events (including JSON columns and adapter_key).

Registers the new migration in Migrations.ts and adds a backward-compatible decode path in ProviderSessionDirectory so any remaining claudeCode rows are read as claudeAgent, with tests covering both the migration and runtime decoding.

Written by Cursor Bugbot for commit e166709. This will update automatically on new commits. Configure here.

Note

Add migration to rename claudeCode provider references to claudeAgent

  • Adds migration 017 that rewrites all persisted claudeCode provider references to claudeAgent across provider_session_runtime, projection_thread_sessions, projection_threads, projection_projects, and orchestration_events (including JSON columns and adapter_key).
  • Updates decodeProviderKind in ProviderSessionDirectory.ts to treat legacy claudeCode values as claudeAgent at read time, covering any rows not yet migrated.
  • Behavioral Change: after migration runs, all stored provider identifiers previously recorded as claudeCode will permanently read back as claudeAgent.

Macroscope summarized e166709.

Commit 33791cd renamed the provider from "claudeCode" to "claudeAgent"
in source code but didn't include a database migration. Users who used
the Claude provider before that commit have "claudeCode" persisted in
SQLite, causing a crash loop on startup.

Adds migration 017 to rename "claudeCode" → "claudeAgent" across all
affected tables and a backward-compatible fallback in decodeProviderKind.

Closes pingdotgg#534

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5f3e4a3a-80d3-4505-a116-b2961a2befa9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@namecallfilter
Copy link
Copy Markdown

Can confirm this fixed the issue for me.

Follows the existing migration test pattern (016): runs migrations
up to N-1, inserts legacy data with "claudeCode", runs migration N,
and asserts all tables were correctly updated to "claudeAgent".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 26, 2026
urielkdev and others added 3 commits March 26, 2026 12:09
…tory

Inserts a row with legacy "claudeCode" provider directly in SQLite
and verifies getBinding decodes it as "claudeAgent".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: Unable to add project Request time out: orchestration.dispatchCommand

2 participants