You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
-
## [Unreleased]
8
+
## [3.0.6] - 2026-06-11
9
9
10
10
### Fixed
11
11
12
12
-**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"`.
0 commit comments