Summary
Selecting a model from :model can persist an invalid (provider_id, model_id) pair when the chosen model belongs to a different provider than the current default provider.
This leaves Forge in a corrupted session state such as:
[session]
provider_id = "fireworks-ai"
model_id = "glm-5.1"
That pair is invalid because glm-5.1 belongs to the ZAI providers, not Fireworks.
Impact
- The UI can show one provider while the selected model belongs to another provider.
- Subsequent requests may route to an unexpected upstream.
- Error messages become misleading because the persisted config no longer reflects a valid provider/model pair.
Repro
- Start Forge with a valid Fireworks provider selected.
- Use
:model and select glm-5.1 from the all-provider model picker.
- Inspect
~/forge/.forge.toml.
- Observe an invalid pair like:
[session]
provider_id = "fireworks-ai"
model_id = "glm-5.1"
Expected
Selecting a model from another provider should also switch the active provider, or the selection should be rejected.
Actual
Forge updates only the model, leaving the previous provider in place.
Notes
A local patch in crates/forge_main/src/ui.rs fixes this by resolving the selected model's owning provider and calling provider activation when the model crosses provider boundaries.
Summary
Selecting a model from
:modelcan persist an invalid(provider_id, model_id)pair when the chosen model belongs to a different provider than the current default provider.This leaves Forge in a corrupted session state such as:
That pair is invalid because
glm-5.1belongs to the ZAI providers, not Fireworks.Impact
Repro
:modeland selectglm-5.1from the all-provider model picker.~/forge/.forge.toml.Expected
Selecting a model from another provider should also switch the active provider, or the selection should be rejected.
Actual
Forge updates only the model, leaving the previous provider in place.
Notes
A local patch in
crates/forge_main/src/ui.rsfixes this by resolving the selected model's owning provider and calling provider activation when the model crosses provider boundaries.