refactor(api): move hand-written abort bridges to the shared helper
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- eslint, typescript
- Lĩnh vực
- backend-api-design, devtools
Hướng nghiên cứu
Start with src/api/providers/utils/abort-signal.ts and its callers, then review the listed provider locations and tests. The work covers seven providers, timeout helper consolidation, and two lint selectors, so map each special callback and controller use before changing the shared helper. Done means the providers’ tests pass and both selectors have zero violations, while the two fetchers/modelCache.ts listeners remain untouched.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Seven providers on main bridge the caller's abortSignal with their own AbortController and abort listener. bridgeExternalAbortSignal in src/api/providers/utils/abort-signal.ts does the same work. anthropic.ts, anthropic-vertex.ts, minimax.ts and xai.ts already use it. Each hand-written copy adds one more place for a listener leak or a missed pre-aborted check.
Sites at origin/main 66b07e0e65:
-
bedrock.ts(~593): its 10-minute timer also aborts the request controller. -
lm-studio.ts(~137) andqwen-code.ts(~293): both need a signal even with no caller signal, and abort the controller infinally. -
openai-native.ts(~471,attachExternalAbort): the controller is exposed to the stop-button path. -
openai-codex.ts(~524): both transports abort through the controller. -
native-ollama.ts(~481 and ~736): the abort callback also callsclient.abort(). -
vscode-lm.ts(~1198 and ~1684): the callback cancels a token source and recordsabortedByCaller.
fetchers/modelCache.ts has two abort listeners. They are not request bridges, so leave them as they are.
The helper returns only a signal, and returns undefined when there is no caller signal. Most sites above need a controller or an extra callback. Extend the helper first, for example with an optional controller and an onAbort hook. Then migrate each site and keep its provider tests green.
Also in scope:
-
mainhas twocreateTimeoutErrorhelpers: one inutils/abort-signal.tsand one inutils/request-timeout.tswith a phase argument. Keep one. Move the callers. - After the migration, add a lint selector in
packages/config-eslint/api-provider-hygiene.jsthat flagsaddEventListener("abort", …)outside the helper. Add one that flags a hand-builtTimeoutError. Both need zero violations when they land.
Context: review of #1535 and the open abort PRs #1545 and #1311.
- Ngôn ngữ chính
- TypeScript
- Star
- 2k
- Fork
- 301
- Merge trung bình
- 3 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 103
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Zoo-Code-Org/Zoo-Code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Zoo-Code-Org/Zoo-Code#2773 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Zoo-Code-Org/Zoo-Code#2717 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Zoo-Code-Org/Zoo-Code#2515 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
fix(scripts): stryker-diff.mjs spawns the extensionless .bin shim and cannot run on WindowsCó thể đã có người làm @easonLiangWorldedtech đã nhận 15 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Zoo-Code-Org/Zoo-Code#2514 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[BUG] search_files hides matching text on long linesCó thể đã có người làm @DananjayaNadun đã nhận 9 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Zoo-Code-Org/Zoo-Code#2496 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của Zoo-Code-Org/Zoo-Code
Issue tương tự
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
tashfeenahmed/freellmapi#2169 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
vercel-labs/ui#1563 ·
Maintainer thường phản hồi trong vòng 1 ngày