Skip to content

Fix raw TOML agent spawn model/provider override behavior#190

Open
loydccc wants to merge 1 commit intoRightNow-AI:mainfrom
loydccc:fix/raw-toml-model-override-respected
Open

Fix raw TOML agent spawn model/provider override behavior#190
loydccc wants to merge 1 commit intoRightNow-AI:mainfrom
loydccc:fix/raw-toml-model-override-respected

Conversation

@loydccc
Copy link

@loydccc loydccc commented Mar 2, 2026

Summary

Fixes model override behavior during agent spawn so explicit manifest model selections are respected.

When spawning agents, default_model is now only overlaid if the manifest model config is still at built-in defaults (and has no per-agent �pi_key_env/�ase_url override).

Problem

Raw TOML agent manifests could specify a custom provider/model, but spawn logic still replaced them with config.default_model whenever �pi_key_env and �ase_url were absent.

Changes

  • Added should_apply_default_model_overlay(model: &ModelConfig) -> bool in crates/openfang-kernel/src/kernel.rs.
  • Updated both spawn-time and restore-time default model overlay checks to use this helper.
  • Added regression tests:
    • est_should_apply_default_model_overlay_for_built_in_defaults
      
    • est_should_not_apply_default_model_overlay_for_explicit_model
      
    • est_should_not_apply_default_model_overlay_with_custom_key_or_url
      

Validation

  • cargo fmt --all
  • cargo test -p openfang-kernel default_model_overlay

Closes #189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raw TOML spawn overrides explicit model/provider with default_model

1 participant