Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): show Codex tool-output images inline #23284

MergedPonkoKobo(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/23284/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 38 additions and 2 deletions.

x
0 of 2 viewed, 2 left
28 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsModified
View file
@@ -39,6 +39,7 @@
import * as Predicate from "effect/Predicate";
import * as FileSystem from "effect/FileSystem";
import { MCP_APP_OUTPUT_KEY, readMcpAppReference } from "@t3tools/shared/mcpApp";
+import { toolOutputImages } from "@t3tools/shared/toolOutput";
import { resolveAttachmentPathById } from "../../attachmentStore.ts";
import * as Fiber from "effect/Fiber";
import * as Layer from "effect/Layer";
@@ -6510,3 +6511,30 @@
+​
+describe("codexDynamicToolOutput", () => {
+ it("translates inputImage data URLs into image blocks the work log can serve", () => {
+ const output = CodexAdapterV2.codexDynamicToolOutput({
+ type: "dynamicToolCall",
+ id: "exec-image",
+ tool: "exec",
+ status: "completed",
+ arguments: {},
+ contentItems: [
+ { type: "inputText", text: "Script completed" },
+ { type: "inputImage", imageUrl: "data:image/png;base64,iVBORw0KGgo=" },
+ { type: "inputImage", imageUrl: "https://example.test/remote.png" },
+ { type: "inputImage", imageUrl: "data:image/png;base64," },
+ { type: "inputAudio", audioUrl: "data:audio/wav;base64,AAAA" },
+ ],
+ });