free-claude-code/e2e
Ali Khokhar 4e99ddaa5c
Some checks are pending
Post merge / Warm dependency cache (Linux) (push) Waiting to run
Post merge / Warm dependency cache (Windows) (push) Waiting to run
Post merge / Warm dependency cache (macOS) (push) Waiting to run
Post merge / Publish to PyPI (push) Waiting to run
minor: select API keys for fallback models (#2058)
## Why

Fallback rows could choose a model and reasoning effort but always used
the provider's first API key. Users need to choose which numbered key
each fallback uses, including different keys for the same model.

## How

Add a Key N selector and persist a validated `api_key_number`,
defaulting existing entries to Key 1. Reject duplicate model/key pairs
and key removals that leave a saved fallback's selection unavailable.

Carry the number through routing and the request's retained runtime
generation. Cache and construct clients per provider/key pair so
concurrent attempts keep their selected credentials.

Share rate and concurrency capacity across a provider's keys, while
recovery belongs to the actual credential. A healthy selected fallback
key receives an attempt after another key exhausts rate-limit retries.
Reordering a key preserves its recovery state, and replacing it uses a
separate state. Keep the existing retry classification, attempt count,
and backoff.

Refresh key choices after provider edits while preserving unsaved model
drafts. Display removed numbers as unavailable and reset the choice to
Key 1 when a row changes provider. Numbers follow the current order in
the provider's settings. Providers with another authentication method
show a disabled default selection.

The Admin editor targets desktop viewports, as requested. Its existing
rows and add row keep the three selections aligned horizontally.

Local CI passes, including 9,049 Python tests and 277 browser tests.
Added regressions capture actual authentication headers after 403 and
exhausted 429 failures across both public APIs and all three custom
endpoint formats, and check shared capacity, client coalescing, retained
generations, credential reorder/replacement, and Admin edits.


<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.greptile.com/api/retrigger?id=79105240"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a>Confidence Score: 5/5</h2>

<!-- greptile-impact-verdict --> No outstanding blocking findings were
identified. The reviewed changes are safe to merge.

<details open><summary><h3>Summary</h3></summary>

Adds a numbered API-key choice to each fallback model and carries that
choice through routing and provider construction.

- Fallback rows can choose a numbered API key.
- Fallback attempts send requests with their selected API keys.
- Provider clients keep separate keys while sharing provider limits.
</details>

<!-- greptile_confidence_score:5 -->

<sub>Reviews (3) · Last reviewed commit: ["Keep credential recovery
separate from
p..."](c7c33ac61b)
· [Reviewed by
Greptile](https://www.greptile.com/?utm_source=greptile_expert&utm_medium=github&utm_campaign=code_reviews&utm_content=alishahryar1/free-claude-code)</sub>

<!-- /greptile_comment -->
2026-10-12 10:09:36 -07:00
..
__init__.py Add Code sessions powered by Codex (#1695) 2026-09-06 23:32:29 -07:00
artifacts.py patch: reduce pytest and browser test overhead (#2044) 2026-10-10 21:11:44 -07:00
code_support.py patch: Migrate messaging history to fcc.db (#1919) 2026-09-27 02:16:48 -07:00
conftest.py minor: select API keys for fallback models (#2058) 2026-10-12 10:09:36 -07:00
form_support.py Balance Admin spacing and stop treating API keys as passwords (#1779) 2026-09-12 18:35:21 -07:00
provider_support.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
server_shutdown.py minor: Add native VS Code Chat integration (#1915) 2026-09-26 20:29:01 -07:00
test_admin_apply.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
test_admin_assets.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
test_admin_integrations.py patch: add independent Claude onboarding (#2052) 2026-10-11 15:45:11 -07:00
test_admin_models.py minor: select API keys for fallback models (#2058) 2026-10-12 10:09:36 -07:00
test_admin_providers.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
test_admin_status_independence.py patch: Make Admin status checks independent (#1954) 2026-09-30 00:06:08 -07:00
test_admin_vscode_chat.py patch: unify SQLite transaction ownership for Code storage (#1931) 2026-09-27 19:58:31 -07:00
test_api_key_lists.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
test_claude_desktop_integration.py patch: Migrate messaging history to fcc.db (#1919) 2026-09-27 02:16:48 -07:00
test_code_sessions.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
test_connected_accounts.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
test_custom_providers.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
test_dsh_desktop_integration.py minor: support current DSH CLI and integrate DSH Desktop (#1961) 2026-10-01 01:37:40 -07:00
test_fallback_key_controls.py minor: select API keys for fallback models (#2058) 2026-10-12 10:09:36 -07:00
test_integration_notices.py minor: configure model routing and fallback effort (#2055) 2026-10-11 21:04:00 -07:00
test_jetbrains_acp_integration.py Connect Claude Code in JetBrains ACP (#1848) 2026-09-20 19:18:57 -07:00
test_messaging_storage_recovery.py patch: Migrate messaging history to fcc.db (#1919) 2026-09-27 02:16:48 -07:00
test_progressive_startup.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
test_provider_modals.py minor: configure multiple API keys per provider (#2057) 2026-10-12 03:22:56 -07:00
test_tool_schema_patterns.py Preserve Artifact regex restrictions in shared Claude conversions (#1772) 2026-09-12 16:30:16 -07:00
thread_diagnostics.py patch: Update dependencies and fix CI diagnostics (#1902) 2026-09-25 15:34:42 -07:00