Skip to content

[Bug]: startup crash when importing newer T3 Code state #97

@mattiacerutti

Description

@mattiacerutti

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Not sure

Steps to reproduce

  1. Start clean:
rm -rf ~/.t3 ~/.dpcode
  1. Run T3 Code at a version containing the shape-change commit above, for example v0.0.21 or later.
  2. In T3 Code, add a local folder and send one message.
  3. Close T3 Code. This creates ~/.t3/userdata/state.sqlite.
  4. Start DP Code.

You can confirm the T3 Code DB contains the newer shape with:

sqlite3 "$HOME/.t3/userdata/state.sqlite" \
  "SELECT sequence, event_type, json_extract(payload_json, '$.modelSelection.options') FROM orchestration_events WHERE json_type(payload_json, '$.modelSelection.options') = 'array';"

Example result:

2|thread.created|[{"id":"reasoningEffort","value":"medium"}]
4|thread.turn-start-requested|[{"id":"reasoningEffort","value":"medium"}]

Expected behavior

DP Code should import the .t3 state and start normally.

Actual behavior

DP Code imports the .t3 state into .dpcode, then crashes while replaying orchestration_events.

The error is:

Decode error in OrchestrationEventStore.readFromSequence:rowToEvent(sequence=4, type=thread.created): Expected object | undefined, got [{"id":"reasoningEffort","value":"medium"}]
  at ["payload"]["modelSelection"]["options"]

The imported T3 Code event has this shape:

"modelSelection": {
  "provider": "codex",
  "model": "gpt-5.5",
  "options": [{ "id": "reasoningEffort", "value": "medium" }]
}

Current DP Code expects this shape instead:

"modelSelection": {
  "provider": "codex",
  "model": "gpt-5.5",
  "options": { "reasoningEffort": "medium" }
}

Impact

Blocks work completely

Version or commit

No response

Environment

No response

Logs or stack traces

Expected { readonly "provider": "codex", ... } | { readonly "provider": "claudeAgent", ... } | { readonly "provider": "gemini", ... } | { readonly "provider": "opencode", ... }, got {"instanceId":"codex","model":"gpt-5.4"}
@t3tools/desktop:start:   at ["payload"]["defaultModelSelection"]

Screenshots, recordings, or supporting files

No response

Workaround

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions