From 560106bdd59f1c0dcc269a5283f86b07ac31260a Mon Sep 17 00:00:00 2001 From: tiisetso Date: Tue, 20 Oct 2026 09:15:35 +0200 Subject: [PATCH 1/7] fix(ci): run PR checks on GitHub-hosted runners Replace unavailable Blacksmith labels with ubuntu-24.04 and windows-2025 for PR tests and duplicate checks. Preserve every job, matrix entry and command while allowing this fork's queued checks to start. --- .github/workflows/pr-management.yml | 2 +- .github/workflows/test.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-management.yml b/.github/workflows/pr-management.yml index b6aa4e589d..ecb1c7b72d 100644 --- a/.github/workflows/pr-management.yml +++ b/.github/workflows/pr-management.yml @@ -6,7 +6,7 @@ on: jobs: check-duplicates: - runs-on: blacksmith-4vcpu-ubuntu-2404 + runs-on: ubuntu-24.04 permissions: contents: read pull-requests: write diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d004db4658..c1c8f491ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ env: jobs: affected: name: affected packages - runs-on: blacksmith-4vcpu-ubuntu-2404 + runs-on: ubuntu-24.04 outputs: app: ${{ steps.packages.outputs.app }} steps: @@ -58,9 +58,9 @@ jobs: matrix: settings: - name: linux - host: blacksmith-4vcpu-ubuntu-2404 + host: ubuntu-24.04 - name: windows - host: blacksmith-4vcpu-windows-2025 + host: windows-2025 runs-on: ${{ matrix.settings.host }} defaults: run: @@ -178,9 +178,9 @@ jobs: matrix: settings: - name: linux - host: blacksmith-4vcpu-ubuntu-2404 + host: ubuntu-24.04 - name: windows - host: blacksmith-4vcpu-windows-2025 + host: windows-2025 runs-on: ${{ matrix.settings.host }} env: E2E_ENABLED: ${{ needs.affected.outputs.app == 'true' && github.ref_name != 'dev' && github.head_ref != 'dev' }} From 65b4da5b81bad5599741416e86d334289f6fc2ac Mon Sep 17 00:00:00 2001 From: tiisetso Date: Tue, 20 Oct 2026 09:35:40 +0200 Subject: [PATCH 2/7] fix(ci): repair V2 desktop test prerequisites and Windows fixtures --- .gitattributes | 3 +++ .github/workflows/test.yml | 4 +++ packages/desktop/electron.vite.config.test.ts | 2 +- packages/desktop/package.json | 2 +- .../main/browser/download-recovery-data.ts | 13 ++++++++-- .../src/main/macos-user-install.test.ts | 25 ++++++++++--------- 6 files changed, 33 insertions(+), 16 deletions(-) diff --git a/.gitattributes b/.gitattributes index 9f43f6095a..d575062b44 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,6 @@ packages/core/src/database/migration.gen.ts linguist-generated packages/core/src/models-dev/snapshot.txt linguist-generated packages/core/src/**/*.txt text eol=lf packages/httpapi-codegen/test/generated/*.ts text eol=lf + +# Preserve the audited bytes of the vendored CookieJar bundle on Windows. +packages/desktop/vendor/cm-ae/** -text diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1c8f491ea..449236f274 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,6 +84,10 @@ jobs: if: runner.os == 'Linux' run: bun run test:effect-simplification-rules + - name: Install Electron for desktop runtime tests + working-directory: packages/desktop + run: node node_modules/electron/install.js + - name: Check Effect simplifications if: runner.os == 'Linux' run: bun run lint:effect-simplifications diff --git a/packages/desktop/electron.vite.config.test.ts b/packages/desktop/electron.vite.config.test.ts index bde2052332..b66b4b77ca 100644 --- a/packages/desktop/electron.vite.config.test.ts +++ b/packages/desktop/electron.vite.config.test.ts @@ -39,7 +39,7 @@ test("minifies only builds, previews onboarding only in development, and ships s process.env.OPENCODE_CLI_TARGET = item.target const main = (await load("build")).config.main expect(main?.build?.externalizeDeps).toEqual({ - exclude: bundled, + exclude: ["@cookiemonster/wpp", ...bundled], include: [nodePtyPackage(item.target)], }) } diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 9f5cca8ce0..730a008ae2 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -11,7 +11,7 @@ }, "scripts": { "typecheck": "tsgo -b", - "test": "bun test --timeout 30000", + "test": "bun test --preload ./test/preload.ts --timeout 30000", "dev": "bun ./scripts/dev.ts", "migration": "bun ./scripts/migration.ts", "prebuild": "bun ./scripts/prebuild.ts", diff --git a/packages/desktop/src/main/browser/download-recovery-data.ts b/packages/desktop/src/main/browser/download-recovery-data.ts index d8a77b8dcf..8a3b66f1d5 100644 --- a/packages/desktop/src/main/browser/download-recovery-data.ts +++ b/packages/desktop/src/main/browser/download-recovery-data.ts @@ -1,6 +1,6 @@ import { createHash, randomUUID } from "node:crypto" import { constants } from "node:fs" -import { open, mkdir, unlink, stat, copyFile } from "node:fs/promises" +import { open, mkdir, unlink, stat, lstat, copyFile } from "node:fs/promises" import { basename, dirname, extname, isAbsolute, join } from "node:path" import { physicalDownloadPath } from "./download-path" @@ -218,7 +218,16 @@ export async function publishDownload( return destination } catch (error) { - if (!error || typeof error !== "object" || !("code" in error) || error.code !== "EEXIST") throw error + if (!error || typeof error !== "object" || !("code" in error)) throw error + if (error.code === "EEXIST") continue + // Windows reports an existing directory as EPERM rather than EEXIST. + if ( + process.platform === "win32" && + error.code === "EPERM" && + (await lstat(destination).catch(() => undefined))?.isDirectory() + ) + continue + throw error } } diff --git a/packages/desktop/src/main/macos-user-install.test.ts b/packages/desktop/src/main/macos-user-install.test.ts index 51002ca8df..4ccb9fe908 100644 --- a/packages/desktop/src/main/macos-user-install.test.ts +++ b/packages/desktop/src/main/macos-user-install.test.ts @@ -113,7 +113,8 @@ test("confirmation, failure handling and lock handoff precede launch", async () } }) -test("replaces the whole app, retains the previous bundle and preserves unrelated data", async () => { +// These filesystem fixtures require POSIX directory handles and permissions. +test.skipIf(process.platform === "win32")("replaces the whole app, retains the previous bundle and preserves unrelated data", async () => { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source", "CookieMonster.app") const applications = join(root, "Applications With Spaces") @@ -151,7 +152,7 @@ test("replaces the whole app, retains the previous bundle and preserves unrelate } }) -test("moves read-only bundle roots and restores their modes without changing the source", async () => { +test.skipIf(process.platform === "win32")("moves read-only bundle roots and restores their modes without changing the source", async () => { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source") const destination = join(root, "CookieMonster.app") @@ -208,7 +209,7 @@ test("moves read-only bundle roots and restores their modes without changing the } }) -test("backup cleanup is best-effort and retries after a later successful replacement", async () => { +test.skipIf(process.platform === "win32")("backup cleanup is best-effort and retries after a later successful replacement", async () => { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source") const destination = join(root, "CookieMonster.app") @@ -269,7 +270,7 @@ test("backup cleanup is best-effort and retries after a later successful replace } }) -test("pruning leaves unowned, changed, symlinked and unrelated backup candidates alone", async () => { +test.skipIf(process.platform === "win32")("pruning leaves unowned, changed, symlinked and unrelated backup candidates alone", async () => { for (const change of [ "unmarked", "extra", @@ -365,7 +366,7 @@ test("pruning leaves unowned, changed, symlinked and unrelated backup candidates } }) -test("backup ownership-write failure leaves older backups without failing the published install", async () => { +test.skipIf(process.platform === "win32")("backup ownership-write failure leaves older backups without failing the published install", async () => { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source") const destination = join(root, "CookieMonster.app") @@ -409,7 +410,7 @@ test("backup ownership-write failure leaves older backups without failing the pu } }) -test("failed staging, moves, permission cleanup and recovery never prune completed backups", async () => { +test.skipIf(process.platform === "win32")("failed staging, moves, permission cleanup and recovery never prune completed backups", async () => { for (const failure of ["staging", "backup", "publication", "recovery", "chmod", "close"]) { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source") @@ -513,7 +514,7 @@ test("failed staging, moves, permission cleanup and recovery never prune complet } }) -test("backup handle cleanup failures restore the moved app before reporting failure", async () => { +test.skipIf(process.platform === "win32")("backup handle cleanup failures restore the moved app before reporting failure", async () => { for (const failure of ["chmod", "close"]) { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source") @@ -578,7 +579,7 @@ test("backup handle cleanup failures restore the moved app before reporting fail } }) -test("publication handle cleanup failures retain the complete new app and any previous backup", async () => { +test.skipIf(process.platform === "win32")("publication handle cleanup failures retain the complete new app and any previous backup", async () => { for (const existing of [false, true]) { for (const failure of ["chmod", "close"]) { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) @@ -649,7 +650,7 @@ test("publication handle cleanup failures retain the complete new app and any pr } }) -test("permission and move failures are not masked by mode restoration or handle close failures", async () => { +test.skipIf(process.platform === "win32")("permission and move failures are not masked by mode restoration or handle close failures", async () => { for (const failure of ["chmod", "rename"]) { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source") @@ -711,7 +712,7 @@ test("permission and move failures are not masked by mode restoration or handle } }) -test("failed staging copies leave the installed app intact and can be retried", async () => { +test.skipIf(process.platform === "win32")("failed staging copies leave the installed app intact and can be retried", async () => { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source") const destination = join(root, "CookieMonster.app") @@ -796,7 +797,7 @@ test("rejects self-replacement and destinations changed while copying", async () } }) -test("concurrent first installs publish only one complete bundle", async () => { +test.skipIf(process.platform === "win32")("concurrent first installs publish only one complete bundle", async () => { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source") const destination = join(root, "CookieMonster.app") @@ -823,7 +824,7 @@ test("concurrent first installs publish only one complete bundle", async () => { } }) -test("publication failures restore the old app or retain its backup without overwriting concurrent data", async () => { +test.skipIf(process.platform === "win32")("publication failures restore the old app or retain its backup without overwriting concurrent data", async () => { for (const scenario of ["restore", "restore-fails", "concurrent-destination"]) { const root = await mkdtemp(join(tmpdir(), "cm-install-test-")) const source = join(root, "Source") From 65618da109b0ed345380ab43c75548ea63c9f470 Mon Sep 17 00:00:00 2001 From: tiisetso Date: Tue, 20 Oct 2026 09:51:33 +0200 Subject: [PATCH 3/7] fix(ci): install browser prerequisites and preserve visible effort coverage --- .github/actions/setup-bun/action.yml | 2 +- .github/workflows/test.yml | 15 ++++++++++++++- packages/app/e2e/regression/composer.spec.ts | 12 ++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index 013b334b56..77c608d432 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -20,7 +20,7 @@ runs: - name: Setup Node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: "24" + node-version: "24.15" - name: Get baseline download URL id: bun-url diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 449236f274..c011ed17ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -86,7 +86,20 @@ jobs: - name: Install Electron for desktop runtime tests working-directory: packages/desktop - run: node node_modules/electron/install.js + run: node -e "require(require.resolve('electron/install.js'))" + + - name: Install Chromium for browser unit tests + working-directory: packages/app + run: bunx playwright install --with-deps chromium + + - name: Install ripgrep for offline core tests + run: | + if [ "$RUNNER_OS" = "Linux" ]; then + sudo apt-get update + sudo apt-get install -y ripgrep + else + choco install ripgrep --yes --no-progress + fi - name: Check Effect simplifications if: runner.os == 'Linux' diff --git a/packages/app/e2e/regression/composer.spec.ts b/packages/app/e2e/regression/composer.spec.ts index 87fe50661d..652fae7188 100644 --- a/packages/app/e2e/regression/composer.spec.ts +++ b/packages/app/e2e/regression/composer.spec.ts @@ -455,7 +455,7 @@ test("marks a Console provider with its workspace only when it is also connected await expect(menu.getByText(/Anomaly \//)).toHaveCount(0) }) -test("shows thinking on hover or a non-default selection while preserving keyboard access", async ({ page }) => { +test("keeps the effort picker visible while preserving selection and keyboard access", async ({ page }) => { const { editor: input } = await openSession(page, { name: "ComposerThinking", provider: provider({ id: "thinking-model", name: "Thinking Model", variants: { high: {} } }), @@ -467,13 +467,13 @@ test("shows thinking on hover or a non-default selection while preserving keyboa await page.mouse.move(0, 0) await expect(control).toHaveText("default") - await expect(control).toHaveCSS("opacity", "0") - await expect(control).toHaveCSS("pointer-events", "none") + await expect(control).toHaveCSS("opacity", "1") + await expect(control).toHaveCSS("pointer-events", "auto") await input.hover() await expect(control).toHaveCSS("opacity", "1") - // The menu keeps the control visible after the pointer leaves. + // The control stays visible while its menu is open. await control.click() await expect(option("high")).toBeVisible() await page.mouse.move(0, 0) @@ -491,7 +491,7 @@ test("shows thinking on hover or a non-default selection while preserving keyboa await input.click() await page.mouse.move(0, 0) await expect(control).toHaveText("default") - await expect(control).toHaveCSS("opacity", "0") + await expect(control).toHaveCSS("opacity", "1") // The single-agent fixture has only Add and Model before the thinking trigger. await page.keyboard.press("Tab") @@ -507,5 +507,5 @@ test("shows thinking on hover or a non-default selection while preserving keyboa await page.keyboard.press("Escape") await expect(control).toBeFocused() await page.keyboard.press("Tab") - await expect(control).toHaveCSS("opacity", "0") + await expect(control).toHaveCSS("opacity", "1") }) From 98b57d5349e7ce36805df08013f839d6a9b62320 Mon Sep 17 00:00:00 2001 From: tiisetso Date: Tue, 20 Oct 2026 10:19:13 +0200 Subject: [PATCH 4/7] chore(ci): serialize workspace unit checks --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c011ed17ea..06d0abc5a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,12 +122,12 @@ jobs: - name: Run unit tests timeout-minutes: 20 run: | - # The runners have four vCPUs, and each Bun test process performs its own concurrent work. + # Each package creates concurrent work; serialize packages to bound hosted process pressure. if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - GITHUB_ACTIONS=false bun turbo test --concurrency=3 + GITHUB_ACTIONS=false bun turbo test --concurrency=1 exit 0 fi - GITHUB_ACTIONS=false bun turbo test --affected --concurrency=3 + GITHUB_ACTIONS=false bun turbo test --affected --concurrency=1 env: OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }} TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && format('{0}^1', github.sha) || github.event.before }} From bfb11aa3a58d6aff0b58c6eb2f05c1462d7ef82e Mon Sep 17 00:00:00 2001 From: tiisetso Date: Tue, 20 Oct 2026 11:37:39 +0200 Subject: [PATCH 5/7] test(app): repair session preview prerequisites --- packages/app/e2e/regression/whats-new.spec.ts | 5 ++++- packages/app/src/session/session-screen.stories.tsx | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/app/e2e/regression/whats-new.spec.ts b/packages/app/e2e/regression/whats-new.spec.ts index 9e91bb5170..f08f5e367a 100644 --- a/packages/app/e2e/regression/whats-new.spec.ts +++ b/packages/app/e2e/regression/whats-new.spec.ts @@ -219,7 +219,10 @@ async function serveChangelog(page: Page, body: typeof changelog | typeof cliOnl async function start(page: Page, seed: SeedInput) { await mockWorkspace(page, { name: "Whats New", sessions: [], seed }) await page.goto("/") - await expectAppVisible(page.getByRole("button", { name: "Settings", exact: true })) + // The startup dialog may already hide the shell from accessibility queries. + await expectAppVisible( + page.getByRole("button", { name: "Settings", exact: true, includeHidden: true }).filter({ visible: true }), + ) } function stored(page: Page, key: string) { diff --git a/packages/app/src/session/session-screen.stories.tsx b/packages/app/src/session/session-screen.stories.tsx index 9b47241bec..0c5d746a9b 100644 --- a/packages/app/src/session/session-screen.stories.tsx +++ b/packages/app/src/session/session-screen.stories.tsx @@ -15,6 +15,8 @@ import { terminalPassedDocument, } from "@opencode/session-ui/storybook" import { SessionPreview } from "./story-model" +import { SettingsProvider } from "@/settings/model" +import type { JSX } from "solid-js" const description = "opencode ยท modular-session-ui" @@ -51,6 +53,13 @@ export default { title: "OpenCode/Session/Complete workspace", id: "app-current-session-surface", component: SessionPreview, + decorators: [ + (Story: () => JSX.Element) => ( + + + + ), + ], parameters: { layout: "fullscreen", docs: { From 33f140626c718e5bdd5827cd3572e017cbd090f6 Mon Sep 17 00:00:00 2001 From: tiisetso Date: Tue, 20 Oct 2026 12:42:43 +0200 Subject: [PATCH 6/7] fix(cli): use Node retries for smoke cleanup --- packages/cli/script/build-node.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/cli/script/build-node.ts b/packages/cli/script/build-node.ts index f7c64eeddc..566c797f76 100644 --- a/packages/cli/script/build-node.ts +++ b/packages/cli/script/build-node.ts @@ -155,7 +155,7 @@ for (const target of targets) { )}\n`, ) await verifyArtifact(path.join(outdir, name)) - if (host) await smoke(output) + if (host) await smoke(output, builder) } async function resolveHostNode() { @@ -225,14 +225,20 @@ async function resolveTargetNode(target: NodeTarget, host?: string) { return realpath(executable) } -async function smoke(output: string) { +async function smoke(output: string, node: string) { const root = await mkdtemp(path.join(os.tmpdir(), "opencode-node-smoke-")) const executable = path.join(root, path.basename(output)) await copyFile(output, executable) if (process.platform !== "win32") await chmod(executable, 0o755) run(executable, ["--version"], root) run(executable, ["--help"], root) - await rm(root, { recursive: true, force: true }) + // Use Node's retry-aware cleanup for transient Windows directory locks. + run(node, [ + "--input-type=module", + "-e", + "import { rm } from 'node:fs/promises'; await rm(process.argv[1], { recursive: true, force: true, maxRetries: 10, retryDelay: 100 })", + root, + ]) } function targetName(target: NodeTarget) { From 4e0e1af8dfcd9c0e6562a42f0a790e1d6c7d5c4e Mon Sep 17 00:00:00 2001 From: tiisetso Date: Tue, 20 Oct 2026 12:42:43 +0200 Subject: [PATCH 7/7] fix(storybook): resolve dependencies across layouts --- packages/storybook/.storybook/main.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/storybook/.storybook/main.ts b/packages/storybook/.storybook/main.ts index f7fc034e7a..688dbb5bb1 100644 --- a/packages/storybook/.storybook/main.ts +++ b/packages/storybook/.storybook/main.ts @@ -34,14 +34,12 @@ export default defineMain({ const { mergeConfig, searchForWorkspaceRoot } = await import("vite") const merged = mergeConfig(config, { plugins: [tailwindcss(), playgroundCss()], + // The previous directory alias kept Solid Query unbundled. + optimizeDeps: { exclude: ["@tanstack/solid-query"] }, resolve: { - dedupe: ["solid-js", "solid-js/web", "@solidjs/meta"], + dedupe: ["solid-js", "solid-js/web", "@solidjs/meta", "@tanstack/solid-query"], alias: [ { find: "@solidjs/router", replacement: path.resolve(mocks, "solid-router.tsx") }, - { - find: "@tanstack/solid-query", - replacement: path.resolve(here, "../../app/node_modules/@tanstack/solid-query"), - }, { find: /^@\/providers\/models\/selection$/, replacement: path.resolve(mocks, "app/context/local.ts") }, { find: /^@\/workspaces\/files\/model$/, replacement: path.resolve(mocks, "app/context/file.ts") }, { find: /^@\/shell\/state\/layout$/, replacement: path.resolve(mocks, "app/context/layout.ts") },