Conversation
…ode providers Introduce a direct fetch-based streaming pipeline for providers (qwen, zhipu, minimax) that need explicit request-body flags such as `enable_thinking`. Also improves the loading indicator to stay visible while reasoning output is in flight. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Augment PR SummarySummary: Adds a raw fetch-based OpenAI-compatible streaming path for providers that require explicit thinking-mode flags. Changes:
data: frames (including reasoning_content/reasoning).
🤖 Was this summary useful? React with 👍 or 👎 |
| const text = useMemo(() => getMessageText(message.parts), [message.parts]); | ||
| const lastResponseTextIndex = useMemo( | ||
| () => findLastResponseTextIndex(message), | ||
| [message] |
There was a problem hiding this comment.
app/extension/src/sidepanel/components/AssistantMessage.tsx:56 lastResponseTextIndex is memoized with [message]; if message.parts changes without replacing the message object, the memo can go stale and showPreparingResponse may not reflect the latest streamed parts.
Consider depending on message.parts (or deriving directly) so the loading indicator stays in sync with streaming updates.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| const nextStreamState = applyStreamingPreviewChunk(streamState, chunk, { | ||
| includeReasoning: includeReasoningPreview, | ||
| streamState = nextStreamState; | ||
| sendStreamingPreviewUpdate( |
There was a problem hiding this comment.
app/extension/src/background.ts:504 In the raw OpenAI-compatible path, sendStreamingPreviewUpdate isn’t wrapped in a try/catch like the Vercel AI path below, so a messaging failure could throw and abort the entire stream/task.
It may be safer to handle this error similarly so the stream stops gracefully instead of failing the run.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| dataLines = []; | ||
|
|
||
| const delta = extractOpenAICompatibleStreamDelta(eventData); | ||
| if (delta.done) { |
There was a problem hiding this comment.
app/extension/src/ai/openAICompatibleStream.ts:140 OpenAICompatibleStreamDelta includes a done flag, but onDelta is never invoked with done: true (the function returns early when it sees [DONE]).
This can surprise callers that expect a terminal callback to finalize UI/state.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Summary
requiresRawOpenAICompatibleStreamflag toProviderMeta; set for qwen, zhipu, and minimax providersstreamOpenAICompatibleChatCompletionhelper that can pass arbitrary request-body extras (e.g.enable_thinking) not exposed by the Vercel AI SDKbackground.ts; all others keep the existing Vercel AI SDK pathgetThinkingModeOptionshelper inthinkingMode.tsto build provider-specific thinking flagsAssistantMessageto remain visible while reasoning content is streaming (not just before any parts arrive)Test plan
yarn testpasses inapp/extension🤖 Generated with Claude Code