Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): decode v1 message events persisted with a reasoning role #12514

Mergedchrisdeeming(GitHub profile, opens in a new tab)merged 3 commits intot3code/codex-turn-mapping fromrefs/pull/12514/headmerged by juliusmarminge View on GitHub

What Changed

Restores "reasoning" to the v1 OrchestrationMessageRole union (removed in 7279f61484) so persisted thread.message-sent events decode again, plus a regression test that raw-inserts a reasoning-role event row and replays it through readFromSequence.

Why

Nightly builds (post-052c7ae53e) persist thinking traces as thread.message-sent events with role: "reasoning" in orchestration_events. At startup the v1 OrchestrationEngine runs projectionPipeline.bootstrap, which replays the whole log — any environment with reasoning events dies with PersistenceDecodeError (Expected "user" | "assistant" | "system" at ["payload"]["role"]) and the preview cannot boot. Reproduces on real nightly data (1,575 such events on a live DB).

V2 carries reasoning as turn items and produces no new reasoning messages, the v1 decider stays collapsed to assistant, and LegacyV1ThreadImporter already filters transcripts to user | assistant — so the widened union is purely decode-compat.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Generated with Devin

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Approvability

      Verdict: Approved at 3cf8621

      Macroscope's review found this PR approvable — This is a narrowly scoped compatibility fix that widens the v1 message-role decoder to accept reasoning events already present in persistence, with a targeted regression test. The accompanying client change is type-only and does not alter runtime behavior.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. juliusmarminge merged this

    4. juliusmarminge closed this

Sign in to join this conversation.