Skip to content

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

Merged
juliusmarminge merged 3 commits into
pingdotgg:t3code/codex-turn-mappingfrom
chrisdeeming:fix/v1-reasoning-role-compat
Sep 18, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:t3code/codex-turn-mappingfrom
chrisdeeming:fix/v1-reasoning-role-compat

Conversation

@chrisdeeming

@chrisdeeming chrisdeeming commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

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

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>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 18, 2026
chrisdeeming and others added 2 commits September 19, 2026 00:20
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
chrisdeeming marked this pull request as ready for review September 18, 2026 23:29
@macroscopeapp

macroscopeapp Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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.

@juliusmarminge
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>
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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants