test(api): prove inherited caller cancellation for baseten, fireworks and sambanova

未關閉
#2,501 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 3 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
半天
新手友好度
45/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
typescript
領域
api, testing

研究方向

Read src/api/providers/base-openai-compatible-provider.ts first (the RequestConfigBuilder + throwIfAborted path from #1311) and compare it with the thin shells in src/api/providers/baseten.ts, fireworks.ts and sambanova.ts. Then read the existing base-openai-compatible-provider.spec.ts and base-openai-compatible-provider-timeout.spec.ts to copy their abort/timeout setup, and add one spec per provider next to the existing baseten.spec.ts / fireworks.spec.ts / sambanova.spec.ts asserting the inherited AbortError pass-through and the agreed timeout verdict. Done means those three specs pass against the merged base, the per-provider pass counts are recorded in the issue, and no provider-local abort wiring exists in the three files.

由索引模型根據 Issue 內容生成。

描述

Scope: verification only, no new wiring

baseten, fireworks and sambaNova are thin shells over the shared compatible base - at main 75a93a9d9acc each file is ~20 lines with no method overrides and no abort handling of its own:

src/api/providers/baseten.ts:6:  export class BasetenHandler extends BaseOpenAiCompatibleProvider<BasetenModelId> {
src/api/providers/fireworks.ts:7: export class FireworksHandler extends BaseOpenAiCompatibleProvider<FireworksModelId> {
src/api/providers/sambanova.ts:7: export class SambaNovaHandler extends BaseOpenAiCompatibleProvider<SambaNovaModelId> {

git grep -c -F abortSignal returns nothing for all three: they receive caller cancellation and the request timeout entirely through base-openai-compatible-provider.ts (the RequestConfigBuilder + throwIfAborted path that #1311 adds). They therefore need no provider-specific patch PR, and they are not part of the seven hand-written bridges listed in #2486.

Acceptance criteria (after #1311 merges)

  1. Re-run baseten.spec.ts, fireworks.spec.ts, sambanova.spec.ts together with base-openai-compatible-provider.spec.ts and base-openai-compatible-provider-timeout.spec.ts against the merged base, and record the pass/fail count per provider in this issue.
  2. Add one small regression spec per provider pinning the inherited contract rather than the base contract:
    • a pre-aborted caller rejects with name === "AbortError" before any HTTP request is issued;
    • a cancel during the request rejects with AbortError and is not re-wrapped with the provider's own error prefix;
    • a timeout expiry surfaces with the verdict that #2486 U0b settles for this family (TimeoutError from createTimeoutError(providerName, phase) vs the gateway family's AbortError) - the specs must not drift per provider.
  3. Confirm no provider-local AbortController / addEventListener("abort") appears in the three files, so #2486 U7 can keep the hygiene selectors strict.

Budget

Three focused specs in one PR, roughly 120 a+d total; no production file changes expected unless a criterion above fails.

Dependencies

  • #1311 (the compatible-base cancellation they inherit) must merge first.
  • #2486 U0b decides the timeout verdict this issue must pin.
  • #616 (abort pass-through umbrella) is the tracker to close once these three are proven.

Sibling families that inherit rather than patch, for the same record: deepseek / mimo / moonshot / kimi-code via OpenAiHandler (covered by #1311 specs), github-copilot via VsCodeLmHandler (#2486 U6), vertex via GeminiHandler.

主要語言
TypeScript
星號
2k
分支
301
平均合併
3 天 14 小時
30 天內合併 PR
103

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

Zoo-Code-Org/Zoo-Code 的其他 Issue

查看 Zoo-Code-Org/Zoo-Code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。