Repository navigation
v0.3.0
v0.3.0
🚀 New Features
True SSE Streaming for AskStream
OpenCodeSession.AskStream() and AskOperation.AskStream() now perform real SSE streaming instead of buffering the entire response.
- Sends
"stream": truein the request body toPOST /session/{id}/message - Reads SSE events via
SseReaderfrom a response stream (ResponseHeadersRead) event: chunk— each text part is deserialized and passed toonChunkin real timeevent: complete— the finalOpenCodeReplyis deserialized and passed toonCompleteevent: error— throwsNOpenCodeException- New
NOpenCodeHttpClient.PostStream()method added for POST with streaming response
CancellationToken Support
AskOperation.Execute() and AskOperation.ExecuteFull() now accept CancellationToken ct = default, propagated through session creation and message sending. Fully backward compatible.
File Attachments
Partmodel now includes[JsonPropertyName("uri")]property for file reference serializationBuildMessageDict()generatestype: "file"parts whenMessageOptions.Filesis specifiedAskOperation.WithFiles()correctly forwards attachments to the session'sAskcall viaMessageOptions
McpClient Enhancements
Remove(string name, CancellationToken ct)→DELETE /mcp/{name}Update(string name, object config, CancellationToken ct)→PATCH /mcp/{name}
Type-Safe ConfigClient.Update
- Added
Update(NOpenCodeConfig config, CancellationToken ct)overload with strong typing - The original
Update(object patch, CancellationToken)overload remains for backward compatibility
🧪 Testing (24 new tests)
- StreamingTests.cs (new) — 7 tests covering
SseReader: chunk, complete, error, comment lines, multiple events, default type, empty stream - NewApiTests.cs (new) — 10 reflection-based API signature tests: CancellationToken overloads, WithFiles chaining, McpClient Remove/Update, ConfigClient typed overload, Part.Uri, MessageOptions.Files
- ModelTests.cs (updated) — 3 tests for Part.Uri default value and property setter
🔧 Internal Improvements
NOpenCodeHttpClient.PostStream()— POST withHttpCompletionOption.ResponseHeadersReadfor streaming responseOpenCodeSession.BuildMessageDict()— restructured to support file parts and"stream": trueInternalsVisibleToadded forNOpenCode.Teststo enable testing of internal types (SseReader,NOpenCodeHttpClient)- Added
using System.IO/using System.Text.JsontoOpenCodeSession.cs