Repository navigation
Closed
Description
Summary
Extract the duplicated provider abort helpers into src/api/providers/utils/abort-signal.ts after stacked PR #1288 lands, or after the dependent branch rebases onto it.
Required changes
- Move the shared
isRequestAbortedlogic from:src/api/providers/qwen-code.tssrc/api/providers/lm-studio.ts
intosrc/api/providers/utils/abort-signal.ts.
- Move
createAbortErrorintosrc/api/providers/utils/abort-signal.ts. - Make
createAbortErroraccept a provider-name parameter so each provider keeps its provider-specific abort message. - Replace the per-provider helper definitions with imports from the shared utility.
- Preserve the existing abort-detection behavior. The Qwen Code and LM Studio behavior must stay consistent.
Rationale
The helper implementations are intentionally duplicated while src/api/providers/utils/abort-signal.ts remains a frozen foundation contract in stacked PR #1288. After that dependency resolves, a shared implementation will prevent behavioral drift between OpenAI-compatible providers.
Affected areas
src/api/providers/utils/abort-signal.tssrc/api/providers/qwen-code.tssrc/api/providers/lm-studio.ts- Relevant provider and abort-signal tests
Acceptance criteria
isRequestAbortedhas one shared implementation insrc/api/providers/utils/abort-signal.ts.createAbortError(providerName)has one shared implementation insrc/api/providers/utils/abort-signal.ts.- Qwen Code and LM Studio use the shared helpers.
- Provider-specific abort error messages remain intact.
- Tests cover shared helper behavior and provider integration.
- The change is made only after feat(api): add throwIfAborted helper and completePrompt options regression tests #1288 lands, or after the target branch rebases onto its resolved foundation.
Backlinks
- Source PR: feat(api): abort-signal wiring for lm-studio and qwen-code (round 2) #1309
- Source review comment: feat(api): abort-signal wiring for lm-studio and qwen-code (round 2) #1309 (comment)
- Requested by: @easonLiangWorldedtech
Metadata
Metadata
Assignees
Labels
No labels
Activity