[Bug]: Desktop 0.0.42 never opens a window — backend crash-loops on legacy thread.message-sent rows missing payload.turnId #12762
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/desktop
Steps to reproduce#
- Have legacy
thread.message-sentrows without thepayload.turnIdkey in~/.t3/userdata/state.sqlite(written by an older build; in my case 55 rows, sequences 539–593, one thread, dated 2026-08-03). - Launch T3 Code (Alpha) 0.0.42 on Windows.
- Observe: main + GPU + renderer + server processes stay alive, but no window is ever created. Restarting, clearing Cache/GPUCache,
--disable-gpu,--no-sandbox, and a full reinstall (state in~/.t3survives it) all reproduce the same result. - Check
~/.t3/userdata/logs/server-child.log: the backend child exits withcode=1and respawns roughly every ~30s with a new pid.
Expected behavior#
The backend finishes replaying OrchestrationEventStore (treating a missing turnId as null, as newer rows already store explicit "turnId": null), becomes ready, and the desktop window opens.
Actual behavior#
The backend throws on the first legacy row and never becomes ready, so the window is never created. All processes report no top-level window (MainWindowHandle 0).
Impact#
Blocks work completely
Version or commit#
T3 Code (Alpha) 0.0.42.0, update channel latest, installed at %LocalAppData%\Programs\t3code
Environment#
Windows 11 10.0.26200, Ryzen 5 3600, NVIDIA RTX 5060 Ti (driver 32.0.16.1656). Backend state: ~/.t3/userdata/state.sqlite (~63 MB, 11835 rows in orchestration_events).
Logs or stack traces#
One redacted crash cycle from ~/.t3/userdata/logs/server-child.log (repeats with a new pid ~every 30s):
[2026-09-20T17:53:20.733Z] ERROR backend child process failure output start | pid=22048 port=3773 cwd=C:\Users\<user>
[2026-09-20T17:53:20.740Z] INFO backend-child stdout:
[14:52:50.728] INFO (#66): Relay client process started; waiting for tunnel connection
[2026-09-20T17:53:20.752Z] INFO backend-child stdout:
[14:52:53.972] ERROR (#3): PersistenceDecodeError: Decode error in OrchestrationEventStore.readFromSequence:rowToEvent: AnyOf(Composite(Pointer(Composite(Pointer(MissingKey)))))
at PersistenceDecodeError.fromSchemaError (file:///C:/Users/<user>/AppData/Local/Programs/t3code/resources/server.asar/apps/server/dist/bin.mjs:56348:10)
at file:///C:/Users/<user>/AppData/Local/Programs/t3code/resources/server.asar/apps/server/dist/bin.mjs:56392:43
at file:///C:/Users/<user>/AppData/Local/Programs/t3code/resources/server.asar/apps/server/dist/claudeHistoryWorker-CAn1PawV.mjs:10021:96
at ~effect/Utils/internal (file:///C:/Users/<user>/AppData/Local/Programs/t3code/resources/server.asar/apps/server/dist/claudeHistoryWorker-CAn1PawV.mjs:2558:10) {
[cause]: SchemaError: Missing key
at ["payload"]["turnId"]
}
[2026-09-20T17:53:20.753Z] ERROR backend child process failure output end | pid=22048 code=1
DB finding: `thread.message-sent` = 1007 rows, 952 with `turnId` (newer ones explicitly `null`), 55 without the key (seq 539–593). All other event types that never had `turnId` decode fine, so the decoder requires the key specifically for this event type.
Screenshots, recordings, or supporting files#
No response
Workaround#
With the app closed, back up ~/.t3/userdata/state.sqlite, then backfill "turnId": null into the legacy thread.message-sent payloads missing the key. Backend became stable and the window opened immediately, with no data loss.
Suggested fix#
Add a startup schema migration (or backward-compatible decode treating a missing turnId as null) for legacy thread.message-sent rows, so old state doesn't brick the desktop app in a silent crash loop.
CallMeFabioo(GitHub profile, opens in a new tab) added labelsbug
CallMeFabioo(GitHub profile, opens in a new tab) added labelsneeds-triage
juliusmarminge removed labelsneeds-triage
juliusmarminge added labelsaccepted
juliusmarminge added labelsvia-triage
maria-rcks closed this
Sign in to join this conversation.
Triage#
Confirmed. This is a real startup blocker, not a Windows/GPU issue.
Desktop 0.0.42 never opens a window because the backend dies while replaying
orchestration_events. The crash inserver-child.logmatches current code:PersistenceDecodeErrorinOrchestrationEventStore.readFromSequence:rowToEvent→Missing keyat["payload"]["turnId"].thread.message-sentpayloads are decoded withSchema.NullOr(TurnId), which requires the key. A missing key is not treated asnull. Newer rows already store"turnId": null; older ones (your Aug 3 rows) omit it. Projection bootstrap (ProjectionPipeline.bootstrap) replays the log through that decoder, so one legacy row crash-loops the child. The desktop shell stays up but never getshandleBackendReady, so no main window (MainWindowHandle 0).This is still true on current
main. Same class of bug as #12514 (thread.message-sent+role: "reasoning"), different field. #10517 / #10523 would only surface the crash; they would not decode these rows.Workaround (already verified by reporter)#
With the app closed, back up
~/.t3/userdata/state.sqlite, then set"turnId": nullon legacythread.message-sentpayloads that lack the key.Suggested fix#
Prefer decode-compat over rewriting the event log:
payload.turnIdtonullonThreadMessageSentPayload(andOrchestrationMessageif projected/cached messages can omit it too), usingSchema.withDecodingDefault(Effect.succeed(null))— same pattern asarchivedAt/settledAt.thread.message-sentrow withoutturnIdand asserts replay/decode succeeds (same approach as #12514).A SQL backfill migration is optional once decode-compat is in place.
Not a duplicate. Accepting.