Skip to content

L1B-02: Replace single fallback with fallback chain - #3

Merged
r-uben merged 1 commit into
mainfrom
feat/fallback-chain
Mar 18, 2026
Merged

L1B-02: Replace single fallback with fallback chain#3
r-uben merged 1 commit into
mainfrom
feat/fallback-chain

Conversation

@r-uben

@r-uben r-uben commented Mar 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace fallback_engine: EngineType with fallback_chain: list[EngineType] in config
  • Default chain: [gemini] (preserves current behavior)
  • StandardPipeline._run_fallback() now tries each engine in the chain until one succeeds
  • EngineRouter.select_fallback() iterates the chain; new select_fallback_chain() returns full ordered list
  • Backward compat: fallback_engine property wraps chain access, legacy YAML still works

Test plan

  • 15 new/updated routing tests + existing tests all pass
  • Covers: chain iteration, unavailable skipping, primary exclusion, empty chain, backward compat

- Config: `fallback_chain: list[EngineType]` replaces `fallback_engine` field
  (default: [gemini], preserving current behavior)
- Backward compat: property `fallback_engine` reads/writes first chain element;
  YAML `fallback_engine` key auto-wraps into a single-element chain
- Router: `select_fallback()` iterates chain in order, falls back to auto;
  new `select_fallback_chain()` returns full ordered list of available fallbacks
- Processor: `_run_fallback()` tries each chain engine until one succeeds
- Tests: 15 routing tests covering chain iteration, skipping unavailable/primary,
  empty chain, backward compat property, and select_fallback_chain

Implements L1B-02.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant