Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): tool output images are stored once on disk, not inline in SQLite #34956

Openjuliusmarmingewants to merge 6 commits intomain fromrefs/pull/34956/headopened View on GitHub

Showing 10 changed files with 71 additions and 22 deletions (loading 7).

x
0 of 10 viewed, 10 left
49 additions and 19 deletionsapps/server/src/assets/AssetAccess.test.tsModified
View file
@@ -27,6 +27,7 @@
​
import * as AssetSigner from "./AssetSigner.ts";
import * as ServerSecretStore from "../auth/ServerSecretStore.ts";
+import { toolOutputImageAttachmentId } from "../attachmentStore.ts";
import * as ServerConfig from "../config.ts";
import * as Orchestrator from "../orchestration-v2/Orchestrator.ts";
import * as ProjectFaviconResolver from "../project/ProjectFaviconResolver.ts";
@@ -102,16 +103,32 @@
​
+const storedScreenshotAttachmentId = toolOutputImageAttachmentId(screenshotPng, ".png");
+const foreignAttachmentId = "thread-2-00000000-0000-4000-8000-000000000041-png";
+const storedScreenshotItem = {
+ ...screenshotItem,
+ id: TurnItemId.make("tool-screenshot-stored"),
+ output: {
+ content: [{ type: "image", mimeType: "image/png", attachmentId: storedScreenshotAttachmentId }],
+ },
+};
+// Rows persisted before the server stored images can carry any id a provider emitted.
+const foreignScreenshotItem = {
+ ...screenshotItem,
+ id: TurnItemId.make("tool-screenshot-foreign"),
+ output: {
+ content: [{ type: "image", mimeType: "image/png", attachmentId: foreignAttachmentId }],
+ },
+};