picoclaw/pkg/config
Bijin 38e1fe435a
fix(config): model_list inherits api_key/api_base from providers (#1786)
When both providers and model_list are configured, model_list entries
with empty api_key or api_base now automatically inherit from the
matching provider (matched by protocol prefix in the Model field).

Example: a model_list entry with model='deepseek/deepseek-chat' and
no api_key will inherit from providers.deepseek.api_key.

Explicit model_list values always take precedence.

Changes:
- Add InheritProviderCredentials() in migration.go
- Call it in LoadConfig() after provider-to-model-list conversion
- Add protocolProviderMapping for all 25 supported protocols
- 6 new tests covering inheritance, precedence, and edge cases

Closes #1635
2026-03-19 21:24:46 +08:00
..
config.go fix(config): model_list inherits api_key/api_base from providers (#1786) 2026-03-19 21:24:46 +08:00
config_test.go feat: Add Novita provider support (#1677) 2026-03-18 18:29:27 +08:00
defaults.go feat(tool): debug tool usage via channels (#1332) 2026-03-19 18:08:50 +08:00
envkeys.go refactor: centralize environment variable key constants (#1730) 2026-03-18 18:03:24 +08:00
migration.go fix(config): model_list inherits api_key/api_base from providers (#1786) 2026-03-19 21:24:46 +08:00
migration_test.go fix(config): model_list inherits api_key/api_base from providers (#1786) 2026-03-19 21:24:46 +08:00
model_config_test.go fix(config): start model round robin from the first match 2026-03-17 21:59:04 +08:00
multikey_test.go feat(config): support multiple API keys for failover (#1707) 2026-03-19 00:57:20 +08:00
version.go feat:Modify the location where version is obtained, and insert version information into the context (#1300) 2026-03-10 17:42:05 +08:00
version_test.go feat:Modify the location where version is obtained, and insert version information into the context (#1300) 2026-03-10 17:42:05 +08:00