fix(media): preview host files and stream videos across clients #9023
Mergedjuliusmarmingemerged 17 commits into
main fromrefs/pull/9023/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change
- apps/web/src/components/files/FilePreviewPanel.tsx lines 236 to 236OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -176,0 +216,21 @@216+ (assetUrl._tag === "Failure" && videoUrl === null) ||217+ (videoUrl !== null && failedUrl === videoUrl)218+ ) {219+ return (220+ <div className="flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive">221+ Unable to load video. The file may be missing or its format unsupported.222+ </div>223+ );224+ }225+226+ return videoUrl !== null ? (227+ <div className="flex min-h-0 flex-1 items-center justify-center overflow-hidden p-4">228+ <video229+ ref={videoRef}230+ src={videoUrl}231+ aria-label={props.name}232+ controls233+ playsInline234+ preload="none"235+ className="aspect-video max-h-full w-full max-w-5xl bg-black object-contain"236+ onPlay={() => setPlaybackUrl(videoUrl)}@@ -1251,3 +1348,6 @@12511348 );12521349 }12531350 const src = assetUrl.url + (props.srcFragment ?? "");1351+ if (props.kind === "video") {1352+ return (1353+ <ChatMarkdownVideo@@ -1810,3 +1930,12 @@18101930 extraRemarkPlugins = EMPTY_REMARK_PLUGINS,18111931 }: ChatMarkdownProps) {18121932 const { resolvedTheme } = useTheme();1933+ const [localMediaPreview, setLocalMediaPreview] = useState<ExpandedImagePreview | null>(null);1934+ const expandMedia = onImageExpand ?? setLocalMediaPreview;1935+ const mediaRequestId = useRef(0);1936+ useEffect(1937+ () => () => {1938+ mediaRequestId.current += 1;1939+ },1940+ [threadRef?.environmentId, threadRef?.threadId],1941+ );apps/server/src/assets/AssetAccess.ts line 241Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -211,3 +218,20 @@211218 let sourcePath: string | undefined;212219213220 switch (input.resource._tag) {221+ case "media-file": {222+ let requestedPath = input.resource.path;223+ if (!path.isAbsolute(requestedPath)) {224+ if (!input.workspaceRoot) {225+ return yield* new AssetWorkspaceContextNotFoundError({ resource: input.resource });226+ }227+ const workspaceRoot = yield* workspacePaths228+ .normalizeWorkspaceRoot(input.workspaceRoot)229+ .pipe(230+ Effect.mapError(231+ (cause) =>232+ new AssetWorkspaceRootNormalizationError({ resource: input.resource, cause }),233+ ),234+ );235+ requestedPath = path.resolve(workspaceRoot, requestedPath);236+ }237+ const canonicalFile = yield* resolveCanonicalFile(requestedPath).pipe(
- apps/web/src/components/ChatMarkdown.tsx lines 1271 to 1284OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1222,0 +1264,21 @@1264+ );1265+ }1266+ return (1267+ <span1268+ className="relative inline-block! w-full max-w-[30rem] align-middle"1269+ data-markdown-copy={props.copyMarkdown}1270+ >1271+ <video1272+ ref={videoRef}1273+ src={src}1274+ aria-label={props.alt || "Video preview"}1275+ controls1276+ playsInline1277+ preload="none"1278+ className="aspect-video max-h-[30rem] w-full rounded-lg border border-border/40 bg-black object-contain"1279+ onPlay={() => setPlaybackSource({ identity: mediaIdentity, src })}1280+ onError={() => {1281+ if (src !== props.src) setPlaybackSource(null);1282+ else setFailedSrc(src);1283+ }}1284+ />apps/web/src/components/ChatMarkdown.tsx lines 2469 to 2483Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -2232,3 +2404,18 @@22322404 handleMarkdownFragmentClick(event, href);22332405 return;22342406 }2407+ if (2408+ href &&2409+ /^https?:\/\//i.test(href) &&2410+ mediaKindFromPath(href) !== null &&2411+ !event.defaultPrevented &&2412+ !event.metaKey &&2413+ !event.ctrlKey &&2414+ !event.shiftKey &&2415+ !event.altKey2416+ ) {2417+ event.preventDefault();2418+ event.stopPropagation();2419+ openMarkdownMedia(href);2420+ return;2421+ }apps/web/src/components/ChatMarkdown.tsx lines 2777 to 2782Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -2483,3 +2690,9 @@24832690 >24842691 {text}24852692 </ReactMarkdown>2693+ {localMediaPreview ? (2694+ <ExpandedImageDialog2695+ preview={localMediaPreview}2696+ onClose={() => setLocalMediaPreview(null)}2697+ />2698+ ) : null}
- apps/web/src/components/ChatMarkdown.tsx lines 1290 to 1292OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1222,0 +1272,21 @@1272+ );1273+ observer.observe(video);1274+ return () => {1275+ active = false;1276+ observer.disconnect();1277+ };1278+ }, [src, preloadedSrc]);1279+ useEffect(() => {1280+ const video = videoRef.current;1281+ const pauseWhenHidden = () => {1282+ if (document.hidden) video?.pause();1283+ };1284+ document.addEventListener("visibilitychange", pauseWhenHidden);1285+ return () => {1286+ document.removeEventListener("visibilitychange", pauseWhenHidden);1287+ video?.pause();1288+ };1289+ }, [src]);1290+ if (failedSrc === src) {1291+ return (1292+ <ChatMarkdownImageFallback alt={props.alt} copyMarkdown={props.copyMarkdown} kind="video" />
- apps/mobile/src/components/MediaVideoPreviewModal.tsx lines 34 to 35OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +15,21 @@15+ readonly source: MediaVideoPreviewSource;16+ readonly onRequestClose: () => void;17+}) {18+ const { source } = props;19+ const insets = useSafeAreaInsets();20+ const environmentId = "environmentId" in source ? source.environmentId : null;21+ const connection = usePreparedConnection(environmentId);22+ const asset = useAssetUrlState(environmentId, "resource" in source ? source.resource : null);23+ const [uri, setUri] = useState<string | null>("uri" in source ? source.uri : null);24+ const [sharing, setSharing] = useState(false);25+ const [shareError, setShareError] = useState<string | null>(null);26+ const shareController = useRef<AbortController | null>(null);27+ const unavailable =28+ uri === null &&29+ environmentId !== null &&30+ (connection._tag === "None" || asset._tag === "Failure");31+32+ useEffect(() => Keyboard.dismiss(), []);33+ useEffect(() => {34+ if (uri === null && asset._tag === "Success") setUri(asset.url + (source.srcFragment ?? ""));35+ }, [uri, asset, source.srcFragment]);apps/web/src/components/chat/ExpandedImagePreview.tsx lines 95 to 95OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -14,0 +75,21 @@75+ if (!input.threadRef || !input.httpBaseUrl) {76+ throw new Error("Reconnect to this environment and open the media again.");77+ }78+ const result = await input.createAssetUrl({79+ environmentId: input.threadRef.environmentId,80+ input: {81+ resource: { _tag: "media-file", threadId: input.threadRef.threadId, path },82+ },83+ });84+ if (result._tag === "Failure") throw squashAtomCommandFailure(result);85+ const assetUrl = resolveAssetUrl(input.httpBaseUrl, result.value.relativeUrl);86+ if (assetUrl === null) throw new Error("The environment returned an invalid media URL.");87+ src = assetUrl + markdownImageSourceFragment(input.source);88+ }89+ return {90+ images: [91+ {92+ src,93+ name: name || kind,94+ ...(kind === "video" ? { type: "video", autoPlay: false } : {}),95+ ...(source._tag === "Direct" && resolveExternalWebLinkHost(src) !== null
- @@ -1222,0 +1288,21 @@1288+ };1289+ }, [src]);1290+ if (failedSrc === src) {1291+ return (1292+ <ChatMarkdownImageFallback alt={props.alt} copyMarkdown={props.copyMarkdown} kind="video" />1293+ );1294+ }1295+ return (1296+ <span1297+ className="relative inline-block! w-full max-w-[30rem] align-middle"1298+ data-markdown-copy={props.copyMarkdown}1299+ >1300+ <video1301+ ref={videoRef}1302+ src={src}1303+ aria-label={props.alt || "Video preview"}1304+ controls1305+ playsInline1306+ preload={preloadedSrc === src ? "metadata" : "none"}1307+ className="aspect-video max-h-[30rem] w-full rounded-lg border border-border/40 bg-black object-contain"1308+ onLoadedMetadata={(event) => prepareVideoFirstFrame(event.currentTarget)}
- apps/server/src/assets/AssetAccess.ts line 603Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -526,3 +586,18 @@526586 const decodedPath = decodeRelativePath(relativePath);527587 if (decodedPath === null) return null;528588 const path = yield* Path.Path;589+ if (claims.kind === "media-file-exact") {590+ if (decodedPath !== path.basename(claims.filePath)) return null;591+ const canonicalFile = yield* resolveCanonicalFile(claims.filePath).pipe(592+ Effect.tapError((cause) =>593+ Effect.logError("Failed to resolve canonical media path.", {594+ filePath: claims.filePath,595+ cause,596+ }),597+ ),598+ Effect.orElseSucceed(() => null),599+ );600+ if (canonicalFile !== claims.filePath) return null;601+ const mimeType = mediaMimeTypeFromExtension(path.extname(canonicalFile));602+ if (!mimeType) return null;603+ const file = yield* openMediaFile(canonicalFile, claims).pipe(apps/server/src/assets/MediaFile.ts line 78OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +58,21 @@58+ if ((await NodeFSP.realpath(filePath)) !== filePath) return null;59+ const after = await NodeFSP.lstat(filePath, { bigint: true });60+ if (!after.isFile() || info.dev !== after.dev || info.ino !== after.ino) return null;61+ accepted = true;62+ return { handle, info } satisfies OpenMediaFile;63+ } finally {64+ if (!accepted) await handle.close();65+ }66+ },67+ catch: (cause) => new MediaFileOpenError({ path: filePath, cause }),68+ }),69+ (file) => (file ? Effect.promise(() => file.handle.close()) : Effect.void),70+ );71+});72+73+export const streamMediaFile = (file: OpenMediaFile, offset: bigint, bytesToRead: bigint) =>74+ NodeStream.fromReadable<Uint8Array>({75+ evaluate: () =>76+ file.handle.createReadStream({77+ autoClose: false,78+ start: Number(offset),apps/web/src/components/ChatMarkdown.tsx lines 2472 to 2472Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -2232,3 +2389,7 @@22322389 handleMarkdownFragmentClick(event, href);22332390 return;22342391 }2392+ if (2393+ href &&2394+ /^https?:\/\//i.test(href) &&2395+ mediaKindFromPath(href) !== null &&
- apps/web/src/components/chat/ExpandedImageDialog.tsx lines 147 to 150OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -123,11 +132,19 @@132+ {openOriginalLink}123133 </div>124134 ) : item.type === "video" ? (125135 <video126136 src={item.src}127137 aria-label={item.name}128- autoPlay138+ autoPlay={item.autoPlay ?? true}139+ preload="metadata"129140 controls130141 playsInline142+ onLoadedMetadata={(event) => prepareVideoFirstFrame(event.currentTarget)}131143 onError={() => setFailedVideoSrc(item.src)}132- className="max-h-[86vh] max-w-[92vw] rounded-lg border border-border/70 bg-black object-contain shadow-2xl"144+ className="aspect-video max-h-[86vh] w-[min(92vw,64rem)] rounded-lg border border-border/70 bg-black object-contain shadow-2xl"133145 />146+ ) : failedImageSrc === item.src ? (147+ <div148+ role="alert"149+ className="flex h-48 w-[min(92vw,32rem)] flex-col items-center justify-center gap-3 rounded-lg bg-black px-6 text-center text-sm text-white/80"150+ >
- apps/server/src/http.ts line 154OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -138,8 +142,13 @@138142 readonly download?: boolean;139143 readonly fileName?: string;140144 readonly mimeType?: string;145+ readonly file?: OpenMediaFile;141146 },142147 rangeHeader?: string,143148 ifRangeHeader?: string,149+ method: "GET" | "HEAD" = "GET",144150 ) {145151 const headers = assetResponseHeaders(asset.path, asset);152+ const mediaFile = asset.file;153+ const mediaInfo = mediaFile154+ ? yield* Effect.tryPromise(() => mediaFile.handle.stat({ bigint: true }))
- apps/web/src/components/ChatMarkdown.tsx lines 1262 to 1263OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1222,0 +1243,21 @@1243+ readonly src: string | null;1244+ readonly alt: string;1245+ readonly copyMarkdown: string | undefined;1246+ readonly originalUrl?: string | undefined;1247+ readonly sourceFailed?: boolean | undefined;1248+ readonly style?: CSSProperties | undefined;1249+ readonly mediaIdentity?: string | undefined;1250+ readonly onRetry?: (() => Promise<void>) | undefined;1251+ readonly onImageExpand?: ((preview: ExpandedImagePreview) => void) | undefined;1252+}) {1253+ return (1254+ <MediaVideoPlayer1255+ key={props.mediaIdentity ?? props.copyMarkdown ?? props.src}1256+ src={props.src}1257+ sourceFailed={props.sourceFailed}1258+ label={props.alt}1259+ originalUrl={props.originalUrl}1260+ style={props.style}1261+ copyMarkdown={props.copyMarkdown}1262+ className="inline-block! w-full max-w-[30rem]"1263+ videoClassName="max-h-[30rem] rounded-lg border border-border/40"
- @@ -159,11 +170,14 @@159170 if (range?._tag === "Range") {160- return yield* HttpServerResponse.file(asset.path, {161- status: 206,162- offset: range.offset,163- bytesToRead: range.bytesToRead,164- headers: { ...headers, "Content-Range": range.contentRange },165- });171+ status = 206;172+ offset = range.offset;173+ bytesToRead = range.bytesToRead;174+ headers["Content-Range"] = range.contentRange;166175 }167176 }168177 }169- return yield* HttpServerResponse.file(asset.path, { status: 200, headers });178+ if (mediaFile && mediaInfo) {179+ const size = bytesToRead ?? mediaInfo.size;180+ headers["Content-Type"] ??= Mime.getType(asset.path) ?? "application/octet-stream";181+ headers["Content-Length"] = String(size);182+ headers["Last-Modified"] = mediaInfo.mtime.toUTCString();183+ headers.ETag = `W/"${mediaInfo.size.toString(16)}-${mediaInfo.mtimeMs.toString(16)}"`;
- @@ -0,0 +5,21 @@5+import { prepareVideoFirstFrame } from "../../lib/videoFirstFrame";6+import { Button } from "../ui/button";7+import { OpenOriginalMediaLink } from "./OpenOriginalMediaLink";8+9+interface MediaVideoPlayerProps {10+ readonly src: string | null;11+ readonly label: string;12+ readonly sourceFailed?: boolean | undefined;13+ readonly originalUrl?: string | undefined;14+ readonly revision?: string | null | undefined;15+ readonly preload?: "visible" | "metadata" | undefined;16+ readonly className?: string | undefined;17+ readonly videoClassName?: string | undefined;18+ readonly style?: CSSProperties | undefined;19+ readonly copyMarkdown?: string | undefined;20+ readonly onExpand?: ((src: string) => void) | undefined;21+ readonly onRetry?: (() => Promise<void>) | undefined;22+}23+24+/** Keeps native range streaming and playback state consistent across inline and file previews. */25+export function MediaVideoPlayer({
- @@ -0,0 +17,21 @@17+18+class MediaFileStatError extends Schema.TaggedErrorClass<MediaFileStatError>()(19+ "MediaFileStatError",20+ {21+ path: Schema.String,22+ cause: Schema.Defect(),23+ },24+) {}25+26+/** Holds the file identity and descriptor for one HTTP request, never a copy of its bytes. */27+export interface OpenMediaFile {28+ readonly handle: NodeFSP.FileHandle;29+ readonly info: NodeFS.BigIntStats;30+}31+32+/** Opens a canonical media path once. Replacements cannot change the response's source. */33+export const openMediaFile = Effect.fn("openMediaFile")(function* (34+ filePath: string,35+ identity?: { readonly device: string; readonly inode: string },36+) {37+ return yield* Effect.acquireRelease(@@ -399,3 +412,11 @@399412 href: /^(?:mailto|tel):/i.test(normalized) ? normalized : null,400413 };401414 }415+416+/** Backticks become file references only when the shared path heuristic recognizes the whole span. */417+export function resolveMarkdownInlineCodePresentation(418+ content: string,419+): Extract<MarkdownLinkPresentation, { readonly kind: "file" }> | null {420+ const candidate = inlineCodeFilePathCandidate(content);421+ if (candidate === null) return null;422+ const presentation = resolveMarkdownLinkPresentation(candidate);
- apps/server/src/assets/MediaFile.ts lines 10 to 24OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +4,21 @@4+import * as NodeFSP from "node:fs/promises";5+6+import * as NodeStream from "@effect/platform-node/NodeStream";7+import * as Effect from "effect/Effect";8+import * as Schema from "effect/Schema";9+10+class MediaFileOpenError extends Schema.TaggedErrorClass<MediaFileOpenError>()(11+ "MediaFileOpenError",12+ {13+ path: Schema.String,14+ cause: Schema.Defect(),15+ },16+) {}17+18+class MediaFileStatError extends Schema.TaggedErrorClass<MediaFileStatError>()(19+ "MediaFileStatError",20+ {21+ path: Schema.String,22+ cause: Schema.Defect(),23+ },24+) {}
- apps/web/src/components/files/FilePreviewPanel.tsx lines 182 to 191OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -159,11 +179,13 @@159179 }160180161181 return assetUrl._tag === "Success" && imageUrl !== null ? (162- <div className="flex min-h-0 flex-1 items-center justify-center overflow-auto p-4">163- <img164- className="max-h-full max-w-full object-contain"165- src={imageUrl}166- alt={props.alt}167- onError={() => setFailedUrl(imageUrl)}168- />169- </div>182+ <MediaActions source={actionsSource}>183+ <div className="flex min-h-0 flex-1 items-center justify-center overflow-auto p-4">184+ <img185+ className="max-h-full max-w-full object-contain"186+ src={imageUrl}187+ alt={props.alt}188+ onError={() => setFailedUrl(imageUrl)}189+ />190+ </div>191+ </MediaActions>
- apps/web/src/components/media/MediaActions.tsx line 107Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +87,21 @@87+ const tooltip = reference?.kind === "file" ? reference.path : (reference?.url ?? source.name);88+89+ const showMenu = async (position: { x: number; y: number }) => {90+ const api = readLocalApi();91+ if (!api || menuOpen.current) return;92+ menuOpen.current = true;93+ setTooltipOpen(false);94+ let failureTitle = "Could not open media menu";95+ let progressToast: ReturnType<typeof toastManager.add> | undefined;96+ try {97+ const items: ContextMenuItem<MediaAction>[] = [];98+ if (reference?.kind === "file") {99+ items.push({ id: "copy-full", label: "Copy full path" });100+ if (reference.relativePath)101+ items.push({ id: "copy-relative", label: "Copy relative path" });102+ } else if (reference?.kind === "url") {103+ items.push({ id: "copy-url", label: "Copy URL" });104+ }105+ if (source.kind === "image") {106+ const unavailable = source.src === null && source.asset === undefined;107+ items.push({ id: "save", label: "Save image", disabled: unavailable });
- apps/web/src/components/media/MediaActions.tsx line 169Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +149,21 @@149+ else toastManager.add(toast);150+ } finally {151+ menuOpen.current = false;152+ }153+ };154+155+ return (156+ <Tooltip open={tooltipOpen} onOpenChange={setTooltipOpen}>157+ <TooltipTrigger158+ render={children}159+ tabIndex={0}160+ onContextMenu={(event) => {161+ if (!hasActions || event.defaultPrevented) return;162+ event.preventDefault();163+ event.stopPropagation();164+ const bounds = event.currentTarget.getBoundingClientRect();165+ void showMenu(166+ event.clientX === 0 && event.clientY === 0167+ ? { x: bounds.left, y: bounds.bottom }168+ : { x: event.clientX, y: event.clientY },169+ );
- @@ -2595,18 +2562,4 @@2595- return;2596- }2597-2598- const url = resolveAssetUrl(connection.httpBaseUrl, result.value.relativeUrl);2599- if (!url) {2600- finishVideoPreviewRequest();2601- toastManager.add({ type: "error", title: "Could not " + action + " " + attachment.name });2602- return;2603- }2604- if (isVideo) {2605- try {2606- const previewUrl = await loadVideoPreviewUrl(url, videoPreviewAbortController?.signal);2607- if (!isCurrentRequest()) {2608- revokeBlobPreviewUrl(previewUrl);2609- return;2610- }2562+ if (!isCurrentRequest()) return;2563+ if (isVideo) {26112564 setExpandedImage({2612- images: [{ src: previewUrl, name: attachment.name, type: "video" }],2565+ images: [{ src: url, name: attachment.name, type: "video" }],
- apps/web/src/components/chat/ExpandedImagePreview.tsx line 81OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -14,0 +61,21 @@61+ const name = path.split(/[\\/]/).at(-1) ?? "";62+ const extensionIndex = name.lastIndexOf(".");63+ const fileMimeType =64+ extensionIndex < 0 ? null : mediaMimeTypeFromExtension(name.slice(extensionIndex));65+ const kind =66+ source._tag === "Direct"67+ ? mediaKindFromPath(source.uri)68+ : fileMimeType === null69+ ? null70+ : fileMimeType.startsWith("video/")71+ ? "video"72+ : "image";73+ if (kind === null) return null;74+75+ const reference =76+ source._tag === "Direct" ? mediaUrlReference(source.uri) : mediaFileReference(path, input.cwd);77+ const relativePath = reference?.kind === "file" ? reference.relativePath : undefined;78+ let src: string;79+ let asset: MediaActionSource["asset"];80+ if (source._tag === "Direct") {81+ src = source.uri;
- apps/web/src/components/chat/ExpandedImageDialog.tsx line 143OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -146,0 +123,21 @@123+ onClick={onClose}124+ aria-label={`Close ${mediaLabel} preview`}125+ >126+ <XIcon />127+ </Button>128+ {item.type === "video" && failedVideoSrc === item.src ? (129+ <ExpandedMediaFailure>130+ <p>This video could not be loaded or played.</p>131+ <OpenMediaLink originalUrl={item.originalUrl} src={item.src} fileName={item.name} />132+ </ExpandedMediaFailure>133+ ) : item.type === "video" ? (134+ <video135+ src={item.src}136+ aria-label={item.name}137+ autoPlay={item.autoPlay ?? true}138+ preload="metadata"139+ controls140+ playsInline141+ onLoadedMetadata={(event) => prepareVideoFirstFrame(event.currentTarget)}142+ onError={() => setFailedVideoSrc(item.src)}143+ className="aspect-video max-h-[86vh] w-[min(92vw,64rem)] rounded-lg border border-border/70 bg-black object-contain shadow-2xl"
juliusmarminge merged thisbeae214
juliusmarminge closed this
Sign in to join this conversation.


































Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline:
60cef47· PR result:0977bfc· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.