Skip to content

Commit 33b3388

Browse files
authored
Merge branch 'dev' into feat/canceled-prompts-in-history
2 parents 716f40b + 9736fce commit 33b3388

158 files changed

Lines changed: 6507 additions & 599 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
name: "Setup Bun"
22
description: "Setup Bun with caching and install dependencies"
3-
inputs:
4-
cross-compile:
5-
description: "Pre-cache canary cross-compile binaries for all targets"
6-
required: false
7-
default: "false"
83
runs:
94
using: "composite"
105
steps:
@@ -21,12 +16,13 @@ runs:
2116
shell: bash
2217
run: |
2318
if [ "$RUNNER_ARCH" = "X64" ]; then
19+
V=$(node -p "require('./package.json').packageManager.split('@')[1]")
2420
case "$RUNNER_OS" in
2521
macOS) OS=darwin ;;
2622
Linux) OS=linux ;;
2723
Windows) OS=windows ;;
2824
esac
29-
echo "url=https://github.com/oven-sh/bun/releases/download/canary/bun-${OS}-x64-baseline.zip" >> "$GITHUB_OUTPUT"
25+
echo "url=https://github.com/oven-sh/bun/releases/download/bun-v${V}/bun-${OS}-x64-baseline.zip" >> "$GITHUB_OUTPUT"
3026
fi
3127
3228
- name: Setup Bun
@@ -35,54 +31,6 @@ runs:
3531
bun-version-file: ${{ !steps.bun-url.outputs.url && 'package.json' || '' }}
3632
bun-download-url: ${{ steps.bun-url.outputs.url }}
3733

38-
- name: Pre-cache canary cross-compile binaries
39-
if: inputs.cross-compile == 'true'
40-
shell: bash
41-
run: |
42-
BUN_VERSION=$(bun --revision)
43-
if echo "$BUN_VERSION" | grep -q "canary"; then
44-
SEMVER=$(echo "$BUN_VERSION" | sed 's/^\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/')
45-
echo "Bun version: $BUN_VERSION (semver: $SEMVER)"
46-
CACHE_DIR="$HOME/.bun/install/cache"
47-
mkdir -p "$CACHE_DIR"
48-
TMP_DIR=$(mktemp -d)
49-
for TARGET in linux-aarch64 linux-x64 linux-x64-baseline linux-aarch64-musl linux-x64-musl linux-x64-musl-baseline darwin-aarch64 darwin-x64 windows-x64 windows-x64-baseline; do
50-
DEST="$CACHE_DIR/bun-${TARGET}-v${SEMVER}"
51-
if [ -f "$DEST" ]; then
52-
echo "Already cached: $DEST"
53-
continue
54-
fi
55-
URL="https://github.com/oven-sh/bun/releases/download/canary/bun-${TARGET}.zip"
56-
echo "Downloading $TARGET from $URL"
57-
if curl -sfL -o "$TMP_DIR/bun.zip" "$URL"; then
58-
unzip -qo "$TMP_DIR/bun.zip" -d "$TMP_DIR"
59-
if echo "$TARGET" | grep -q "windows"; then
60-
BIN_NAME="bun.exe"
61-
else
62-
BIN_NAME="bun"
63-
fi
64-
mv "$TMP_DIR/bun-${TARGET}/$BIN_NAME" "$DEST"
65-
chmod +x "$DEST"
66-
rm -rf "$TMP_DIR/bun-${TARGET}" "$TMP_DIR/bun.zip"
67-
echo "Cached: $DEST"
68-
# baseline bun resolves "bun-darwin-x64" to the baseline cache key
69-
# so copy the modern binary there too
70-
if [ "$TARGET" = "darwin-x64" ]; then
71-
BASELINE_DEST="$CACHE_DIR/bun-darwin-x64-baseline-v${SEMVER}"
72-
if [ ! -f "$BASELINE_DEST" ]; then
73-
cp "$DEST" "$BASELINE_DEST"
74-
echo "Cached (baseline alias): $BASELINE_DEST"
75-
fi
76-
fi
77-
else
78-
echo "Skipped: $TARGET (not available)"
79-
fi
80-
done
81-
rm -rf "$TMP_DIR"
82-
else
83-
echo "Not a canary build ($BUN_VERSION), skipping pre-cache"
84-
fi
85-
8634
- name: Install dependencies
8735
run: bun install
8836
shell: bash

.github/workflows/publish.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ jobs:
7777
fetch-tags: true
7878

7979
- uses: ./.github/actions/setup-bun
80-
with:
81-
cross-compile: "true"
8280

8381
- name: Setup git committer
8482
id: committer
@@ -90,7 +88,7 @@ jobs:
9088
- name: Build
9189
id: build
9290
run: |
93-
./packages/opencode/script/build.ts --all
91+
./packages/opencode/script/build.ts
9492
env:
9593
OPENCODE_VERSION: ${{ needs.version.outputs.version }}
9694
OPENCODE_RELEASE: ${{ needs.version.outputs.release }}

.github/workflows/sign-cli.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ jobs:
2020
fetch-tags: true
2121

2222
- uses: ./.github/actions/setup-bun
23-
with:
24-
cross-compile: "true"
2523

2624
- name: Build
2725
run: |
28-
./packages/opencode/script/build.ts --all
26+
./packages/opencode/script/build.ts
2927
3028
- name: Upload unsigned Windows CLI
3129
id: upload_unsigned_windows_cli

bun.lock

Lines changed: 210 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nix/hashes.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"nodeModules": {
3-
"x86_64-linux": "sha256-3hfy6nfEnGq4J6inH0pXANw05oas+81iuayn7J0pj9c=",
4-
"aarch64-linux": "sha256-dxWaLtzSeI5NfHwB6u0K10yxoA0ESz/r+zTEQ3FdKFY=",
5-
"aarch64-darwin": "sha256-kkK4rj4g0j2jJFXVmVH7CJcXlI8Dj/KmL/VC3iE4Z+8=",
6-
"x86_64-darwin": "sha256-jt51irxZd48kb0BItd8InP7lfsELUh0unVYO2es+a98="
3+
"x86_64-linux": "sha256-dZoLhWe4smBsOF7WczMySLXSAB1YRO1vfhiOCL1rBf0=",
4+
"aarch64-linux": "sha256-J7nIz1xuVZEHun5WRZkYRySz29B0A8g5g0RRxnIWTYU=",
5+
"aarch64-darwin": "sha256-R2PuhX+EjUBuLE8MF0G0fcUwNaU+5n6V6uVeK89ulzw=",
6+
"x86_64-darwin": "sha256-Bvzfz9TsTpYriZNLSLgpNcNb+BgtkgpjoWqdOtF2IBg="
77
}
88
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "AI-powered development tool",
55
"private": true,
66
"type": "module",
7-
"packageManager": "bun@1.3.9",
7+
"packageManager": "bun@1.3.10",
88
"scripts": {
99
"dev": "bun run --cwd packages/opencode --conditions=browser src/index.ts",
1010
"dev:desktop": "bun --cwd packages/desktop tauri dev",

packages/app/e2e/projects/projects-switch.spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
sessionIDFromUrl,
1010
} from "../actions"
1111
import { projectSwitchSelector, promptSelector, workspaceItemSelector, workspaceNewSessionSelector } from "../selectors"
12-
import { createSdk, dirSlug } from "../utils"
12+
import { createSdk, dirSlug, sessionPath } from "../utils"
1313

1414
function slugFromUrl(url: string) {
1515
return /\/([^/]+)\/session(?:\/|$)/.exec(url)?.[1] ?? ""
@@ -51,7 +51,6 @@ test("switching back to a project opens the latest workspace session", async ({
5151

5252
const other = await createTestProject()
5353
const otherSlug = dirSlug(other)
54-
const stamp = Date.now()
5554
let rootDir: string | undefined
5655
let workspaceDir: string | undefined
5756
let sessionID: string | undefined
@@ -80,6 +79,7 @@ test("switching back to a project opens the latest workspace session", async ({
8079

8180
const workspaceSlug = slugFromUrl(page.url())
8281
workspaceDir = base64Decode(workspaceSlug)
82+
if (!workspaceDir) throw new Error(`Failed to decode workspace slug: ${workspaceSlug}`)
8383
await openSidebar(page)
8484

8585
const workspace = page.locator(workspaceItemSelector(workspaceSlug)).first()
@@ -92,15 +92,14 @@ test("switching back to a project opens the latest workspace session", async ({
9292

9393
await expect(page).toHaveURL(new RegExp(`/${workspaceSlug}/session(?:[/?#]|$)`))
9494

95-
const prompt = page.locator(promptSelector)
96-
await expect(prompt).toBeVisible()
97-
await prompt.fill(`project switch remembers workspace ${stamp}`)
98-
await prompt.press("Enter")
99-
100-
await expect.poll(() => sessionIDFromUrl(page.url()) ?? "", { timeout: 30_000 }).not.toBe("")
101-
const created = sessionIDFromUrl(page.url())
102-
if (!created) throw new Error(`Failed to parse session id from URL: ${page.url()}`)
95+
const created = await createSdk(workspaceDir)
96+
.session.create()
97+
.then((x) => x.data?.id)
98+
if (!created) throw new Error(`Failed to create session for workspace: ${workspaceDir}`)
10399
sessionID = created
100+
101+
await page.goto(sessionPath(workspaceDir, created))
102+
await expect(page.locator(promptSelector)).toBeVisible()
104103
await expect(page).toHaveURL(new RegExp(`/${workspaceSlug}/session/${created}(?:[/?#]|$)`))
105104

106105
await openSidebar(page)
@@ -114,7 +113,8 @@ test("switching back to a project opens the latest workspace session", async ({
114113
await expect(rootButton).toBeVisible()
115114
await rootButton.click()
116115

117-
await expect(page).toHaveURL(new RegExp(`/${workspaceSlug}/session/${created}(?:[/?#]|$)`))
116+
await expect.poll(() => sessionIDFromUrl(page.url()) ?? "").toBe(created)
117+
await expect(page).toHaveURL(new RegExp(`/session/${created}(?:[/?#]|$)`))
118118
},
119119
{ extra: [other] },
120120
)

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-ai/app",
3-
"version": "1.2.14",
3+
"version": "1.2.15",
44
"description": "",
55
"type": "module",
66
"exports": {

packages/app/src/components/dialog-select-model-unpaid.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,20 @@ export const DialogSelectModelUnpaid: Component = () => {
9797
<div class="w-full flex items-center gap-x-3">
9898
<ProviderIcon data-slot="list-item-extra-icon" id={i.id as IconName} />
9999
<span>{i.name}</span>
100+
<Show when={i.id === "opencode"}>
101+
<div class="text-14-regular text-text-weak">{language.t("dialog.provider.opencode.tagline")}</div>
102+
</Show>
100103
<Show when={i.id === "opencode"}>
101104
<Tag>{language.t("dialog.provider.tag.recommended")}</Tag>
102105
</Show>
106+
<Show when={i.id === "opencode-go"}>
107+
<>
108+
<div class="text-14-regular text-text-weak">
109+
{language.t("dialog.provider.opencodeGo.tagline")}
110+
</div>
111+
<Tag>{language.t("dialog.provider.tag.recommended")}</Tag>
112+
</>
113+
</Show>
103114
<Show when={i.id === "anthropic"}>
104115
<div class="text-14-regular text-text-weak">{language.t("dialog.provider.anthropic.note")}</div>
105116
</Show>

packages/app/src/components/dialog-select-provider.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const DialogSelectProvider: Component = () => {
2929
if (id === "anthropic") return language.t("dialog.provider.anthropic.note")
3030
if (id === "openai") return language.t("dialog.provider.openai.note")
3131
if (id.startsWith("github-copilot")) return language.t("dialog.provider.copilot.note")
32+
if (id === "opencode-go") return language.t("dialog.provider.opencodeGo.tagline")
3233
}
3334

3435
return (
@@ -70,13 +71,19 @@ export const DialogSelectProvider: Component = () => {
7071
<div class="px-1.25 w-full flex items-center gap-x-3">
7172
<ProviderIcon data-slot="list-item-extra-icon" id={icon(i.id)} />
7273
<span>{i.name}</span>
74+
<Show when={i.id === "opencode"}>
75+
<div class="text-14-regular text-text-weak">{language.t("dialog.provider.opencode.tagline")}</div>
76+
</Show>
7377
<Show when={i.id === CUSTOM_ID}>
7478
<Tag>{language.t("settings.providers.tag.custom")}</Tag>
7579
</Show>
7680
<Show when={i.id === "opencode"}>
7781
<Tag>{language.t("dialog.provider.tag.recommended")}</Tag>
7882
</Show>
7983
<Show when={note(i.id)}>{(value) => <div class="text-14-regular text-text-weak">{value()}</div>}</Show>
84+
<Show when={i.id === "opencode-go"}>
85+
<Tag>{language.t("dialog.provider.tag.recommended")}</Tag>
86+
</Show>
8087
</div>
8188
)}
8289
</List>

0 commit comments

Comments
 (0)