Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): saved preview screenshots keep full resolution #28255

MergedTonybynMp4(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/28255/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 7 changed files with 68 additions and 4 deletions (loading 4).

x
0 of 7 viewed, 7 left
6 additions and 2 deletionsapps/server/src/mcp/toolkits/preview/handlers.tsModified
View file
@@ -221,8 +221,12 @@
invokeTargeted<PreviewAutomationSetColorSchemeResult>("setColorScheme", input),
preview_snapshot: McpToolAccess.readsAsCaller((input) => {
- const { includeImage: _includeImage, save: _save, ...operationInput } = input ?? {};
- return invokeTargeted<PreviewAutomationSnapshot>("snapshot", operationInput);
+ const { includeImage: _includeImage, save, ...operationInput } = input ?? {};
+ // The saved file is for people, so it keeps the resolution the agent's image is capped below.
+ return invokeTargeted<PreviewAutomationSnapshot>("snapshot", {
+ ...operationInput,
+ ...(save === true ? { fullScreenshot: true } : {}),
+ });
}),
preview_act: McpToolAccess.actsAsCaller(({ action, ...input }) =>
decodeActInput[action](input).pipe(
52 additions and 0 deletionsapps/server/src/mcp/McpHttpServer.test.tsModified
View file
@@ -19,6 +19,7 @@
import * as Context from "effect/Context";
import * as Deferred from "effect/Deferred";
import * as Effect from "effect/Effect";
+import * as FileSystem from "effect/FileSystem";
import * as Layer from "effect/Layer";
import * as Logger from "effect/Logger";
import * as Schema from "effect/Schema";
@@ -433,6 +434,57 @@
).pipe(Effect.provide(layerTest)),