refactor(api): move hand-written abort bridges to the shared helper
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- eslint, typescript
- Área
- backend-api-design, devtools
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2k
- Forks
- 301
- Merge medio
- 3 d 14 h
- PR fusionados (30 d)
- 103
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Zoo-Code-Org/Zoo-Code
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Zoo-Code-Org/Zoo-Code#2773 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Zoo-Code-Org/Zoo-Code#2717 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Zoo-Code-Org/Zoo-Code#2515 ·
Los mantenedores suelen responder en 3 días
-
fix(scripts): stryker-diff.mjs spawns the extensionless .bin shim and cannot run on WindowsPosiblemente ocupada @easonLiangWorldedtech la tomó hace 15 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Zoo-Code-Org/Zoo-Code#2514 ·
Los mantenedores suelen responder en 3 días
-
[BUG] search_files hides matching text on long linesPosiblemente ocupada @DananjayaNadun la tomó hace 9 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Zoo-Code-Org/Zoo-Code#2496 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 3 días
Todos los issues de Zoo-Code-Org/Zoo-Code
Issues similares
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
tashfeenahmed/freellmapi#2169 ·
Los mantenedores suelen responder en 1 día
-
via-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
vercel-labs/ui#1563 ·
Los mantenedores suelen responder en 1 día