Skip to content

Commit d6cda77

Browse files
committed
fix: auto-turn streaming, plan sanitization, and HTTP response close in proxy
Fix: auto-turn with server-side tool execution - Rewrite _proxyStreaming to auto-turn internally: forward reasoning/text immediately, execute tools server-side (Glob/Read/Grep/Write/Edit/Bash/Task), loop until final text-only response Fix: shouldContinue matching API finishReason format - API sends 'tool-calls' (hyphen), not 'tool_calls' (underscore) - Match both variants in shouldContinue check and _mapFinishReason Fix: duplicate tool call counting - tool-call event is redundant with tool-input-end; skip it to prevent duplicate tool_call_id errors in subsequent API rounds Fix: HTTP response never closed after [DONE] - Add await response.close() after writing [DONE] so OpenCode client does not hang on 'loading' forever Fix: plan artifact sanitization - Remove plan header, content, fragment, and trailer lines from chunks - Apply stop-token patterns ([endchat], [done], etc.)
1 parent c2bf05f commit d6cda77

1 file changed

Lines changed: 535 additions & 114 deletions

File tree

0 commit comments

Comments
 (0)