Skip to content

Commit 0a50edd

Browse files
authored
chore: release v3.0.6 (#34)
Rename the Unreleased changelog section to 3.0.6, add PR references to the #31/#32 entries, and bump the package version.
1 parent 7a3c945 commit 0a50edd

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [3.0.6] - 2026-06-11
99

1010
### Fixed
1111

1212
- **Process hang from leaked `/event` SSE connection** ([#30](https://github.com/ben-vargas/ai-sdk-provider-opencode-sdk/pull/30)) - `doStream` passes a per-stream `AbortController` signal to `client.event.subscribe` and aborts it when the stream closes (before `iterator.return()`, which could otherwise block until the next server event). Previously the SSE iterator's `return()` only released its reader lock without cancelling the underlying fetch, so the `GET /event` connection stayed open and kept the Node event loop alive after streaming finished — `examples/abort-signal.ts` intermittently never exited after printing "Done.". The client manager tracks these controllers (`registerEventSubscription`) and aborts any still open during `dispose()`.
13-
- **Streaming `session.prompt` and `session.abort` requests cancelled on stream close** - The per-stream abort signal from [#30](https://github.com/ben-vargas/ai-sdk-provider-opencode-sdk/pull/30) is now also passed to the `session.prompt` and `session.abort` requests, so a prompt the server never completes (e.g. after an abort race) cannot pin the event loop, and `dispose()` tears these requests down too. Prompt results that arrive after an intentional close are ignored instead of being mis-reported as empty-response errors.
14-
- **`doGenerate` abort signal** - The non-streaming path now forwards `options.abortSignal` to the prompt request, so aborting `generateText` cancels the underlying HTTP request instead of leaving it pending. A caller-initiated abort now surfaces as an `AbortError` (previously a generic empty-response error) and best-effort aborts the server-side session to stop generation.
15-
- **Non-streaming native structured output (`json_schema`)** - `generateText` with `Output.object()` / `Output.array()` (and `generateObject`) failed deterministically with `AI_NoOutputGeneratedError: No output generated.` even though the OpenCode server returned a valid structured result. OpenCode 1.17.x ends a `format: json_schema` turn on the `StructuredOutput` tool call, so the assistant message finishes with `"tool-calls"`; the provider reported that as a non-`stop` finish reason, and the AI SDK only parses structured output when the final step finishes with `stop`. The provider already flattens the `StructuredOutput` tool call into text content, so both `doGenerate` and the streaming path now report `finishReason: "stop"` (preserving the raw `tool-calls` value) when a completed `StructuredOutput` part is present. Streaming (`streamObject` / `streamText`) was unaffected because the AI SDK parses streamed output regardless of finish reason, but its finish event now also reports `stop` for consistency.
16-
- **Hyphenated finish reasons** - `mapOpencodeFinishReason` now recognizes the AI SDK-style hyphenated finish values OpenCode actually stores (`"tool-calls"`, `"content-filter"`) in addition to the provider-style `tool_use`/`tool_calls`/`content_filter` values; previously they fell through to `"other"`.
13+
- **Streaming `session.prompt` and `session.abort` requests cancelled on stream close** ([#31](https://github.com/ben-vargas/ai-sdk-provider-opencode-sdk/pull/31)) - The per-stream abort signal from [#30](https://github.com/ben-vargas/ai-sdk-provider-opencode-sdk/pull/30) is now also passed to the `session.prompt` and `session.abort` requests, so a prompt the server never completes (e.g. after an abort race) cannot pin the event loop, and `dispose()` tears these requests down too. Prompt results that arrive after an intentional close are ignored instead of being mis-reported as empty-response errors.
14+
- **`doGenerate` abort signal** ([#31](https://github.com/ben-vargas/ai-sdk-provider-opencode-sdk/pull/31)) - The non-streaming path now forwards `options.abortSignal` to the prompt request, so aborting `generateText` cancels the underlying HTTP request instead of leaving it pending. A caller-initiated abort now surfaces as an `AbortError` (previously a generic empty-response error) and best-effort aborts the server-side session to stop generation.
15+
- **Non-streaming native structured output (`json_schema`)** ([#32](https://github.com/ben-vargas/ai-sdk-provider-opencode-sdk/pull/32)) - `generateText` with `Output.object()` / `Output.array()` (and `generateObject`) failed deterministically with `AI_NoOutputGeneratedError: No output generated.` even though the OpenCode server returned a valid structured result. OpenCode 1.17.x ends a `format: json_schema` turn on the `StructuredOutput` tool call, so the assistant message finishes with `"tool-calls"`; the provider reported that as a non-`stop` finish reason, and the AI SDK only parses structured output when the final step finishes with `stop`. The provider already flattens the `StructuredOutput` tool call into text content, so both `doGenerate` and the streaming path now report `finishReason: "stop"` (preserving the raw `tool-calls` value) when a completed `StructuredOutput` part is present. Streaming (`streamObject` / `streamText`) was unaffected because the AI SDK parses streamed output regardless of finish reason, but its finish event now also reports `stop` for consistency.
16+
- **Hyphenated finish reasons** ([#32](https://github.com/ben-vargas/ai-sdk-provider-opencode-sdk/pull/32)) - `mapOpencodeFinishReason` now recognizes the AI SDK-style hyphenated finish values OpenCode actually stores (`"tool-calls"`, `"content-filter"`) in addition to the provider-style `tool_use`/`tool_calls`/`content_filter` values; previously they fell through to `"other"`.
1717

1818
## [3.0.5] - 2026-06-11
1919

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ai-sdk-provider-opencode-sdk",
3-
"version": "3.0.5",
3+
"version": "3.0.6",
44
"description": "AI SDK v6 provider for OpenCode via @opencode-ai/sdk",
55
"keywords": [
66
"ai-sdk",

0 commit comments

Comments
 (0)