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

Showing 3 changed files with 28 additions and 2 deletions.

x
0 of 3 viewed, 3 left
1 addition and 1 deletionpackages/client-runtime/src/state/threadFeedback.tsModified
View file
@@ -60,7 +60,7 @@
export function codexFeedbackMessage(
submission: CodexFeedbackSubmission,
role: "user" | "assistant" = "user",
-): OrchestrationMessage {
+): OrchestrationMessage & { readonly role: "user" | "assistant" } {
const text =
role === "user"
? submission.command
18 additions and 0 deletionspackages/contracts/src/orchestration.test.tsModified
View file
@@ -594,6 +594,24 @@
}),
​
+// Builds that emit thinking traces persist reasoning as message events; the
+// union must keep decoding them.
+it.effect("decodes message events with a reasoning role", () =>
+ Effect.gen(function* () {
+ const parsed = yield* decodeThreadMessageSentPayload({
+ threadId: "thread-1",
+ messageId: "reasoning:summary:1",
+ role: "reasoning",
+ text: "thinking",
+ turnId: null,
+ streaming: false,
+ createdAt: "2026-01-01T00:00:00.000Z",
+ updatedAt: "2026-01-01T00:00:00.000Z",