From f6e0c2d0833ffe772035f221fed923e1cd5fb408 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 13 Nov 2026 09:21:28 -0600 Subject: [PATCH 01/12] refactor(ai): ignore video sound on models that can't switch it (#63726) --- packages/ai/README.md | 14 ++++++++------ .../src/protocols/google-interactions-video.ts | 5 ----- packages/ai/src/protocols/minimax-video.ts | 7 ++----- packages/ai/test/generation.test.ts | 4 +++- .../ai/test/google-interactions-video.test.ts | 12 ++++++++++-- packages/ai/test/minimax-video.test.ts | 18 ++++++++++++------ 6 files changed, 35 insertions(+), 25 deletions(-) diff --git a/packages/ai/README.md b/packages/ai/README.md index db73e71af7c0..8231abb1a633 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -1087,7 +1087,9 @@ const program = Effect.gen(function* () { The shared fields are `prompt`, `start`, `end`, `references`, `duration`, `aspect`, `resolution` and `sound`; everything else is provider-specific and goes under `providerOptions`, typed from the selected model. A request only -fails before sending when its protocol has no way to express it, such as a reference video on xAI. Values the provider +fails before sending when its protocol has no way to express it, such as a reference video on xAI. `sound` is the +exception: on models whose sound can't be switched (MiniMax H3 and Gemini Omni always have it, Hailuo never does) it +isn't sent, and the model's own behavior applies. Values the provider may reject, like an unsupported duration or too many references, go to the provider, and its error comes back typed. `start` and `end` are images. They take a URL, data URL, base64 string or bytes, or an asset built with @@ -1131,11 +1133,11 @@ Provider notes: `/v1`, and a bare host (`https://api.minimax.io`) works as is. On H3, `start`, `end` and `references` become `content[]` items with `first_frame`, `last_frame` and `reference_image` / `reference_video` / `reference_audio` roles, MiniMax file refs become `mm_file://` URLs, `aspect: "auto"` becomes `ratio: "adaptive"`, and `resolution` is uppercased (`480P`, `2K`). H3 requires `resolution` and `duration`, plus a - `ratio` for text-only prompts; nothing is filled in, so MiniMax rejects a request without them. H3 always has sound, - so `sound: false` fails before sending. On Hailuo, `start` and `end` map to `first_frame_image` and + `ratio` for text-only prompts; nothing is filled in, so MiniMax rejects a request without them. H3 always has sound + and has no field for it, so `sound` isn't sent. On Hailuo, `start` and `end` map to `first_frame_image` and `last_frame_image`, image references to `subject_reference`, and the result looks up the file's download URL, which - expires after one hour. Hailuo is silent and has no aspect field, so `sound: true`, an explicit `aspect`, and video - or audio references fail before sending. Cancel works on H3 (only while queued); Hailuo has no cancel. Native fields + expires after one hour. Hailuo is always silent, so `sound` isn't sent; it has no aspect field, so an explicit + `aspect` and video or audio references fail before sending. Cancel works on H3 (only while queued); Hailuo has no cancel. Native fields such as `extra.prompt_expansion_mode` (H3), `prompt_optimizer` (Hailuo) and `callback_url` go under `providerOptions`. - **Google** (`Google.video("gemini-omni-1.2-flash")`) starts a background Gemini Omni interaction. Omni has no role field for media, so `start`, `end` and `references` go into `input` in that order (images, plus video @@ -1143,7 +1145,7 @@ Provider notes: `reference_to_video` for references only; with both, the prompt decides. `duration` becomes `response_format.duration` (`"3s"`), and `aspect` and `resolution` go to `response_format` as is (resolution lowercased); `aspect: "auto"` leaves the ratio out. It rejects `end` without `start` (a lone image reads as the - first frame) and `sound: false` (Omni always generates audio). Videos come back as inline bytes. `cancel` posts to + first frame). Omni always generates audio and has no field for it, so `sound` isn't sent. Videos come back as inline bytes. `cancel` posts to `/interactions/{id}/cancel`. `providerOptions` takes native Interactions fields, such as `previous_interaction_id` to edit or extend a generated video, `generation_config.video_config.task`, `service_tier` and `webhook_config`. diff --git a/packages/ai/src/protocols/google-interactions-video.ts b/packages/ai/src/protocols/google-interactions-video.ts index 79c81433c5e2..0f61c6a597c5 100644 --- a/packages/ai/src/protocols/google-interactions-video.ts +++ b/packages/ai/src/protocols/google-interactions-video.ts @@ -129,11 +129,6 @@ const task = (request: Request) => { const fromRequest = Effect.fn("GoogleInteractionsVideo.fromRequest")(function* (request: Request) { if (request.end !== undefined && request.start === undefined) return yield* route.unsupported("video.end", `${route.name} reads a lone image as the start frame; send start too`) - if (request.sound === false) - return yield* route.unsupported( - "video.sound", - `${route.name} always generates audio and has no option to turn it off`, - ) const media = yield* Effect.forEach( [request.start, request.end, ...(request.references ?? [])].filter( (asset): asset is Media.Asset => asset !== undefined, diff --git a/packages/ai/src/protocols/minimax-video.ts b/packages/ai/src/protocols/minimax-video.ts index fe45f999608d..aab982336fec 100644 --- a/packages/ai/src/protocols/minimax-video.ts +++ b/packages/ai/src/protocols/minimax-video.ts @@ -177,9 +177,7 @@ const reference = (asset: Media.Asset) => const resolution = (request: Request) => request.resolution?.toUpperCase() const fromRequest = Effect.fn("MiniMaxVideo.fromRequest")(function* (request: Request) { - // H3 always generates a soundtrack and has no field to turn it off. - if (request.sound === false) - return yield* route.unsupported("video.sound", `${route.name} always generates sound and can't be silenced`) + // H3 always generates a soundtrack and has no field for `sound`, so it isn't sent. const content = [ { type: "text", text: request.prompt }, ...(request.start === undefined ? [] : [yield* item(request.start, "first_frame")]), @@ -213,8 +211,7 @@ const hailuoFromRequest = Effect.fn("MiniMaxHailuoVideo.fromRequest")(function* `${hailuoRoute.name} takes only image (subject) references`, ) // Hailuo output is always silent and its shape follows the model or the first frame, with no field for either. - if (request.sound === true) - return yield* hailuoRoute.unsupported("video.sound", `${hailuoRoute.name} generates silent video only`) + // `sound` has nothing to send, so it isn't; an aspect ratio would change the shape the caller asked for. if (request.aspect !== undefined && request.aspect !== "auto") return yield* hailuoRoute.unsupported("video.aspect", `${hailuoRoute.name} has no aspect ratio input`) const subjects = yield* Effect.forEach(references, (asset) => diff --git a/packages/ai/test/generation.test.ts b/packages/ai/test/generation.test.ts index 90eda9f3a632..e89222573b38 100644 --- a/packages/ai/test/generation.test.ts +++ b/packages/ai/test/generation.test.ts @@ -97,7 +97,9 @@ describe("Generation", () => { const generation = new Generation(route, "t", { id: "gen_1", status: "queued" }) const fiber = yield* Effect.forkChild( - generation.events({ poll: { interval: "1 second", timeout: "5 seconds" } }).pipe(Stream.runCollect, Effect.flip), + generation + .events({ poll: { interval: "1 second", timeout: "5 seconds" } }) + .pipe(Stream.runCollect, Effect.flip), ) yield* TestClock.adjust("6 seconds") const error = yield* Fiber.join(fiber) diff --git a/packages/ai/test/google-interactions-video.test.ts b/packages/ai/test/google-interactions-video.test.ts index 4aabcbaf4f0a..a57253f7f7f9 100644 --- a/packages/ai/test/google-interactions-video.test.ts +++ b/packages/ai/test/google-interactions-video.test.ts @@ -101,7 +101,9 @@ describe("ai.video.start / Google Interactions", () => { model, prompt: "Morph", start: Media.image(Media.fromDataUrl("data:image/png;base64,AQID")), - end: Media.image(Media.ref("google", "https://generativelanguage.googleapis.com/v1beta/files/last", "image/jpeg")), + end: Media.image( + Media.ref("google", "https://generativelanguage.googleapis.com/v1beta/files/last", "image/jpeg"), + ), }) expect(body.input).toEqual([ { type: "image", data: "AQID", mime_type: "image/png" }, @@ -147,9 +149,15 @@ describe("ai.video.start / Google Interactions", () => { }), ) + it.effect("sends nothing for sound, since Omni always generates audio and has no field for it", () => + Effect.gen(function* () { + const silent = yield* sent({ model, prompt: "x", sound: false }) + expect(JSON.stringify(silent.body)).not.toContain("audio") + }), + ) + for (const rejected of [ { name: "an end frame without a start frame", input: { end: "data:image/png;base64,AQID" }, operation: "end" }, - { name: "silent video", input: { sound: false }, operation: "sound" }, ]) it.effect(`rejects ${rejected.name}, which Omni has no way to send, before sending`, () => Effect.gen(function* () { diff --git a/packages/ai/test/minimax-video.test.ts b/packages/ai/test/minimax-video.test.ts index 7434dcd76481..514458e913c7 100644 --- a/packages/ai/test/minimax-video.test.ts +++ b/packages/ai/test/minimax-video.test.ts @@ -136,12 +136,19 @@ describe("MiniMax Video / H3 start", () => { }), ) - it.effect("rejects silent output, which H3 can't produce, before sending", () => + it.effect("sends nothing for sound, which neither API has a field for", () => Effect.gen(function* () { - const error = yield* ai.video.start({ model: h3, prompt: "x", sound: false }).pipe(Effect.flip) - expect(error.reason._tag).toBe("UnsupportedOperation") - expect(error.message).toContain("always generates sound") - }).pipe(Effect.provide(layer(() => Effect.die("an unsupported request reached the network")))), + const requests = yield* sent([ + { model: h3, sound: false }, + { model: h3, sound: true }, + { model: hailuo, sound: true }, + ]) + expect(requests.map((request) => "generate_audio" in request.body || "sound" in request.body)).toEqual([ + false, + false, + false, + ]) + }), ) it.effect("returns MiniMax's HTTP errors typed", () => @@ -242,7 +249,6 @@ describe("MiniMax Video / Hailuo start", () => { request: { references: [Media.url("https://example.test/v.mp3", { mediaType: "audio/mpeg" })] }, tag: "UnsupportedOperation", }, - { name: "sound", request: { sound: true }, tag: "UnsupportedOperation" }, { name: "an aspect ratio", request: { aspect: "16:9" as const }, tag: "UnsupportedOperation" }, { name: "a MiniMax file reference", request: { start: Media.ref("minimax", "file_1") }, tag: "InvalidRequest" }, ]) { From b3c1936a977f71fc93907241ef12438c39c60434 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:30:12 -0600 Subject: [PATCH 02/12] fix(core): enforce default read limits for small text files (#63810) --- packages/core/src/tool/read-filesystem.ts | 21 ++++++--- .../core/test/tool-read-filesystem.test.ts | 44 +++++++++++++++++++ 2 files changed, 58 insertions(+), 7 deletions(-) diff --git a/packages/core/src/tool/read-filesystem.ts b/packages/core/src/tool/read-filesystem.ts index 11930dcba8a5..98962a9ee54b 100644 --- a/packages/core/src/tool/read-filesystem.ts +++ b/packages/core/src/tool/read-filesystem.ts @@ -155,13 +155,20 @@ export const read = Effect.fn("ReadTool.read")(function* ( const paged = first.info.size > MAX_READ_BYTES || page.offset !== undefined || page.limit !== undefined if (!paged) { if (first.bytes.includes(0)) return yield* new BinaryFileError({ resource }) - return { - type: "file" as const, - uri: virtual ? resource : pathToFileURL(input).href, - name: virtual ? path.posix.basename(input) : path.basename(input), - content: new TextDecoder().decode(first.bytes).split("\n").map(clampLine).join("\n"), - encoding: "utf8" as const, - mime: mimeType(input), + const lines = new TextDecoder().decode(first.bytes).split("\n") + // A final separator ends the last physical line; keep it in whole-file content. + const count = lines.at(-1) === "" ? lines.length - 1 : lines.length + if (count <= MAX_READ_LINES) { + const content = lines.map(clampLine).join("\n") + if (Buffer.byteLength(content) <= MAX_READ_BYTES) + return { + type: "file" as const, + uri: virtual ? resource : pathToFileURL(input).href, + name: virtual ? path.posix.basename(input) : path.basename(input), + content, + encoding: "utf8" as const, + mime: mimeType(input), + } } } diff --git a/packages/core/test/tool-read-filesystem.test.ts b/packages/core/test/tool-read-filesystem.test.ts index f4997f9b4b27..7b32291646fa 100644 --- a/packages/core/test/tool-read-filesystem.test.ts +++ b/packages/core/test/tool-read-filesystem.test.ts @@ -112,6 +112,50 @@ describe("ReadTool text serialization", () => { }) describe("ReadToolFileSystem", () => { + it.live("applies the default line limit to small files at physical line boundaries", () => + Effect.gen(function* () { + const { environment, files, directory } = yield* fixture + const file = absolute(path.join(directory, "dense.txt")) + const read = (page?: ReadToolFileSystem.PageInput) => ReadToolFileSystem.read(environment, file, "dense.txt", page) + const prefix = "x\r\n".repeat(1_999) + for (const ending of ["last", "last\n", "last\r\n", "\n"]) { + const content = prefix + ending + yield* files.writeFileString(file, content) + expect(yield* read()).toMatchObject({ type: "file", content }) + } + + yield* files.writeFileString(file, prefix + "\r\nlast") + const page = yield* read() + expect(page.type).toBe("text-page") + if (page.type !== "text-page") return + expect(page).toMatchObject({ content: "x\n".repeat(1_999), offset: 1, next: 2_001, truncated: true }) + expect(ReadTool.toModelContent("dense.txt", undefined, page)).toEndWith( + "2000: \n[Output truncated. Continue reading with offset: 2001]", + ) + expect(yield* read({ offset: page.next })).toMatchObject({ content: "last", offset: 2_001, truncated: false }) + }), + ) + + it.live("applies the byte limit to the returned content of small files", () => + Effect.gen(function* () { + const { environment, files, directory } = yield* fixture + const file = absolute(path.join(directory, "bytes.txt")) + const read = () => ReadToolFileSystem.read(environment, file, "bytes.txt") + const exact = ("é".repeat(799) + "x\n").repeat(32) + yield* files.writeFileString(file, exact) + expect(yield* read()).toMatchObject({ type: "file", content: exact }) + + // Each truncation marker takes more bytes than the one character it replaces. + yield* files.writeFileString(file, ("x".repeat(2_001) + "\n").repeat(25) + "é".repeat(500)) + const page = yield* read() + expect(page.type).toBe("text-page") + if (page.type !== "text-page") return + expect(page).toMatchObject({ offset: 1, next: 26, truncated: true }) + expect(page.content.split("\n")).toHaveLength(25) + expect(Buffer.byteLength(page.content)).toBeLessThanOrEqual(50 * 1024) + }), + ) + it.effect("preserves the environment not-found error", () => Effect.gen(function* () { const { environment, directory } = yield* fixture From 2396f7b9729c1b2b5ef8bfd28cdc87717fe97bf6 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:33:53 -0600 Subject: [PATCH 03/12] fix(core): preserve a single blank line in paged reads (#63809) --- packages/core/src/tool/plugin/read.ts | 3 ++- packages/core/src/tool/read-filesystem.ts | 2 ++ .../core/test/tool-read-filesystem.test.ts | 25 +++++++++++++++++-- packages/core/test/tool-read.test.ts | 2 ++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/packages/core/src/tool/plugin/read.ts b/packages/core/src/tool/plugin/read.ts index f0b04931e627..3d71d12fd657 100644 --- a/packages/core/src/tool/plugin/read.ts +++ b/packages/core/src/tool/plugin/read.ts @@ -348,7 +348,8 @@ export const toModelContent = (path: string, offset: number | undefined, output: const start = output.type === "text-page" ? output.offset : 1 // Pages already join selected lines; a trailing newline represents a selected blank line. const text = output.type === "file" ? output.content.replace(/\n$/, "") : output.content - const lines = output.content === "" ? [] : text.split("\n") + const empty = output.type === "text-page" ? output.lineCount === 0 : output.content === "" + const lines = empty ? [] : text.split("\n") // A page that starts before the requested offset is the file's tail, returned for an offset past the end. const total = start + lines.length - 1 const pastEnd = output.type === "text-page" && offset !== undefined && start < offset diff --git a/packages/core/src/tool/read-filesystem.ts b/packages/core/src/tool/read-filesystem.ts index 98962a9ee54b..444379e5c715 100644 --- a/packages/core/src/tool/read-filesystem.ts +++ b/packages/core/src/tool/read-filesystem.ts @@ -82,6 +82,7 @@ export type FileContent = typeof FileContent.Type export class TextPage extends Schema.Class("ReadTool.TextPage")({ type: Schema.Literal("text-page"), content: Schema.String, + lineCount: NonNegativeInt, mime: Schema.String, offset: PositiveInt, truncated: Schema.Boolean, @@ -332,6 +333,7 @@ const textPage = Effect.fnUntraced(function* ( return new TextPage({ type: "text-page", content: entries.join("\n"), + lineCount: entries.length, mime: mimeType(input), offset: from, truncated: next !== undefined, diff --git a/packages/core/test/tool-read-filesystem.test.ts b/packages/core/test/tool-read-filesystem.test.ts index 7b32291646fa..2e413f6f5831 100644 --- a/packages/core/test/tool-read-filesystem.test.ts +++ b/packages/core/test/tool-read-filesystem.test.ts @@ -90,9 +90,30 @@ describe("ReadTool text serialization", () => { name: "preserves empty-file page output", content: "", page: { limit: 2 }, - output: { type: "text-page", content: "", offset: 1, truncated: false }, + output: { type: "text-page", content: "", lineCount: 0, offset: 1, truncated: false }, model: "Read file lines.txt, 0 lines", }, + { + name: "numbers the only blank line in a newline-only file", + content: "\n", + page: { limit: 1 }, + output: { type: "text-page", content: "", lineCount: 1, offset: 1, truncated: false }, + model: "Read file lines.txt, lines 1-1\n1: ", + }, + { + name: "numbers a single blank line before continuation", + content: "alpha\n\nomega\n", + page: { offset: 2, limit: 1 }, + output: { type: "text-page", content: "", lineCount: 1, offset: 2, truncated: true, next: 3 }, + model: "Read file lines.txt, lines 2-2\n2: \n[Output truncated. Continue reading with offset: 3]", + }, + { + name: "counts the last blank line when an offset is past EOF", + content: "alpha\n\n", + page: { offset: 9, limit: 1 }, + output: { type: "text-page", content: "", lineCount: 1, offset: 2, truncated: false }, + model: "Read file lines.txt, lines 2-2 (offset 9 is past the end; the file has 2 lines)\n2: ", + }, ] cases.forEach((input) => { @@ -105,7 +126,7 @@ describe("ReadTool text serialization", () => { const result = yield* ReadToolFileSystem.read(current.environment, file, "lines.txt", input.page) expect(result).toMatchObject(input.output) - expect(ReadTool.toModelContent("lines.txt", undefined, result)).toBe(input.model) + expect(ReadTool.toModelContent("lines.txt", input.page.offset, result)).toBe(input.model) }), ) }) diff --git a/packages/core/test/tool-read.test.ts b/packages/core/test/tool-read.test.ts index 48ad4f76140c..e969ba5c51fe 100644 --- a/packages/core/test/tool-read.test.ts +++ b/packages/core/test/tool-read.test.ts @@ -1130,6 +1130,7 @@ describe("ReadTool", () => { readResult = new ReadToolFileSystem.TextPage({ type: "text-page", content: "hello", + lineCount: 1, mime: "text/plain", offset: 2, truncated: true, @@ -1170,6 +1171,7 @@ describe("ReadTool", () => { readResult = new ReadToolFileSystem.TextPage({ type: "text-page", content: "nine\nten", + lineCount: 2, mime: "text/plain", offset: 9, truncated: true, From c523434e363003ca171d47f4614c2972f944e352 Mon Sep 17 00:00:00 2001 From: Dax Date: Fri, 13 Nov 2026 12:40:07 -0500 Subject: [PATCH 04/12] test: isolate submenu timing, server config and terminal colors (#63803) --- packages/app/e2e/regression/tabs.spec.ts | 3 +++ packages/server/test/schema-error.test.ts | 3 +++ packages/server/test/session-diff.test.ts | 1 + packages/tui/test/component/go-upsell-art.test.tsx | 2 ++ 4 files changed, 9 insertions(+) diff --git a/packages/app/e2e/regression/tabs.spec.ts b/packages/app/e2e/regression/tabs.spec.ts index 5ef9ed996d9d..dddb9d25374a 100644 --- a/packages/app/e2e/regression/tabs.spec.ts +++ b/packages/app/e2e/regression/tabs.spec.ts @@ -1874,6 +1874,9 @@ test("the Windows titlebar menu swaps one submenu for the next as the pointer mo const parents = ["File", "Edit", "View"].map((name) => page.getByRole("menuitem", { name, exact: true })) const submenus = page.locator('[role="menu"].desktop-app-menu-sub') + // Keep the hover delay from elapsing while Playwright moves the pointer and checks the old submenu. + await holdClock(page) + for (const [index, parent] of parents.entries()) { const box = (await parent.boundingBox())! // Down and to the left, away from the open submenu, so the pointer isn't heading for it. diff --git a/packages/server/test/schema-error.test.ts b/packages/server/test/schema-error.test.ts index b0f9c213960b..fb65c5cde463 100644 --- a/packages/server/test/schema-error.test.ts +++ b/packages/server/test/schema-error.test.ts @@ -2,6 +2,7 @@ import { expect } from "bun:test" import { Generate } from "@opencode/core/generate" import { makeLocationNode } from "@opencode/util/effect/app-node" import { Effect, Layer } from "effect" +import { tmpdirScoped } from "../../core/test/fixture/tmpdir" import { it } from "../../core/test/lib/effect" import { ServerFetch } from "../src/fetch" @@ -21,8 +22,10 @@ const generate = makeLocationNode({ it.live("reports response encoding failures as server errors and request decoding failures as bad requests", () => Effect.gen(function* () { + const config = yield* tmpdirScoped() const handler = yield* ServerFetch.make( { + config: { directory: config.path, project: false }, database: { path: ":memory:" }, fs: { filewatcher: false }, models: { fetch: false }, diff --git a/packages/server/test/session-diff.test.ts b/packages/server/test/session-diff.test.ts index bafcfa07b263..e822acd4e358 100644 --- a/packages/server/test/session-diff.test.ts +++ b/packages/server/test/session-diff.test.ts @@ -55,6 +55,7 @@ it.live("serves turn diffs by user message with range validation", () => const handler = yield* ServerFetch.make( { app: { version: "test-version" }, + config: { directory: tmp.path, project: false }, database: { path: ":memory:" }, fs: { filewatcher: false }, models: { fetch: false }, diff --git a/packages/tui/test/component/go-upsell-art.test.tsx b/packages/tui/test/component/go-upsell-art.test.tsx index 28f8c6e5e99e..834518350587 100644 --- a/packages/tui/test/component/go-upsell-art.test.tsx +++ b/packages/tui/test/component/go-upsell-art.test.tsx @@ -1,6 +1,7 @@ import { expect, spyOn, test } from "bun:test" /** @jsxImportSource @opentui/solid */ import { OptimizedBuffer, RGBA } from "@opentui/core" +import { setRendererCapabilities } from "@opentui/core/testing" import { testRender } from "@opentui/solid" import { createSignal, Show } from "solid-js" import "../../src/component/go-upsell-art" @@ -38,6 +39,7 @@ test("the art stops every frame when hidden, closed, or still, and leaves nothin const setCell = spyOn(OptimizedBuffer.prototype, "setCell") try { + setRendererCapabilities(app.renderer, { rgb: false }) await app.renderOnce() expect(app.renderer.liveRequestCount).toBe(1) // Each frame is one direct write into the art's own buffer, never a draw call per cell. From f0f41c01642521d7b636fe5f223b21f303d758d0 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:41:46 -0600 Subject: [PATCH 05/12] chore(perf): bench with strobe 0.37.0 (#63812) --- bun.lock | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bun.lock b/bun.lock index c613ca97fd77..11fb8eb1bf27 100644 --- a/bun.lock +++ b/bun.lock @@ -1025,7 +1025,7 @@ "@effect/platform-node-shared": "4.1.0", "@effect/sql-sqlite-bun": "4.1.0", "@effect/sql-sqlite-node": "4.1.0", - "@hona/strobe": "0.36.0", + "@hona/strobe": "0.37.0", "@kobalte/core": "0.13.13", "@lydell/node-pty": "1.2.0-beta.12", "@npmcli/arborist": "9.4.0", @@ -1567,19 +1567,19 @@ "@happy-dom/global-registrator": ["@happy-dom/global-registrator@20.0.11", "", { "dependencies": { "@types/node": "^20.0.0", "happy-dom": "^20.0.11" } }, "sha512-GqNqiShBT/lzkHTMC/slKBrvN0DsD4Di8ssBk4aDaVgEn+2WMzE6DXxq701ndSXj7/0cJ8mNT71pM7Bnrr6JRw=="], - "@hona/strobe": ["@hona/strobe@0.36.0", "", { "optionalDependencies": { "@hona/strobe-darwin-arm64": "0.36.0", "@hona/strobe-darwin-x64": "0.36.0", "@hona/strobe-linux-arm64": "0.36.0", "@hona/strobe-linux-x64": "0.36.0", "@hona/strobe-win32-arm64": "0.36.0", "@hona/strobe-win32-x64": "0.36.0" }, "bin": { "strobe": "bin/strobe.js" } }, "sha512-TcisD2luf5y6R6RQuzTtL1NanqUzqYV2IV8IFr7Q1SIEtgGb4ueeMWPyvNfS9aQ8FSy6u9YpAZiWDoIUA6PrhQ=="], + "@hona/strobe": ["@hona/strobe@0.37.0", "", { "optionalDependencies": { "@hona/strobe-darwin-arm64": "0.37.0", "@hona/strobe-darwin-x64": "0.37.0", "@hona/strobe-linux-arm64": "0.37.0", "@hona/strobe-linux-x64": "0.37.0", "@hona/strobe-win32-arm64": "0.37.0", "@hona/strobe-win32-x64": "0.37.0" }, "bin": { "strobe": "bin/strobe.js" } }, "sha512-6M7W4YxcnioURhVJQtcdIEoFFO4L+Bkcbln1iEMI0MhVJbWELYJgHFWsbAAWw/nXAF6pN5b/AJ/N/fY35WkOCQ=="], - "@hona/strobe-darwin-arm64": ["@hona/strobe-darwin-arm64@0.36.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-2fglraB9DfmrF0x92IEsv/0u6zgZ0oPmLmkmh6deGWKa+B5BD+m2BsCYaCxUrHrmHwrkA8OWG1UfS3Y0fi/HEQ=="], + "@hona/strobe-darwin-arm64": ["@hona/strobe-darwin-arm64@0.37.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-800o9jgsoIBvu/uYyr3qPV8BdtNAr2bQUb8StFSrcwA/h/B+dtLdOubWmwSaL18YoFd3dAwUlWqmxeipAlWH3w=="], - "@hona/strobe-darwin-x64": ["@hona/strobe-darwin-x64@0.36.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-QBD1ejheS/cgy8kFuE9osdCpcOSUxEYh7dTeixDulvzmX+2qCua2AwajFPBS668I1PCbsbwYpUnqpcp9SC5sNg=="], + "@hona/strobe-darwin-x64": ["@hona/strobe-darwin-x64@0.37.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-zZiUoM290+vo+ePcZUsO0nx8F3OSrbAzFX1xhu3OiX+HT5AWagRfIR6/HyFd+k10zDS0rXlYxeudNOMqiM0xbA=="], - "@hona/strobe-linux-arm64": ["@hona/strobe-linux-arm64@0.36.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-SJxTyskt5iCfklNVbRnCxL5jyjtspiV54T8eI+B6Y+qJJ9dk2FGlP/y/YfSkZF1w1N+v1rdKComfZatO5nkpSw=="], + "@hona/strobe-linux-arm64": ["@hona/strobe-linux-arm64@0.37.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-NA5K+7y4qha3PbjdLoIIzB4wz139gFi4X4g8iTS+vWGIaAob0d+6XygU5TndPyMLAZrSDfvgWqcqCQhsVwxPWg=="], - "@hona/strobe-linux-x64": ["@hona/strobe-linux-x64@0.36.0", "", { "os": "linux", "cpu": "x64" }, "sha512-q/brYo1wrqij/rtCMKjK3gVpknncCsulZ+DjrFdW+5dh/cBbWRnuJKV1c3BEYQmXI+/puesqTktV5d3xGlXTpg=="], + "@hona/strobe-linux-x64": ["@hona/strobe-linux-x64@0.37.0", "", { "os": "linux", "cpu": "x64" }, "sha512-jRluj2WV+nkmO9fDpQ4Iw53NkczBsAB9aDWimBkWVLz5BW7RjZSuDT613iMDLXAAiWQJAYE6pZfMjfQnWz5HlQ=="], - "@hona/strobe-win32-arm64": ["@hona/strobe-win32-arm64@0.36.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-10FFkPuZZg9mg4cEY13SSMeliQuJBTVsAaQrv9jYOgmaw0JBYwKo9J/g7iZ81ohLBcNf9tYEeFVPZpgWWbCMYQ=="], + "@hona/strobe-win32-arm64": ["@hona/strobe-win32-arm64@0.37.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-RdFuMZUT38P954klZVNludyDnGNpK+bfbmDkEFKvTmNlFuqvaZ4ARDV2gTmNjlOBAW+xurXAr/16GhTgtXG93Q=="], - "@hona/strobe-win32-x64": ["@hona/strobe-win32-x64@0.36.0", "", { "os": "win32", "cpu": "x64" }, "sha512-fRaQX2P0xL+DKj6pzDwJj7StZgUMgRWl2x0mvC13+5uF3yuPbse/3+eF0I/spBNg/q+PuMVrotlXsHO0eFPD6g=="], + "@hona/strobe-win32-x64": ["@hona/strobe-win32-x64@0.37.0", "", { "os": "win32", "cpu": "x64" }, "sha512-BGKwdbo9/bexolOksstSMqc0GtR0hv6fTfCVl0qf+wg5iS90+1QIYOS4gGtKTyDE4bfy66BKgJJoM5rYQmGcJw=="], "@hono/node-server": ["@hono/node-server@2.1.5", "", { "peerDependencies": { "hono": "^4 || ^5.0.0-0" } }, "sha512-MgP/I06GdvsilDspMk/qmRzpk8LOUStP6jFAbSRi40W09DhoyUn+Mj7eyKICPqeYKybOjVFLVIAQzvu1bfIa7Q=="], diff --git a/package.json b/package.json index 7dbf61118137..5e8e01782d6f 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@effect/sql-sqlite-node": "4.1.0", "@npmcli/arborist": "9.4.0", "@types/bun": "1.4.3", - "@hona/strobe": "0.36.0", + "@hona/strobe": "0.37.0", "@types/cross-spawn": "6.0.6", "@octokit/rest": "22.0.0", "@opentui/core": "0.8.4", From 68fd7dd6b3148fed0d88131f64af664731d43c22 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:50:08 -0600 Subject: [PATCH 06/12] fix(core): reject a zero limit on read calls (#63808) --- packages/core/src/tool/plugin/read.ts | 2 ++ packages/core/test/tool-read.test.ts | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/core/src/tool/plugin/read.ts b/packages/core/src/tool/plugin/read.ts index 3d71d12fd657..3d2e729556a3 100644 --- a/packages/core/src/tool/plugin/read.ts +++ b/packages/core/src/tool/plugin/read.ts @@ -53,6 +53,8 @@ export const Plugin = { output: Output, execute: (input, context) => { return Effect.gen(function* () { + if (input.limit === 0) + return yield* new ToolFailure({ message: "Limit must be a positive integer" }) if (Skill.isUri(input.path)) { const parsed = parseSkillUri(input.path) if (!parsed) return yield* new ToolFailure({ message: `File not found: ${input.path}` }) diff --git a/packages/core/test/tool-read.test.ts b/packages/core/test/tool-read.test.ts index e969ba5c51fe..280f539997b8 100644 --- a/packages/core/test/tool-read.test.ts +++ b/packages/core/test/tool-read.test.ts @@ -223,6 +223,23 @@ describe("ReadTool", () => { }), ) + it.effect("rejects a zero limit before reading", () => + Effect.gen(function* () { + const registry = yield* Tool.Service + const result = yield* executeTool(registry, { + sessionID, + ...toolIdentity, + call: { type: "tool-call", id: "call-zero-limit", name: "read", input: { path: "README.md", limit: 0 } }, + }) + expect(result).toMatchObject({ + status: "error", + error: { message: "Limit must be a positive integer" }, + }) + expect(assertions).toEqual([]) + expect(readCalls).toEqual([]) + }), + ) + it.effect("asks for external_directory approval before reading an external absolute path", () => Effect.gen(function* () { const registry = yield* Tool.Service From 48de2e315c496dd95145e6628e3a478c6d038aa2 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:10:25 -0600 Subject: [PATCH 07/12] fix(core): match both six-byte GIF signatures (#63811) --- packages/core/src/mime.ts | 3 +- .../core/test/tool-read-filesystem.test.ts | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/packages/core/src/mime.ts b/packages/core/src/mime.ts index 15f24023fa9d..3424be634dd4 100644 --- a/packages/core/src/mime.ts +++ b/packages/core/src/mime.ts @@ -3,7 +3,8 @@ export * as Mime from "./mime.js" export function detect(bytes: Uint8Array) { if (startsWith(bytes, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])) return "image/png" if (startsWith(bytes, [0xff, 0xd8, 0xff])) return "image/jpeg" - if (startsWith(bytes, [0x47, 0x49, 0x46, 0x38])) return "image/gif" + const signature = ascii(bytes, 0, 6) + if (signature === "GIF87a" || signature === "GIF89a") return "image/gif" if (startsWith(bytes, [0x42, 0x4d])) return "image/bmp" if (startsWith(bytes, [0x25, 0x50, 0x44, 0x46, 0x2d])) return "application/pdf" if (startsWith(bytes, [0x52, 0x49, 0x46, 0x46]) && startsWith(bytes.subarray(8), [0x57, 0x45, 0x42, 0x50])) diff --git a/packages/core/test/tool-read-filesystem.test.ts b/packages/core/test/tool-read-filesystem.test.ts index 2e413f6f5831..fa38fa154b2b 100644 --- a/packages/core/test/tool-read-filesystem.test.ts +++ b/packages/core/test/tool-read-filesystem.test.ts @@ -23,6 +23,13 @@ const absolute = (value: string) => AbsolutePath.make(value) describe("ReadTool text serialization", () => { const cases = [ + { + name: "reads a partial GIF signature as text", + content: "GIF8 is text", + page: {}, + output: { type: "file", content: "GIF8 is text", encoding: "utf8" }, + model: "Read file lines.txt, lines 1-1\n1: GIF8 is text", + }, { name: "preserves a selected trailing blank line before continuation", content: "alpha\n\nomega\n", @@ -177,6 +184,30 @@ describe("ReadToolFileSystem", () => { }), ) + it.live("reads extensionless and renamed GIFs as images", () => + Effect.gen(function* () { + const { environment, files, directory } = yield* fixture + for (const [version, name] of [ + ["GIF87a", "pixel"], + ["GIF89a", "pixel.txt"], + ]) { + // 1x1 screen, black/white palette, one pixel and trailer. + const bytes = Buffer.concat([ + Buffer.from(version), + Buffer.from("01000100800000000000ffffff2c00000000010001000002024401003b", "hex"), + ]) + const file = absolute(path.join(directory, name)) + yield* files.writeFile(file, bytes) + expect(yield* ReadToolFileSystem.read(environment, file, name)).toMatchObject({ + type: "file", + mime: "image/gif", + encoding: "base64", + content: bytes.toString("base64"), + }) + } + }), + ) + it.effect("preserves the environment not-found error", () => Effect.gen(function* () { const { environment, directory } = yield* fixture From 0b7a1a04e6ea82dcac8777dacb881bab7ac52436 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:22:53 -0600 Subject: [PATCH 08/12] refactor(core): skip the text MIME scan when checking for media (#63823) --- packages/core/src/mime.ts | 6 +++++- packages/core/src/tool/plugin/image-generate.ts | 7 ++++--- packages/core/src/tool/read-filesystem.ts | 4 ++-- packages/core/test/mime.test.ts | 9 +++++++++ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/core/src/mime.ts b/packages/core/src/mime.ts index 3424be634dd4..31338268aa40 100644 --- a/packages/core/src/mime.ts +++ b/packages/core/src/mime.ts @@ -1,6 +1,10 @@ export * as Mime from "./mime.js" export function detect(bytes: Uint8Array) { + return detectMedia(bytes) ?? (isText(bytes) ? "text/plain" : "application/octet-stream") +} + +export function detectMedia(bytes: Uint8Array) { if (startsWith(bytes, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])) return "image/png" if (startsWith(bytes, [0xff, 0xd8, 0xff])) return "image/jpeg" const signature = ascii(bytes, 0, 6) @@ -29,7 +33,7 @@ export function detect(bytes: Uint8Array) { if (brand === "M4A ") return "audio/mp4" return "video/mp4" } - return isText(bytes) ? "text/plain" : "application/octet-stream" + return undefined } export const isTextual = (mime: string) => diff --git a/packages/core/src/tool/plugin/image-generate.ts b/packages/core/src/tool/plugin/image-generate.ts index 726e35c9b395..adff3d106303 100644 --- a/packages/core/src/tool/plugin/image-generate.ts +++ b/packages/core/src/tool/plugin/image-generate.ts @@ -198,8 +198,8 @@ export const Plugin = { return yield* new ToolFailure({ message: `${source} is larger than 20 MiB.` }) return (yield* environment.files.read(target.absolute)).bytes }) - const mime = Mime.detect(bytes) - if (!INPUT_TYPES.includes(mime)) + const mime = Mime.detectMedia(bytes) + if (!mime || !INPUT_TYPES.includes(mime)) return yield* new ToolFailure({ message: `${source} is not a PNG, JPEG, WebP or GIF image.` }) return { data: Buffer.from(bytes).toString("base64"), mime, name: path.basename(source) } }) @@ -314,7 +314,8 @@ export const Plugin = { const image = result.images[0] if (!image) return yield* Effect.fail(new Error(`${ref} returned no image.`)) const bytes = Buffer.from(image.data, "base64") - const file = stem + (EXTENSIONS[Mime.detect(bytes)] ?? ".png") + const mime = Mime.detectMedia(bytes) + const file = stem + (EXTENSIONS[mime ?? "image/png"] ?? ".png") // The edit prompt covered the requested path. Replacing a different existing file needs its own // approval; a new file only has to pass the deny rules. if (target && file !== target.absolute) { diff --git a/packages/core/src/tool/read-filesystem.ts b/packages/core/src/tool/read-filesystem.ts index 444379e5c715..5f1a91dd3d21 100644 --- a/packages/core/src/tool/read-filesystem.ts +++ b/packages/core/src/tool/read-filesystem.ts @@ -138,8 +138,8 @@ export const read = Effect.fn("ReadTool.read")(function* ( ) if (first instanceof ListPage) return first - const media = Mime.detect(first.bytes) - if (MEDIA_MIMES.has(media)) { + const media = Mime.detectMedia(first.bytes) + if (media && MEDIA_MIMES.has(media)) { if (first.info.size > MAX_MEDIA_INGEST_BYTES) return yield* new MediaIngestLimitError({ resource, maximumBytes: MAX_MEDIA_INGEST_BYTES }) const whole = yield* readFile(files, input, resource) diff --git a/packages/core/test/mime.test.ts b/packages/core/test/mime.test.ts index a63f19005120..efe65b4b254b 100644 --- a/packages/core/test/mime.test.ts +++ b/packages/core/test/mime.test.ts @@ -4,6 +4,15 @@ import { Mime } from "@opencode/core/mime" const ftyp = (hex: string) => Uint8Array.from(Buffer.from(hex, "hex")) describe("Mime.detect", () => { + test.each([ + [Uint8Array.of(65), "text/plain"], + [Uint8Array.of(0xff), "application/octet-stream"], + [Uint8Array.of(0xe2, 0x82), "text/plain"], // A sample may end inside a UTF-8 character. + ] as const)("leaves samples without media headers to the text fallback: %j", (bytes, mime) => { + expect(Mime.detectMedia(bytes)).toBeUndefined() + expect(Mime.detect(bytes)).toBe(mime) + }) + test("tells ISO-BMFF brands apart", () => { expect(Mime.detect(ftyp("000000206674797061766966000000004d695072617669666d6961666d696631"))).toBe("image/avif") expect(Mime.detect(ftyp("000000186674797061766973000000006d73663161766973"))).toBe("image/avif") From 083e3114a563c09a7521d6f183ff54a0f985c0c8 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:23:47 -0600 Subject: [PATCH 09/12] feat(app): find in side panel previews (#63663) --- .../app/e2e/regression/side-panels.spec.ts | 81 ++++ .../gui-plugins/src/file/artifact-view.css | 9 + .../gui-plugins/src/file/artifact-view.tsx | 9 +- packages/gui-plugins/src/file/find.tsx | 376 ++++++++++++++++++ packages/gui-plugins/src/file/view.tsx | 16 +- 5 files changed, 485 insertions(+), 6 deletions(-) create mode 100644 packages/gui-plugins/src/file/find.tsx diff --git a/packages/app/e2e/regression/side-panels.spec.ts b/packages/app/e2e/regression/side-panels.spec.ts index 25de38130772..b58082aa29c8 100644 --- a/packages/app/e2e/regression/side-panels.spec.ts +++ b/packages/app/e2e/regression/side-panels.spec.ts @@ -387,3 +387,84 @@ test("the new tab view lists recently closed tabs, expands to the rest, and keep await expect(rows.first()).toContainText("closed-00.ts") await expect(recent).not.toContainText("README.md") }) + +test("Mod+F finds in Markdown and HTML previews with the code view's find bar", async ({ page }) => { + await page.setViewportSize({ width: 1440, height: 900 }) + const directory = "C:/OpenCode/PreviewFind" + const key = `local\u0000${base64Encode(directory)}/ses_previewfind` + + const files = new Map([ + ["notes.md", "# Needle notes\n\nOne needle here.\n\nAnother **needle** there."], + ["diagram.mmd", "flowchart TD\n A[First needle] --> B[Last needle]"], + [ + "page.html", + "\nPage

First needle

Last needle

", + ], + ]) + + await openSession(page, { + name: "PreviewFind", + fileList: () => [], + fileContent: (path) => ({ type: "text", content: files.get(path.split("/").at(-1) ?? "") ?? "" }), + seed: { + panes: { ses_previewfind: { review: true } }, + storage: { + "opencode.global.dat:layout": { + sessionTabs: { + [key]: { all: ["file://notes.md", "file://diagram.mmd", "file://page.html"], active: "file://notes.md" }, + }, + }, + }, + }, + }) + + const side = page.locator('[data-pane-content="side"]') + const find = page.getByRole("textbox", { name: "Find" }) + const mod = await page.evaluate(() => (/(Mac|iPod|iPhone|iPad)/.test(navigator.platform) ? "Meta" : "Control")) + await side.getByText("One needle here.").click() + await page.keyboard.press(`${mod}+f`) + await expect(find).toBeFocused() + await find.fill("needle") + await expect(page.getByText("1/3", { exact: true })).toBeVisible() + await find.press("Enter") + await expect(page.getByText("2/3", { exact: true })).toBeVisible() + await find.press("Shift+Enter") + await find.press("Shift+Enter") + await expect(page.getByText("3/3", { exact: true })).toBeVisible() + await find.press("Escape") + await expect(find).toHaveCount(0) + + // A closed side panel keeps its preview mounted out of sight, so Mod+F opens no bar there. + const toggle = page.getByRole("button", { name: "Toggle review" }) + await toggle.click() + await expect(side).toBeHidden() + await page.keyboard.press(`${mod}+f`) + await expect(find).toHaveCount(0) + await toggle.click() + + // Mermaid keeps its source in a hidden code block; only the drawn labels count. + await side.getByRole("tab", { name: "diagram.mmd", exact: true }).click() + await side.locator("svg").getByText("First needle").click() + await page.keyboard.press(`${mod}+f`) + await expect(find).toBeFocused() + await find.fill("needle") + await expect(page.getByText("1/2", { exact: true })).toBeVisible() + await find.press("Escape") + await expect(find).toHaveCount(0) + + // The HTML runs in a sandboxed frame; Mod+F pressed inside it still opens the bar. + await side.getByRole("tab", { name: "page.html", exact: true }).click() + const frame = side.frameLocator('iframe[data-file-find="frame"]') + await frame.getByText("First needle").click() + // The find script goes after the doctype, even behind a comment, so the page keeps standards mode. + expect(await frame.locator("html").evaluate(() => document.compatMode)).toBe("CSS1Compat") + await page.keyboard.press(`${mod}+f`) + await expect(find).toBeFocused() + await find.fill("needle") + await expect(page.getByText("1/2", { exact: true })).toBeVisible() + await find.press("Enter") + await expect(page.getByText("2/2", { exact: true })).toBeVisible() + await expect(frame.getByText("Last needle")).toBeInViewport() + await find.press("Escape") + await expect(find).toHaveCount(0) +}) diff --git a/packages/gui-plugins/src/file/artifact-view.css b/packages/gui-plugins/src/file/artifact-view.css index f2625006c070..d60610bbb5b3 100644 --- a/packages/gui-plugins/src/file/artifact-view.css +++ b/packages/gui-plugins/src/file/artifact-view.css @@ -315,3 +315,12 @@ img[data-slot="artifact-media"] { padding: 20px 12px; } } + +/* The same marks as the code view's find. */ +::highlight(file-preview-find) { + background-color: rgb(from var(--surface-warning-base) r g b / 0.35); +} + +::highlight(file-preview-find-current) { + background-color: rgb(from var(--surface-warning-strong) r g b / 0.55); +} diff --git a/packages/gui-plugins/src/file/artifact-view.tsx b/packages/gui-plugins/src/file/artifact-view.tsx index 2f3746c44cee..cf1c725fd74a 100644 --- a/packages/gui-plugins/src/file/artifact-view.tsx +++ b/packages/gui-plugins/src/file/artifact-view.tsx @@ -38,6 +38,7 @@ import { import { FileViewer } from "@opencode/plugin/gui/file" import { uuid } from "@opencode/util/uuid" import { ArtifactToolbar } from "./artifact-toolbar" +import { findableHtml } from "./find" import { createArtifactViewerState, createVideoOverlayState, @@ -148,6 +149,7 @@ export default function ArtifactView(props: {
props.content) + const source = createMediaSource(() => (props.kind === "html" ? findableHtml(props.content) : props.content)) // PDF Open Parameters: start with the thumbnail pane closed and the page fitted to the pane width. const src = () => (props.kind === "pdf" ? `${source().src}#navpanes=0&view=FitH` : source().src) @@ -724,6 +726,7 @@ function ArtifactFrame(props: { path: string; content: FileContent; kind: "pdf"