Uh oh!
There was an error while loading. Please reload this page.
feat: migrate v1 state into orchestrator v2 - #4400
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0fff2d0 to
1d15173CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a5b5085 to
952df09Compare4f338ff to
4e8f03aCompare6b1c011 to
cd04ad1Compare4e8f03a to
c827ebaComparecd04ad1 to
1e58e65Comparec827eba to
1842adeCompare1e58e65 to
a286c60Compare1842ade to
f9f39dbComparef845ccf to
8008280Compare8008280 to
4e8f49cCompareThere was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit 4600a83. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: codex <codex@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>

Summary
userdatadirectoryMigration behavior
projection_thread_messagesafter command readiness and on first open/dispatchVerification
Stacked on #2829. The released migration-order repair now lives in the parent PR.
Note
High Risk
Touches startup ordering, SQLite migration, on-disk state paths, and command/WebSocket paths where transcript hydration failures block reads and dispatch; incorrect import or path rename could strand or duplicate user data.
Overview
Migrates legacy v1 conversation state into orchestration v2 and drops the
userdata-v2/t3code-v2naming in favor of productionuserdataandt3code(desktop, server CLI, SSH remote launch).A new
LegacyV1ThreadImporterruns at startup (reconcileShells) to emit v2 events for threads that exist only in v1 projections, with lightweight shell previews (latest user + latest message). Full transcripts hydrate lazily viaensureTranscripton dispatch/projection/WebSocket subscribe, plus a backgroundimportPendingTranscriptspass after the server accepts commands. Progress is tracked in migration 043 (orchestration_v2_legacy_imports).Imported threads get
historyOrigin: v1_import.prepareLegacyImportbuilds a truncatedmanual_contexthandoff so the first native v2 turn (and provider-switch recovery after a failed run) can see imported user/assistant text without migrating v1 provider sessions.isTurnItemAtOrBeforeRuntreats runless imported items as visible for forks and provider switches.ThreadManagementServicehydrates legacy transcripts before dispatch and projection reads; hydration failures surface as dispatch/projection errors.Reviewed by Cursor Bugbot for commit 67ab204. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Migrate v1 thread state into orchestrator v2 with incremental import and context handoff
LegacyV1ThreadImporterto migrate v1 threads into the v2 orchestration system in two phases:reconcileShells(run at startup) creates thread shells with preview events, andimportPendingTranscripts(background fiber) hydrates full transcripts idempotently.prepareLegacyImporttoContextHandoffServiceV2to generatemanual_contexthandoffs carrying a text summary of imported history, capped at 32,000 characters with word-boundary truncation.ThreadManagementServiceso projections and dispatches hydrate v1 threads before execution, surfacing failures asOrchestratorProjectionErrororOrchestratorDispatchError.historyOrigin('native'|'v1_import') toOrchestrationV2AppThreadandOrchestrationV2ThreadShellcontracts, and propagates it through projection and shell utilities.orchestration_v2_legacy_imports) to track per-thread import progress.userdata-v2touserdataacross server, desktop, and SSH tunnel paths.userdata-v2→userdatarename is a breaking path change; existing non-dev installations must migrate their state directory or data will not be found.Macroscope summarized 67ab204.