Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 40 additions & 12 deletions .github/workflows/cookiemonster-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
name: cookiemonster-desktop

# Builds unsigned CookieMonster macOS app-only DMG/zip artifacts; uploads only the validated DMG.
#
# macOS is the sole supported CookieMonster target.
# There is no Apple Developer certificate for this fork, so CM_UNSIGNED=1 strips signing and notarization from
# packages/desktop/electron-builder.config.ts. Installing an unsigned build therefore trips
# Gatekeeper on macOS.
#
# Runs on manual dispatch only. This repository is private on the GitHub Free plan (~2,000 Actions
# minutes/month) and macOS minutes bill at 10x, so an automatic per-push trigger would exhaust the
# monthly allowance quickly. Artifacts expire after 7 days to stay inside the 500 MB cap.
# Builds signed and notarized CookieMonster macOS artifacts; uploads only the validated DMG.
# Runs on manual dispatch only. Artifacts expire after 7 days.

on:
workflow_dispatch:
Expand Down Expand Up @@ -45,7 +37,7 @@ jobs:
# identity, bundled CLI sidecar, and disabled upstream publishing.
OPENCODE_CHANNEL: prod
CM_BRAND: "1"
CM_UNSIGNED: "1"
CM_UNSIGNED: "0"
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
Expand Down Expand Up @@ -75,9 +67,45 @@ jobs:
CM_UNSIGNED: "0"
OPENCODE_CHANNEL: dev

- name: Import Developer ID certificate
uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0
with:
keychain: build
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}

- name: Setup notarization key
env:
APPLE_API_KEY_CONTENT: ${{ secrets.APPLE_API_KEY_PATH }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
run: |
test -n "$APPLE_API_KEY_CONTENT"
test -n "$APPLE_API_KEY_ID"
test -n "$APPLE_API_ISSUER"
umask 077
printf '%s' "$APPLE_API_KEY_CONTENT" > "$RUNNER_TEMP/apple-api-key.p8"

- name: Package installer
run: npx electron-builder --mac --publish never --config electron-builder.config.ts
run: npx electron-builder --mac --publish never --config electron-builder.config.ts -c.forceCodeSigning=true
working-directory: packages/desktop
env:
CSC_KEYCHAIN: build.keychain
APPLE_API_KEY: ${{ runner.temp }}/apple-api-key.p8
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}

- name: Remove notarization key
if: always()
run: rm -f "$RUNNER_TEMP/apple-api-key.p8"

- name: Verify signing and notarization
run: |
for app in packages/desktop/dist/mac*/CookieMonster.app; do
codesign --verify --deep --strict --verbose=2 "$app"
spctl --assess --type execute --verbose=2 "$app"
xcrun stapler validate "$app"
done

- name: List packaged output
run: ls -la packages/desktop/dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nix-eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

jobs:
nix-eval:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ${{ github.repository == 'anomalyco/opencode' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
timeout-minutes: 15
steps:
- name: Checkout repository
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
matrix:
settings:
- name: linux
host: blacksmith-4vcpu-ubuntu-2404
host: ${{ github.repository == 'anomalyco/opencode' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
- name: windows
host: blacksmith-4vcpu-windows-2025
host: ${{ github.repository == 'anomalyco/opencode' && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }}
runs-on: ${{ matrix.settings.host }}
defaults:
run:
Expand All @@ -49,6 +49,10 @@ jobs:
- name: Setup Bun
uses: ./.github/actions/setup-bun

- name: Install Playwright browser
run: bunx playwright install --with-deps chromium
working-directory: packages/app

- name: Configure git identity
run: |
git config --global user.email "bot@opencode.ai"
Expand All @@ -65,7 +69,8 @@ jobs:

- name: Run unit tests
timeout-minutes: 20
run: GITHUB_ACTIONS=false bun turbo test
# Browser builds and full CLI startup otherwise contend on smaller fork runners.
run: GITHUB_ACTIONS=false bun turbo test --concurrency=${{ github.repository == 'anomalyco/opencode' && '10' || '1' }}
env:
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }}

Expand All @@ -86,9 +91,9 @@ jobs:
matrix:
settings:
- name: linux
host: blacksmith-4vcpu-ubuntu-2404
host: ${{ github.repository == 'anomalyco/opencode' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
- name: windows
host: blacksmith-4vcpu-windows-2025
host: ${{ github.repository == 'anomalyco/opencode' && 'blacksmith-4vcpu-windows-2025' || 'windows-2025' }}
runs-on: ${{ matrix.settings.host }}
env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.playwright-browsers
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
typecheck:
runs-on: blacksmith-4vcpu-ubuntu-2404
runs-on: ${{ github.repository == 'anomalyco/opencode' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
Expand Down
2 changes: 2 additions & 0 deletions packages/app/e2e/performance/timeline-stability/fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export async function setupTimeline(
protocol?: "v1" | "v2"
} = {},
) {
if (input.settings?.newLayoutDesigns === false) await page.clock.install({ time: new Date("2026-09-01T10:00:00Z") })
const sessions = input.sessions ?? [session()]
const messages = validateTimelineMessages([
...(input.seedHistory ? historyMessages(18) : []),
Expand Down Expand Up @@ -130,6 +131,7 @@ export async function setupTimeline(
"settings.v3",
JSON.stringify({
general: {
quietCompanion: false,
editToolPartsExpanded: false,
shellToolPartsExpanded: false,
showReasoningSummaries: false,
Expand Down
35 changes: 35 additions & 0 deletions packages/app/e2e/performance/unit/mock-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,38 @@ test("applies message latency after a list response gate is released", async ()
expect(performance.now() - released).toBeGreaterThanOrEqual(20)
expect(events).toEqual(["start", "before", "page", "end", "fulfill"])
})

test("serves current file-search results to the command palette", async () => {
let handler: ((route: Route) => Promise<void>) | undefined
const searches: unknown[] = []
const page = {
route: (_url: string, callback: (route: Route) => Promise<void>) => {
handler = callback
return Promise.resolve()
},
} as unknown as Page
await mockOpenCodeServer(page, {
provider: {},
directory: "C:/OpenCode",
project: { id: "project" },
sessions: [],
pageMessages: () => ({ items: [] }),
findFiles: (input) => {
searches.push(input)
return ["src/index.ts"]
},
})
let response: unknown
await handler!({
request: () => ({ url: () => "http://127.0.0.1:4096/api/fs/find?query=index&type=file&limit=200" }),
fulfill: (input: { body: string }) => {
response = JSON.parse(input.body)
return Promise.resolve()
},
} as unknown as Route)
expect(searches).toEqual([{ query: "index", dirs: "false", limit: 200 }])
expect(response).toEqual({
location: { directory: "C:/OpenCode", project: { id: "project", directory: "C:/OpenCode" } },
data: [{ path: "src/index.ts", type: "file" }],
})
})
43 changes: 30 additions & 13 deletions packages/app/e2e/regression/cm3-live-integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ for (const newLayoutDesigns of [false, true]) {
test(`CM3 Review opens explicitly and reorders like other tabs in ${newLayoutDesigns ? "new" : "legacy"} layout`, async ({
page,
}) => {
await mockStressTimeline(page)
if (!newLayoutDesigns) await page.clock.setFixedTime(new Date("2026-09-01T10:00:00Z"))
await mockOpenCodeServer(page, {
sessions: fixture.sessions.filter((session) => session.id === fixture.sourceID),
provider: fixture.provider,
directory: fixture.directory,
project: fixture.project,
pageMessages,
})
await installStressSessionTabs(page, { sessionIDs: [fixture.sourceID] })
await page.addInitScript((newLayoutDesigns) => {
localStorage.setItem("settings.v3", JSON.stringify({ general: { newLayoutDesigns, quietCompanion: true } }))
Expand All @@ -37,7 +44,7 @@ for (const newLayoutDesigns of [false, true]) {
if (!from || !to) throw new Error("Expected visible Review and Context tabs")
await page.mouse.move(from.x + from.width / 2, from.y + from.height / 2)
await page.mouse.down()
await page.mouse.move(to.x + to.width / 2, to.y + to.height / 2, { steps: 8 })
await page.mouse.move(to.x + to.width - 2, to.y + to.height / 2, { steps: 8 })
await page.mouse.up()
await expect
.poll(() =>
Expand Down Expand Up @@ -890,9 +897,10 @@ test("CM3 landing suggestions edit the real project draft", async ({ page }, tes
})
await page.goto("/new-session?draftId=draft_cm3_live")
await expect(page.locator('[data-cm3-thread="false"]')).toBeVisible()
await expect(page.getByRole("heading", { name: "What should we build in SmokeProject?", exact: true })).toBeVisible()
await expect(page.getByRole("heading", { name: "What should we build in smoke-project?", exact: true })).toBeVisible()
const input = page.locator('[data-component="prompt-input"][contenteditable="true"]')
await expect(input).toHaveCount(1)
await dismissProviderTip(page)
await page.getByRole("button", { name: "Trace a bug", exact: true }).click()
await expect(input).toHaveText("Help me trace a bug. Here is what happened:")
await expect(input).toBeFocused()
Expand Down Expand Up @@ -970,7 +978,7 @@ for (const newLayout of [true, false]) {
await expect(page.locator('[data-cm3-thread="false"]')).toBeVisible()
if (newLayout) {
await expect(
page.getByRole("heading", { name: "What should we build in SmokeProject?", exact: true }),
page.getByRole("heading", { name: "What should we build in smoke-project?", exact: true }),
).toBeVisible()
} else {
const landing = page.locator('[data-component="cm3-legacy-landing"]')
Expand All @@ -979,6 +987,7 @@ for (const newLayout of [true, false]) {
}
const input = page.locator('[data-component="prompt-input"][contenteditable="true"]')
await expect(input).toHaveCount(1)
if (newLayout) await dismissProviderTip(page)
await page.getByRole("button", { name: "Trace a bug", exact: true }).click()
await expect(input).toHaveText("Help me trace a bug. Here is what happened:")
await page.screenshot({ path: testInfo.outputPath(`cm3-landing-dark-${newLayout ? "v2" : "legacy"}.png`) })
Expand Down Expand Up @@ -1007,9 +1016,7 @@ test("CM3 desktop Review and sidebar search use live session state", async ({ pa
const navigation = page.getByRole("complementary", { name: "Projects and sessions", exact: true })
const search = navigation.getByRole("searchbox", { name: "Search threads", exact: true })
await search.fill(fixture.expected.targetTitle)
const target = navigation
.locator(".cm3-sidebar-scroll > .cm3-sidebar-task")
.filter({ hasText: fixture.expected.targetTitle })
const target = navigation.locator('[data-action="project-session"]').filter({ hasText: fixture.expected.targetTitle })
await expect(target).toBeVisible()
await expect(navigation.getByRole("button", { name: fixture.expected.sourceTitle, exact: true })).toHaveCount(0)
await target.click()
Expand Down Expand Up @@ -1130,7 +1137,7 @@ for (const gesture of ["Control", "Meta", "middle"] as const) {
const toggle = page.getByRole("button", { name: "Toggle sidebar", exact: true })
await toggle.click()
await expect(toggle).toHaveAttribute("aria-expanded", "true")
const recent = page.locator(".cm3-sidebar-task").filter({ hasText: fixture.expected.targetTitle })
const recent = page.locator('[data-action="recent-session"]').filter({ hasText: fixture.expected.targetTitle })
await recent.click(gesture === "middle" ? { button: "middle" } : { modifiers: [gesture] })
const tab = page.locator(
`.cm3-sidebar-tabs [data-titlebar-tab-link][href="${stressSessionHref(fixture.targetID)}"]`,
Expand Down Expand Up @@ -1168,25 +1175,28 @@ test("CM3 sidebar search supports arrows, Enter, empty results and composition",
await search.dispatchEvent("keydown", { key: "Enter", isComposing: true })
await expect(search).toBeFocused()
await expect(page).toHaveURL(new RegExp(fixture.sourceID))
const recentTarget = sidebar
.locator('[data-action="recent-session"]')
.filter({ hasText: fixture.expected.targetTitle })
await search.press("ArrowUp")
await expect(target).toBeFocused()
await target.press("ArrowDown")
await expect(recentTarget).toBeFocused()
await recentTarget.press("ArrowDown")
await expect(target).toBeFocused()
await target.press("Enter")
await expectSessionTitle(page, fixture.expected.targetTitle)
await search.fill(fixture.expected.sourceTitle)
await search.press("Enter")
await expectSessionTitle(page, fixture.expected.sourceTitle)
await search.fill("")
await expect(sidebar.locator(".cm3-sidebar-task")).toHaveCount(2)
await expect(sidebar.locator(".cm3-sidebar-task")).toHaveCount(4)
const source = sidebar.getByRole("button", { name: fixture.expected.sourceTitle, exact: true })
await search.press("ArrowDown")
await expect(target).toBeFocused()
await target.press("ArrowDown")
await expect(source).toBeFocused()
await source.press("ArrowDown")
await expect(target).toBeFocused()
await target.press("ArrowUp")
await expect(recentTarget).toBeFocused()
await recentTarget.press("ArrowUp")
await expect(source).toBeFocused()
await source.press("Enter")
await expectSessionTitle(page, fixture.expected.sourceTitle)
Expand Down Expand Up @@ -1752,3 +1762,10 @@ test("CM3 keeps saved old session pins beyond the recent-session limit", async (
await expect(pinned.getByRole("group")).toHaveCount(1)
await expect(page.getByRole("region", { name: "Recent sessions", exact: true }).getByRole("group")).toHaveCount(64)
})

async function dismissProviderTip(page: Page) {
const tip = page.locator('[data-component="provider-tip"]')
await tip.hover()
await tip.getByRole("button", { name: "Dismiss", exact: true }).click()
await expect(tip).toBeHidden()
}
4 changes: 2 additions & 2 deletions packages/app/e2e/regression/cross-server-tab-close.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test("closing the active server's last tab opens the remaining server tab", asyn
await mockServers(page, requests)
await page.addInitScript(
({ serverB, sessionA, sessionB }) => {
localStorage.setItem("settings.v3", JSON.stringify({ general: { newLayoutDesigns: true } }))
localStorage.setItem("settings.v3", JSON.stringify({ general: { newLayoutDesigns: true, quietCompanion: false } }))
localStorage.setItem("opencode.global.dat:server", JSON.stringify({ list: [serverB] }))
localStorage.setItem(
"opencode.window.browser.dat:tabs",
Expand Down Expand Up @@ -50,7 +50,7 @@ test("legacy session routes preserve an existing tab's server", async ({ page })
await mockServers(page, [])
await page.addInitScript(
({ serverB, sessionB }) => {
localStorage.setItem("settings.v3", JSON.stringify({ general: { newLayoutDesigns: true } }))
localStorage.setItem("settings.v3", JSON.stringify({ general: { newLayoutDesigns: true, quietCompanion: false } }))
localStorage.setItem("opencode.global.dat:server", JSON.stringify({ list: [serverB] }))
localStorage.setItem(
"opencode.window.browser.dat:tabs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test("keeps the file-browser sidebar mounted when switching file tabs", async ({

for (const direction of ["ltr", "rtl"] as const) {
test(`CM3 promotes panel tabs and retains their content across layout toggles in ${direction}`, async ({ page }) => {
await setup(page, ({ query }) => files.filter((file) => file.includes(query)))
await setup(page, ({ query }) => files.filter((file) => file.includes(query)), true)
await page.goto(`/server/${base64Encode(server)}/session/${sessionID}`)
await expectSessionTitle(page, title)
if (direction === "rtl") await page.getByRole("button", { name: "DIR: LTR", exact: true }).click()
Expand All @@ -75,7 +75,6 @@ for (const direction of ["ltr", "rtl"] as const) {
const tabs = page.locator(".session-side-panel-tabs")
const list = tabs.getByRole("tablist")
await expect(header.getByRole("tablist")).toBeVisible()
await expect(panel.getByRole("tablist")).toHaveCount(0)
const originalList = await list.elementHandle()
await openPanelFileBrowser(page)
await panel.getByRole("button", { name: "file-00.ts", exact: true }).dblclick()
Expand Down Expand Up @@ -126,9 +125,10 @@ for (const direction of ["ltr", "rtl"] as const) {
await expect(tabs.getByRole("tab", { name: "file-01.ts", exact: true })).toHaveCount(0)
await expect(filter).toHaveValue("file-0")

await expect(tabs.getByRole("tab", { name: "New tab", exact: true })).toHaveCount(1)
for (let index = 0; index < 6; index++) {
await tabs.getByRole("button", { name: "New tab", exact: true }).click()
await expect(tabs.getByRole("tab", { name: "New tab", exact: true })).toHaveCount(index + 1)
await expect(tabs.getByRole("tab", { name: "New tab", exact: true })).toHaveCount(index + 2)
await expect(tabs.locator('[role="tab"][aria-selected="true"]')).toHaveText("New tab")
}
await page.setViewportSize({ width: 1000, height: 900 })
Expand Down Expand Up @@ -235,7 +235,8 @@ async function readProbe(page: Page) {

async function setup(
page: Page,
findFiles?: (input: { query: string; dirs?: string; limit?: number }) => unknown | Promise<unknown>,
findFiles?: (input: { query: string; dirs?: string; limit?: number }) => string[] | Promise<string[]>,
quietCompanion = false,
) {
await mockOpenCodeServer(page, {
directory,
Expand Down Expand Up @@ -286,8 +287,8 @@ async function setup(
})

await page.addInitScript(
({ directory, server, sessionID }) => {
localStorage.setItem("settings.v3", JSON.stringify({ general: { newLayoutDesigns: true } }))
({ directory, server, sessionID, quietCompanion }) => {
localStorage.setItem("settings.v3", JSON.stringify({ general: { newLayoutDesigns: true, quietCompanion } }))
localStorage.setItem(
"opencode.global.dat:server",
JSON.stringify({
Expand All @@ -308,6 +309,6 @@ async function setup(
JSON.stringify([{ type: "session", server, sessionId: sessionID }]),
)
},
{ directory, server, sessionID },
{ directory, server, sessionID, quietCompanion },
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test("matches the rounded panel corners to the dark new-session background", asy
})
await page.addInitScript(
({ directory, draftID, server }) => {
localStorage.setItem("settings.v3", JSON.stringify({ general: { newLayoutDesigns: true } }))
localStorage.setItem("settings.v3", JSON.stringify({ general: { newLayoutDesigns: true, quietCompanion: false } }))
localStorage.setItem("opencode-theme-id", "oc-2")
localStorage.setItem("opencode-color-scheme", "dark")
localStorage.setItem(
Expand Down
Loading
Loading