Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

thread-migration.md

66 lines2.9 KB

1# Threads from older T3 Code versions
2​
3On your first V2 launch, T3 Code copies the V1 database, `state.sqlite`, into `statev2.sqlite`
4in the same data directory and migrates the copy. Your threads appear automatically, with full
5transcripts imported as needed. You do not need to run an import command.
6​
7You can close V2 and return to V1, which continues using its original database. Opening V2 again
8resumes your V2 history. The copy happens only once: later conversations and changes in either
9version do not sync to the other. Settings, attachments, and workspace files remain shared.
10​
11The migrated thread keeps its title, project, provider and model selection, permission and
12interaction modes, branch or worktree, archive state, settlement state, snooze and pin state, and
13linked pull request. T3 Code also brings over user and assistant messages, their timestamps, and
14supported attachments. Large histories may appear in stages while the server imports transcripts.
15​
16The migration does not recreate the old provider's live session. It also does not convert old run
17records, checkpoints and diffs, tool activity, approval history, or proposed plan history into the
18new format. These items may be absent from a migrated timeline even though the conversation text is
19present.
20​
21## Continuing a migrated thread
22​
23The first new message starts a fresh provider session. T3 Code gives that session the newest part of
24the old user and assistant transcript, up to 32,000 characters. Earlier text remains visible in the
25thread, but the provider does not receive it automatically.
26​
27Before continuing a long or important thread, read the recent transcript and include any older
28requirements the agent still needs in your next message. Starting a new thread and pasting a short
29handoff is also a good choice when the old conversation contains conflicting instructions.
30​
31## Keeping a recovery copy
32​
33T3 Code does not currently have a whole-thread export command. Before a major server update, stop
34the server and copy its `userdata` directory to a safe location. The default is
35`~/.t3/userdata`; a server started with `--home-dir <path>` uses `<path>/userdata`.
36​
37If a migrated transcript is missing from the app, keep that copy unchanged. You can inspect the
38old transcript without starting a server against it:
39​
40```sh
41sqlite3 -readonly /path/to/recovery-copy/state.sqlite
42```
43​
44At the SQLite prompt, list recent legacy threads:
45​
46```sql
47.headers on
48.mode tabs
49SELECT thread_id, title, updated_at
50FROM projection_threads
51ORDER BY updated_at DESC;
52```
53​
54Then print one transcript, replacing `<thread-id>` with the value from the first query:
55​
56```sql
57SELECT role, text, created_at
58FROM projection_thread_messages
59WHERE thread_id = '<thread-id>'
60 AND role IN ('user', 'assistant')
61ORDER BY created_at, message_id;
62```
63​
64Open only the copied database. Do not edit it or point a newer or older server at your recovery
65copy. If the affected environment is remote, make and inspect the copy on the machine that runs
66that environment.