picoclaw/pkg
corevibe555 6ce0306c66
fix: use per candidate provider for model_fallbacks (#2143)
* fix: use per-candidate provider for model_fallbacks

Each fallback model now uses its own api_base and api_key from
model_list instead of inheriting the primary model's provider config.

Previously, a single LLMProvider was created from the primary model's
ModelConfig and reused for all fallback candidates — only the model ID
string was swapped. This caused all fallback requests to be routed to
the primary provider's endpoint, making cross-provider fallback chains
non-functional (e.g., OpenRouter primary with Gemini fallback would
send the Gemini request to OpenRouter's API).

Fix: pre-create a per-candidate LLMProvider at agent initialization
time by looking up each candidate's ModelConfig from model_list. The
fallback run closure now selects the correct provider per candidate
via CandidateProviders map, falling back to agent.Provider when no
override is found.

Fixes #2140

Made-with: Cursor

test: add test for instance.go

fix: fix test

refactor: optimize

fix: fix Golang lint issues

chore: comment cleanup

* refactor: use resolvedModelConfig() instead of buildModelIndex()

* fix
2026-04-07 20:07:56 +08:00
..
agent fix: use per candidate provider for model_fallbacks (#2143) 2026-04-07 20:07:56 +08:00
audio Refactor/asr tts (#1939) 2026-04-01 12:21:21 +08:00
auth Merge branch 'main' into t3 2026-03-29 01:25:20 +08:00
bus Refactor/asr tts (#1939) 2026-04-01 12:21:21 +08:00
channels feat(channels): add teams_webhook output-only channel (#2244) 2026-04-07 19:24:27 +08:00
commands resolve conflicts 2026-03-22 23:36:25 +01:00
config feat(channels): add teams_webhook output-only channel (#2244) 2026-04-07 19:24:27 +08:00
constants refactor: replace bool map with set-style map for internal channels (#472) 2026-02-19 11:48:17 +01:00
credential refactor config and security to simplified the structure (#2068) 2026-03-28 00:03:34 +08:00
cron refactor(cron): remove deliver and type params, unify agent execution path (#2147) 2026-03-29 22:52:34 +08:00
devices refactor: cleanup dead code and turn on dead code detection in CI (#515) 2026-02-24 21:52:25 +08:00
fileutil Merge pull request #1829 from perhapzz/test/add-fileutil-health-tests 2026-03-26 10:42:13 +01:00
gateway feat(channels): add teams_webhook output-only channel (#2244) 2026-04-07 19:24:27 +08:00
health add pid file for gateway running and auth token for /reload and pico channel 2026-03-29 01:14:39 +08:00
heartbeat fix(heartbeat): ignore untouched default template 2026-03-15 21:58:21 +08:00
identity fix(identity): support negative integers in isNumeric for Telegram group IDs 2026-03-21 17:09:02 +07:00
logger unify all panic event to panic log file (#2250) 2026-04-01 23:26:49 +08:00
mcp feat(mcp): support DisableStandaloneSSE for HTTP transport (#2108) 2026-03-29 14:37:22 +08:00
media Fix 1886 media cleanup policy (#1887) 2026-03-23 12:13:59 +08:00
memory feat(seahorse): implement short-term memory engine (LCM) (#2285) 2026-04-05 09:05:16 +08:00
migrate add pid file for gateway running and auth token for /reload and pico channel 2026-03-29 01:14:39 +08:00
pid fix(gateway): harden PID liveness handling and websocket proxy state (#2403) 2026-04-07 16:34:42 +08:00
providers feat(provider): support custom headers injection for HTTP providers (#2402) 2026-04-07 16:05:21 +08:00
routing refactor Config to add Version and migratable 2026-03-12 13:52:55 +08:00
seahorse fix(seahorse): correct bm25 rank semantics in comments (#2360) 2026-04-07 12:32:28 +08:00
session feat(seahorse): implement short-term memory engine (LCM) (#2285) 2026-04-05 09:05:16 +08:00
skills enhance skill installer (#1252) 2026-03-13 14:04:02 +08:00
state refactor Config to add Version and migratable 2026-03-12 13:52:55 +08:00
tokenizer feat(seahorse): implement short-term memory engine (LCM) (#2285) 2026-04-05 09:05:16 +08:00
tools fix(tool): clarify write_file nested-JSON escape semantics and add tests (#2320) 2026-04-04 17:56:49 +08:00
updater feat(updater): robust self-update selection & extraction (nightly default) (#2201) 2026-04-01 23:41:32 +08:00
utils Merge pull request #2176 from Alix-007/fix/issue-2135-retry-after 2026-03-30 16:27:46 +02:00
env.go Merge branch 'main' into version 2026-03-19 18:04:58 +08:00