fix(ai-connectors): preserve workspace fallback chain and node fallbackProviderKey when overrideProviderKey is set
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- ai, backend-api-design
Línea de trabajo
Start with dispatchWithFallback in packages/ai-connectors/src/gateway.ts and dispatchCompletion in apps/api/src/ai-connectors/ai-connectors.service.ts to trace how provider options reach the gateway and how candidates are ordered. Then read packages/ai-connectors/src/gateway.spec.ts and add coverage for fallback after an overridden provider fails. Done means the override is tried first, configured fallback providers are tried in order, and full-chain failure still triggers handoff.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem Description
-
Node-level
overrideProviderKeydrops all configured backups:
Inpackages/ai-connectors/src/gateway.ts(AiGatewayService.dispatchWithFallback, lines 50-98), whenrequest.overrideProviderKeymatches an active connector,candidatesis populated with only that single provider. Because the remaining workspace connectors (fallbackTier1, 2, 3) and optionalsystemFallbackKeyare wrapped inif (candidates.length === 0)(lines 69 & 92), they are all skipped for that request.
If the overridden provider returns429or times out,dispatchWithFallbackimmediately fails and triggersonFullChainFailureinstead of falling back through the workspace's configured tiers. -
fallbackProviderKeyandfallbackModelIdare ignored:
AiConnectorsService.dispatchCompletion(apps/api/src/ai-connectors/ai-connectors.service.ts, lines 475-494) acceptsoptions.fallbackProviderKeyandoptions.fallbackModelId(andAiCompletionRequestinpackages/types/src/ai-connectors.tslines 95-96 defines them), butmergedRequestnever forwards them andgateway.tsnever reads them.
Expected Behavior
- Setting
overrideProviderKeyshould try that provider first — not discard the rest of the fallback chain. candidatesshould be built as an ordered, deduplicated list:overrideProviderKey/overrideModelId(if set and usable)fallbackProviderKey/fallbackModelId(if set and usable)- Remaining active workspace
connectorssorted byfallbackTier(Tier 1 -> Tier 2 -> Tier 3) - Optional
systemFallbackKey(only if configured)
- If every provider in the chain fails,
onFullChainFailure(Human Handoff) still triggers as before.
Where to Look
packages/ai-connectors/src/gateway.ts(dispatchWithFallback, lines 40-102)apps/api/src/ai-connectors/ai-connectors.service.ts(dispatchCompletion, lines 475-494)packages/types/src/ai-connectors.ts(AiCompletionRequest, lines 88-99)packages/ai-connectors/src/gateway.spec.ts
Solution / Implementation Guide
- Forward fallback options (
ai-connectors.service.ts):- In
dispatchCompletion(lines 490-494), includefallbackProviderKeyandfallbackModelIdinmergedRequestwhen provided inoptions.
- In
- Build a deduplicated ordered
candidateslist (gateway.ts):- Remove the
if (candidates.length === 0)guard around workspaceconnectorsandsystemFallbackKey. - Add a small helper
addCandidate(...)keyed by${providerKey}:${modelId}to append in order:request.overrideProviderKey/request.overrideModelIdrequest.fallbackProviderKey/request.fallbackModelId- Active
connectorssorted byfallbackTier systemFallbackKey(when present)
- Remove the
- Add unit test (
gateway.spec.ts):- Verify that when
overrideProviderKeyfails,dispatchWithFallbackcascades tofallbackProviderKey/ Tier 1 / Tier 2 connectors instead of failing immediately.
- Verify that when
- Lenguaje dominante
- TypeScript
- Estrellas
- 2
- Forks
- 1
- Merge medio
- 6 min
- PR fusionados (30 d)
- 27
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin 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 sumamakhan761/tryinstance
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sumamakhan761/tryinstance#65 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
sumamakhan761/tryinstance#64 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
sumamakhan761/tryinstance#63 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sumamakhan761/tryinstance#62 ·
Los mantenedores suelen responder en 1 día
-
backend good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sumamakhan761/tryinstance#60 ·
Los mantenedores suelen responder en 1 día
Todos los issues de sumamakhan761/tryinstance
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
makecindy/cindy#15342 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
kwitsch/claude-code-plugin-tooling#219 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
no-repo-link tool-submission
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100