Skip to content

Commit 5bccb07

Browse files
committed
fix(providers): seed llama-swap default model and fix rustfmt
Codex review: an empty `models` list makes `default_model` become "" in `ProviderRegistry::register_with_name`, which causes onboarding paths to persist an empty `GOOSE_MODEL` and fall back to app defaults instead of the selected provider. Seed with `qwen3` (matching the ollama default) so the provider has a usable placeholder until the dynamic `/v1/models` fetch populates the real list. Also collapse a multi-line `assert_eq!` to satisfy `cargo fmt --check`.
1 parent 3059214 commit 5bccb07

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/goose/src/config/declarative_providers.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,11 +543,9 @@ mod tests {
543543
assert!(config.skip_canonical_filtering);
544544
assert_eq!(config.dynamic_models, Some(true));
545545
assert_eq!(config.supports_streaming, Some(true));
546-
assert_eq!(
547-
config.base_url,
548-
"${LLAMA_SWAP_HOST}/v1/chat/completions"
549-
);
550-
assert!(config.models.is_empty());
546+
assert_eq!(config.base_url, "${LLAMA_SWAP_HOST}/v1/chat/completions");
547+
assert_eq!(config.models.len(), 1);
548+
assert_eq!(config.models[0].name, "qwen3");
551549

552550
let env_vars = config.env_vars.as_ref().expect("env_vars should be set");
553551
assert_eq!(env_vars.len(), 1);

crates/goose/src/providers/declarative/llama_swap.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
}
1717
],
1818
"dynamic_models": true,
19-
"models": [],
19+
"models": [
20+
{ "name": "qwen3", "context_limit": 32768 }
21+
],
2022
"supports_streaming": true,
2123
"requires_auth": false,
2224
"skip_canonical_filtering": true

0 commit comments

Comments
 (0)