Skip to content

Commit 40c83fa

Browse files
committed
Merge branch 'dev' into production
2 parents f83f88b + db1fbe8 commit 40c83fa

706 files changed

Lines changed: 11386 additions & 9305 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.

‎.github/workflows/deploy-changelog.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919
jobs:
2020
deploy:
2121
if: github.repository == 'anomalyco/opencode' && github.ref_name == 'dev'
22-
runs-on: ubuntu-latest
22+
runs-on: blacksmith-4vcpu-ubuntu-2404
2323
steps:
2424
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2525

‎.github/workflows/deploy-files.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717
jobs:
1818
deploy:
1919
if: github.repository == 'anomalyco/opencode' && (github.ref_name == 'dev' || github.ref_name == 'production')
20-
runs-on: ubuntu-latest
20+
runs-on: blacksmith-4vcpu-ubuntu-2404
2121
steps:
2222
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2323

‎.github/workflows/deploy-posts.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020
jobs:
2121
deploy:
2222
if: github.repository == 'anomalyco/opencode' && github.ref_name == 'production'
23-
runs-on: ubuntu-latest
23+
runs-on: blacksmith-4vcpu-ubuntu-2404
2424
steps:
2525
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2626

‎.github/workflows/deploy-update.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616
jobs:
1717
deploy:
1818
if: github.repository == 'anomalyco/opencode' && github.ref_name == 'production'
19-
runs-on: ubuntu-latest
19+
runs-on: blacksmith-4vcpu-ubuntu-2404
2020
steps:
2121
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2222

‎.github/workflows/deploy-www.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717
jobs:
1818
deploy:
1919
if: github.repository == 'anomalyco/opencode' && (github.ref_name == 'dev' || github.ref_name == 'production')
20-
runs-on: ubuntu-latest
20+
runs-on: blacksmith-4vcpu-ubuntu-2404
2121
steps:
2222
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
2323

‎.github/workflows/deploy.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717
jobs:
1818
deploy:
1919
if: github.repository == 'anomalyco/opencode' && (github.ref_name == 'dev' || github.ref_name == 'production' || github.ref_name == 'beta')
20-
runs-on: ${{ github.ref_name == 'dev' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
20+
runs-on: blacksmith-4vcpu-ubuntu-2404
2121
environment: ${{ github.ref_name }}
2222
steps:
2323
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
@@ -42,7 +42,6 @@ jobs:
4242
PLANETSCALE_SERVICE_TOKEN_NAME: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_NAME }}
4343
PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}
4444
STRIPE_SECRET_KEY: ${{ github.ref_name == 'production' && secrets.STRIPE_SECRET_KEY_PROD || secrets.STRIPE_SECRET_KEY_DEV }}
45-
HONEYCOMB_API_KEY: ${{ secrets.HONEYCOMB_API_KEY }}
4645
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
4746
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
4847
SENTRY_PROJECT: ${{ vars.WEB_SENTRY_PROJECT }}

‎.opencode/skills/unit-tests/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Sibling skills: `tui-tests` (OpenTUI renderer tests in tui and cli), `app-e2e-te
3333

3434
- **Effect code.** `it.effect` from `packages/core/test/lib/effect.ts` runs on `TestClock`; `testEffect(layer)` adds your layer. server and cli import it from `../../core/test/lib/effect`; ai has `packages/ai/test/lib/effect.ts`.
3535
- **Fork, then adjust.** Fork with `Effect.forkChild({ startImmediately: true })` (`packages/ai/test/http-timeout.test.ts:58`), or await a Deferred the code completes and then `Effect.yieldNow` (`:80-81`). Otherwise `TestClock.adjust` can run before the sleep is registered, and the join hangs until Bun's timeout.
36-
- **Debounced streams and watchers.** `advance(condition)` and `drain` in `packages/core/test/lib/clock.ts` alternate one real 1ms macrotask with 500ms adjusts, because debounces register sleeps across fiber hops. Use `drain` (4 such steps) before a "nothing happened" assertion instead of `Bun.sleep(25)`. `advance`'s 100-step bound is right under TestClock, but a condition waiting on slow real work (a child, a large write) can run out of steps under load.
36+
- **Debounced streams and watchers.** `advance(condition)` and `drain` in `packages/core/test/lib/clock.ts` alternate one real 1ms macrotask with 500ms adjusts, because debounces register sleeps across fiber hops. Use `drain` (4 such steps) before a "nothing happened" assertion instead of `Bun.sleep(25)`. `advance` is bounded by 15s of real time, not a step count, because its condition can also wait on slow real work (a plugin import, a child, a large write) that took more than 100 steps on a loaded Linux runner (`supervisor-reload.test.ts` "retains a discovered plugin change during initial activation").
3737
- **Real I/O between virtual steps.** `TestClock.withLive(Effect.sleep("10 millis"))`. `registered()` at `packages/cli/test/service.test.ts:740` tests the 5s registration watch with real file I/O under `it.effect`. This departs from the effect skill's "filesystem → `it.live`" on purpose: the timer is the contract.
3838
- **Real events need `it.live`.** Under `it.effect` the clock moves only when the test adjusts it, so an Effect timeout on a path driven by real processes, sockets or file events never fires and a missing event hangs instead of failing. The AppProcess tests (`packages/core/test/process/process.test.ts:13-14`) use `it.live` because the spawner's 1-second post-exit capture deadline (`packages/util/src/cross-spawn-spawner.ts:322`) never fired under TestClock.
3939
- **Give a racing component its own clock.** When a real-time deadline races slow setup, provide that component a `Clock` that only the test moves past the deadline. `packages/core/test/browser-idle.test.ts:24-38` wraps the live clock for `LocationActivity` (`:49-51`) and adds the TTL at `:84`, once the browser state is attached. Before, it waited out a real 2s TTL and failed on Windows CI with "RPC is unavailable: experimental.browser" when plugin activation was slow. Shortening a real TTL makes that race flakier.

‎CHANGELOG.md‎

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,152 @@
22

33
Release notes for OpenCode V2, newest first.
44

5+
## v2.1.0 — 2026-10-20
6+
7+
### Highlights
8+
9+
- **Persistent Terminals on Windows**: Windows users now get persistent PTYs through the same terminal workflow available on macOS and Linux. ([#56245](https://github.com/anomalyco/opencode/pull/56245))
10+
- **Todo Lists in the TUI**: Enable `{ "experimental": { "todo": true } }` to give models the `todowrite` tool and display their task list in the session and sidebar. ([#56947](https://github.com/anomalyco/opencode/pull/56947))
11+
- **Reliable Long-Running TUI Commands**: Plugin commands, shell calls, and other TUI requests can now run beyond Bun’s five-minute fetch deadline without losing their connection. ([#55149](https://github.com/anomalyco/opencode/pull/55149))
12+
13+
### Breaking changes
14+
15+
Version 2.1 makes intentional changes to public SDK, HTTP message/event, and plugin contracts so provider replay data and compaction use consistent names and shapes. Integrations must adopt the new fields. Existing stored sessions, credentials, and older session imports remain readable through compatibility decoders; no database migration is required. ([#57260](https://github.com/anomalyco/opencode/pull/57260))
16+
17+
#### Provider replay data is now `native`
18+
19+
Provider-owned replay data previously used different names on different surfaces. Read and write `native` instead; a tool's execution `state` and UI `metadata` are separate and are not renamed.
20+
21+
| Surface | Before | After |
22+
| --- | --- | --- |
23+
| Text and reasoning parts | `state` | `native` |
24+
| Assistant and compaction messages | `providerState` | `native` |
25+
| Text/reasoning lifecycle events and `session.tool.called` | `state` | `native` |
26+
| `session.step.ended`, `session.step.failed`, and `session.compaction.ended` | `providerState` | `native` |
27+
| `session.tool.success` and `session.tool.failed` | `resultState` | `native` |
28+
| Exported replay-data schema | `SessionMessage.ProviderState` | `SessionMessage.Native` |
29+
| Plugin compaction hook result | `SessionCompactionResult.providerState` | `SessionCompactionResult.native` |
30+
31+
#### Tool call and result data share `tool.native`
32+
33+
Tool parts no longer have separate `providerState` and `providerResultState` fields:
34+
35+
```diff
36+
tool
37+
- providerState?
38+
- providerResultState?
39+
+ native?
40+
state
41+
```
42+
43+
Success and failure events shallow-merge their `native` into the call's existing `native`. Missing result data preserves call data; result values win on duplicate keys. Provider/protocol implementations must use distinct keys when call and result values differ. There is no `state.native`, `resultNative`, or nested `{ call, result }` envelope.
44+
45+
Replay passes the merged blob to the protocol, which reads the fields it needs. Tool calls receive it only for the same provider and model. Provider-run results receive it for the same provider, including after a model switch. Local results receive it only for the same provider and model when the step did not fail. Legacy stored or imported `providerResultState` is merged into `tool.native` when read. Execution status and readable output remain in `tool.state`.
46+
47+
#### Key credential setup answers move to `metadata`
48+
49+
`Credential.Key.configuration` is removed. Public credential writes must put setup-form answers in the existing `metadata` field:
50+
51+
```diff
52+
{ type: "key", key: "...",
53+
- configuration: { account: "example" }
54+
+ metadata: { account: "example" }
55+
}
56+
```
57+
58+
Existing stored credentials and `opencode auth import` still accept the old shape. Legacy `configuration` is merged into `metadata`; the legacy configuration value wins when both contain the same key. This compatibility is for storage/import, not a reason to keep sending `configuration` in public writes.
59+
60+
#### Summary compactions reference kept messages
61+
62+
Compaction messages and `session.compaction.started` / `session.compaction.ended` no longer expose `recent`. New summary compactions reference the first message retained verbatim through `metadata.keepID` instead of storing a second, flattened copy:
63+
64+
```diff
65+
summary compaction
66+
- recent: "[User]: ... [Assistant]: ..."
67+
+ metadata: { keepID: "msg_..." }
68+
```
69+
70+
History reconstructs the kept text from that message up to the compaction boundary. Forks remap the reference to their copied messages, and compaction hooks can override `keepID` through metadata. Kept text from pre-2.1 compactions and V1 imports remains available as `metadata.recent`. New compactions store the reference, not the duplicated text.
71+
72+
#### Provider compaction windows move to `native.messages`
73+
74+
Completed compactions and `session.compaction.ended` no longer have `providerContext`. The replacement message window now lives in `native.messages`:
75+
76+
```diff
77+
- providerContext: { version, provenance, messages }
78+
+ native: { messages }
79+
```
80+
81+
Native compaction replay now matches the compaction's provider ID and model ID, rather than route/protocol/endpoint provenance. If they do not match, history uses the original messages. Endpoint changes alone no longer block replay, and request hooks that rewrite the base URL no longer block native compaction or replay.
82+
83+
Summary compactions no longer save the summary call's unused provider data in `native`. A compaction hook's `result.native` is still stored; if it contains `messages`, that window is replayed **instead of** the summary. Old `providerContext` rows and events are converted when read, including the media format used before 2.0.15.
84+
85+
#### Remove the unused `session.compacted` event
86+
87+
The transitional `session.compacted` event is removed from the public event surface. Update event subscriptions and schema imports to use the current compaction lifecycle events, including `session.compaction.started` and `session.compaction.ended`.
88+
89+
### Core
90+
91+
#### Improvements
92+
93+
- Added persistent PTY support for Windows x64 and ARM64. ([#56245](https://github.com/anomalyco/opencode/pull/56245))
94+
- Restored the `todowrite` tool behind `{ "experimental": { "todo": true } }`; it accepts the complete list as `{ todos: [{ content, status }] }`. ([#56947](https://github.com/anomalyco/opencode/pull/56947))
95+
- Restored session archiving, including archive-state filtering and restoring archived sessions. ([#53759](https://github.com/anomalyco/opencode/pull/53759))
96+
- Added support for editing saved permission actions and resource patterns. ([#56659](https://github.com/anomalyco/opencode/pull/56659))
97+
- Summary compaction now covers the whole conversation while retaining recent text verbatim, and begins earlier by default to leave more response room. ([#57091](https://github.com/anomalyco/opencode/pull/57091))
98+
- Added the `streamUsage` model compatibility option for providers that reject `stream_options`. ([#57255](https://github.com/anomalyco/opencode/pull/57255))
99+
100+
#### Bug fixes
101+
102+
- Prevented long-running TUI, `run`, and `mini` requests from hitting Bun’s default fetch deadline. Thanks @Finn763. ([#55149](https://github.com/anomalyco/opencode/pull/55149))
103+
- Retried broken-pipe transport failures. Thanks @sdivyanshu90. ([#56307](https://github.com/anomalyco/opencode/pull/56307))
104+
- Retried transient failures from buffered model generations instead of immediately failing. ([#56497](https://github.com/anomalyco/opencode/pull/56497))
105+
- Ignored provider keep-alives and unknown stream events while continuing to reject malformed known events. ([#56286](https://github.com/anomalyco/opencode/pull/56286), [#56669](https://github.com/anomalyco/opencode/pull/56669))
106+
- Limited the OpenAI-compatible `store` field to OpenAI, Azure, and providers that explicitly opt in. ([#57239](https://github.com/anomalyco/opencode/pull/57239))
107+
- Preserved more complete context during compaction and stabilized image trimming and instruction baselines to improve prompt-cache reuse. Thanks @rrauenza for the revert fix. ([#56983](https://github.com/anomalyco/opencode/pull/56983), [#54410](https://github.com/anomalyco/opencode/pull/54410))
108+
- Ensured shell completion is reported only after output capture finishes, and reported removed running shells as killed. ([#56321](https://github.com/anomalyco/opencode/pull/56321), [#56982](https://github.com/anomalyco/opencode/pull/56982))
109+
- Prevented undefined permission metadata from breaking pending-request responses. ([#54090](https://github.com/anomalyco/opencode/pull/54090))
110+
- Bounded skill discovery and file watches, and tolerated filesystem permission denials during sandboxed startup. ([#55597](https://github.com/anomalyco/opencode/pull/55597), [#55817](https://github.com/anomalyco/opencode/pull/55817))
111+
- Included the root `script/` directory in Nix CLI builds. ([#55494](https://github.com/anomalyco/opencode/pull/55494))
112+
113+
### TUI
114+
115+
#### Improvements
116+
117+
- Added todo lists to session output, compact cards, and the sidebar when experimental todo support is enabled. ([#56947](https://github.com/anomalyco/opencode/pull/56947))
118+
- `/models` now opens on the current model and preserves the server’s preferred model order. ([#57151](https://github.com/anomalyco/opencode/pull/57151))
119+
- Added visible keyboard focus and reverse `Shift+Tab` navigation to export options. ([#57154](https://github.com/anomalyco/opencode/pull/57154))
120+
121+
#### Bug fixes
122+
123+
- Kept long-running commands connected beyond Bun’s fetch deadline and restored the composer with an error toast when an existing-session shell command fails. Thanks @Finn763. ([#55149](https://github.com/anomalyco/opencode/pull/55149))
124+
- Retried `session.wait` after transport interruptions in `mini`. ([#57062](https://github.com/anomalyco/opencode/pull/57062))
125+
- Highlighted the selected file in the diff tree. Thanks @Tarquinen. ([#57227](https://github.com/anomalyco/opencode/pull/57227))
126+
- Removed per-row resize listeners from selection dialogs. Thanks @tobwen. ([#56234](https://github.com/anomalyco/opencode/pull/56234))
127+
- Corrected spacing above simple-dialog footers. ([#56092](https://github.com/anomalyco/opencode/pull/56092))
128+
- Fixed Mermaid flowchart rendering in the TUI when labels contain apostrophes. ([#57060](https://github.com/anomalyco/opencode/pull/57060))
129+
130+
### Desktop
131+
132+
#### Bug fixes
133+
134+
- Show free OpenCode models alongside their paid counterparts by default instead of hiding them when they share the same model family and release date. ([#55712](https://github.com/anomalyco/opencode/pull/55712))
135+
136+
### SDK
137+
138+
#### Improvements
139+
140+
- Extended the existing experimental server voice API, `client.voice.session(...)`, with Gemini Live support for `gemini-3.8-live*` models over WebSocket. The server uses a stored Google key or `GEMINI_API_KEY`, `GOOGLE_GENERATIVE_AI_API_KEY`, or `GOOGLE_API_KEY`. ([#56888](https://github.com/anomalyco/opencode/pull/56888))
141+
- Added `client.permission.saved.update(...)` for changing a saved permission’s action or resource. ([#56659](https://github.com/anomalyco/opencode/pull/56659))
142+
- Added archive filtering to `client.session.list(...)` and archive updates to `client.session.update(...)`. ([#53759](https://github.com/anomalyco/opencode/pull/53759))
143+
- Added `idle` to the supported `client.message.list(...)` type filter. ([#56504](https://github.com/anomalyco/opencode/pull/56504))
144+
145+
### Extensions
146+
147+
#### Improvements
148+
149+
- Added paginated `ctx.session.list(...)` to both Effect and Promise plugin APIs. ([#56264](https://github.com/anomalyco/opencode/pull/56264))
150+
5151
## v2.0.32 — 2026-10-16
6152

7153
### Highlights

‎README.ar.md‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,39 +47,35 @@
4747

4848
```bash
4949
# YOLO
50-
curl -fsSL https://opencode.ai/install | bash
50+
curl -fsSL https://opencode.ai/v2/install | bash
5151

5252
# مديري الحزم
5353
npm i -g @opencode/cli@latest # او bun/pnpm/yarn
54-
scoop install opencode # Windows
55-
choco install opencode # Windows
56-
brew install anomalyco/tap/opencode # macOS و Linux (موصى به، دائما محدث)
54+
brew install anomalyco/tap/opencode-v2 # macOS و Linux (موصى به، دائما محدث)
5755
brew install opencode # macOS و Linux (صيغة brew الرسمية، تحديث اقل)
5856
sudo pacman -S opencode # Arch Linux (Stable)
59-
paru -S opencode-bin # Arch Linux (Latest from AUR)
57+
paru -S opencode-beta # Arch Linux (Latest from AUR)
6058
mise use -g opencode # اي نظام
61-
nix run nixpkgs#opencode # او github:anomalyco/opencode لاحدث فرع dev
59+
nix run github:anomalyco/opencode # Nix
6260
```
6361

6462
> [!TIP]
6563
> احذف الاصدارات الاقدم من 0.1.x قبل التثبيت.
6664
6765
### تطبيق سطح المكتب (BETA)
6866

69-
يتوفر OpenCode ايضا كتطبيق سطح مكتب. قم بالتنزيل مباشرة من [صفحة الاصدارات](https://github.com/anomalyco/opencode/releases) او من [opencode.ai/download](https://opencode.ai/download).
67+
يتوفر OpenCode ايضا كتطبيق سطح مكتب. قم بالتنزيل من [opencode.ai/download](https://opencode.ai/download).
7068

7169
| المنصة | التنزيل |
7270
| --------------------- | ---------------------------------- |
7371
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
7472
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
75-
| Windows | `opencode-desktop-windows-x64.exe` |
73+
| Windows | `opencode-desktop-win-x64.exe` |
7674
| Linux | `.deb` او `.rpm` او AppImage |
7775

7876
```bash
7977
# macOS (Homebrew)
8078
brew install --cask opencode-desktop
81-
# Windows (Scoop)
82-
scoop bucket add extras; scoop install extras/opencode-desktop
8379
```
8480

8581
#### مجلد التثبيت
@@ -93,8 +89,8 @@ scoop bucket add extras; scoop install extras/opencode-desktop
9389

9490
```bash
9591
# امثلة
96-
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
97-
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
92+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/v2/install | bash
93+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/v2/install | bash
9894
```
9995

10096
### Agents

0 commit comments

Comments
 (0)