fix(server): decode v1 message events persisted with a reasoning role - #12514
Merged
juliusmarminge merged 3 commits intoSep 18, 2026
Conversation
Nightly builds that emit thinking traces write thread.message-sent events with role "reasoning" into the v1 event log. This branch narrowed OrchestrationMessageRole to user|assistant|system, so the projection bootstrap replaying the log crashed with PersistenceDecodeError and the server could not start on any environment that had reasoning messages. Restore "reasoning" to the union for decode compatibility. V2 carries reasoning as turn items and produces no new reasoning messages; the transcript importer already filters to user|assistant rows. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
codexFeedbackMessage declared OrchestrationMessage as its return type, whose role union now includes "reasoning" for persisted-event decode compatibility. ChatMessage.role stays user|assistant|system, so the declaration lost assignability. Narrow the return type to the roles the function actually produces. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Replaces the store-level replay test with a payload decode test matching the file's other historical-compat cases - same union coverage without the insert boilerplate. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
chrisdeeming
marked this pull request as ready for review
September 18, 2026 23:29
Contributor
ApprovabilityVerdict: Approved at 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. |
juliusmarminge
merged this pull request
into
pingdotgg:t3code/codex-turn-mapping
Sep 18, 2026
29 checks passed
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 19, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 19, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2 tasks done
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 21, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 21, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2 tasks done
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 24, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 24, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 24, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 25, 2026
…#12514) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Restores
"reasoning"to the v1OrchestrationMessageRoleunion (removed in7279f61484) so persistedthread.message-sentevents decode again, plus a regression test that raw-inserts a reasoning-role event row and replays it throughreadFromSequence.Why
Nightly builds (post-
052c7ae53e) persist thinking traces asthread.message-sentevents withrole: "reasoning"inorchestration_events. At startup the v1OrchestrationEnginerunsprojectionPipeline.bootstrap, which replays the whole log — any environment with reasoning events dies withPersistenceDecodeError(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, andLegacyV1ThreadImporteralready filters transcripts touser | assistant— so the widened union is purely decode-compat.Checklist
Generated with Devin