fix(ai-connectors): preserve workspace fallback chain and node fallbackProviderKey when overrideProviderKey is set
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- ai, backend-api-design
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 1
- Merge medio
- 6m
- PR unite (30g)
- 27
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sumamakhan761/tryinstance
-
backend good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
sumamakhan761/tryinstance#65 ·
I maintainer di solito rispondono entro 1 giorno
-
backend good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
sumamakhan761/tryinstance#64 ·
I maintainer di solito rispondono entro 1 giorno
-
backend good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
sumamakhan761/tryinstance#63 ·
I maintainer di solito rispondono entro 1 giorno
-
backend good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
sumamakhan761/tryinstance#62 ·
I maintainer di solito rispondono entro 1 giorno
-
backend good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
sumamakhan761/tryinstance#60 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sumamakhan761/tryinstance
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
makecindy/cindy#15342 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
kwitsch/claude-code-plugin-tooling#219 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
no-repo-link tool-submission
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100