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
fix(api): fix abort signal propagation across all providers
Fix 6 major issues and 6 nitpick inconsistencies from CodeRabbit review:
Major fixes (Stop functionality broken for some providers):
- openai-codex.ts: Pass full metadata in retry loop, not just taskId
- openai-native.ts: Reuse existing controller signal in fallback path
- vscode-lm.ts: Bridge external abortSignal to VSCode CancellationToken
- bedrock.ts: Handle pre-aborted signals + use {once: true} listener
- gemini.ts: Move abortSignal to config.abortSignal for both streaming and non-streaming calls
- native-ollama.ts: Use per-request client with abort() method
Nitpick fixes (consistent signal forwarding pattern):
- openai.ts, unbound.ts, qwen-code.ts, xai.ts, vercel-ai-gateway.ts, zoo-gateway.ts:
Normalize all completePrompt methods to use {signal: metadata?.abortSignal}
Test fixes:
- gemini.spec.ts: Check config.abortSignal for both streaming and non-streaming tests
- native-ollama.spec.ts: Mock Ollama client with abort() method, assert no signal in options (per-request client pattern)
- deepseek.spec.ts: Move abortSignal suite out of parent test, assert from request options (2nd arg)
- vercel-ai-gateway.spec.ts: Add second argument assertion to completePrompt tests
- zoo-gateway.spec.ts: Add second argument assertion to completePrompt tests
Capture per-request client's abort() spy and add tests for:
- controller.abort() triggering the captured abort spy
- pre-aborted signals calling abort() immediately
- no abortSignal provided not calling abort()
0 commit comments