Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): persist the wire projection for streaming tool.updated data #6675

MergedmInrOz(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/6675/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 70 additions and 2 deletions.

x
0 of 2 viewed, 2 left
60 additions and 0 deletionsapps/server/src/orchestration/Layers/ProviderRuntimeIngestion.activity.test.tsModified
View file
@@ -82,3 +82,63 @@
expect(usagePayload).not.toHaveProperty("status");
});
});
+describe("runtimeEventToActivities tool streaming persistence", () => {
+ const accumulatedStdout = [
+ "first line of output",
+ ...Array.from({ length: 500 }, (_, index) => `Capturing frame ${index}/9028`),
+ ].join("\n");
+ const streamingData = {
+ toolCallId: "tool-call-1",
+ kind: "execute",
+ command: "blender --render",
+ rawOutput: { stdout: accumulatedStdout },
+ content: [{ type: "content", content: { type: "text", text: accumulatedStdout } }],
+ };
+​
+ it("persists tool.updated with the wire projection of data, not the accumulated stream", () => {
+ const event = {
+ ...base,
+ type: "item.updated",
+ eventId: EventId.make("evt-tool-streaming-updated"),
+ payload: {
+ itemType: "command_execution",
+ status: "inProgress",
+ title: "Render",
+ detail: accumulatedStdout,
+ data: streamingData,
+ },
+ } satisfies ProviderRuntimeEvent;