Problem
The model setting in config.toml and the GOODWIZARD_MODEL env var are read at runtime and logged correctly, but the ReAct strategy ignores them. The agent always uses the model hardcoded in the use Jido.AI.Agent macro in agent.ex.
Expected behavior
# config.toml
[agent]
model = "openai:gpt-4o"
or
GOODWIZARD_MODEL=openai:gpt-4o
Should make the agent use openai:gpt-4o. Instead it uses whatever is in:
# agent.ex
use Jido.AI.Agent,
model: "anthropic:claude-sonnet-4-5", # ← this always wins
What happens
- Config loads correctly:
Config loaded from config.toml, model=openai:gpt-4o
- Agent starts with compiled model:
model: "anthropic:claude-sonnet-4-5" (visible in strategy config in logs)
- LLM call uses Anthropic → fails if only
OPENAI_API_KEY is set
Root cause
The model: option in use Jido.AI.Agent is captured at compile time by the macro and baked into the strategy config. Goodwizard.Config.model() reads the runtime value but nothing wires it into the ReAct strategy's config.model.
The TurnSetup.prepare/2 hook (called on_before_cmd) hydrates the system prompt and memory each turn, but doesn't override the strategy's model.
Impact
- Changing models requires editing
agent.ex and sub_agent.ex source code and recompiling
- The config system gives a false impression that the model is configurable at runtime
- Users setting
GOODWIZARD_MODEL or editing config.toml will get unexpected behavior
Suggested fix
In TurnSetup.prepare/2 or on_before_cmd, read Config.model() and update the strategy config:
# Pseudocode — wire runtime model into strategy
configured_model = Goodwizard.Config.model()
agent = update_in(agent.state.__strategy__.config.model, fn _ -> configured_model end)
This would make the runtime config actually take effect for LLM calls.
Problem
The
modelsetting inconfig.tomland theGOODWIZARD_MODELenv var are read at runtime and logged correctly, but the ReAct strategy ignores them. The agent always uses the model hardcoded in theuse Jido.AI.Agentmacro inagent.ex.Expected behavior
or
Should make the agent use
openai:gpt-4o. Instead it uses whatever is in:What happens
Config loaded from config.toml, model=openai:gpt-4omodel: "anthropic:claude-sonnet-4-5"(visible in strategy config in logs)OPENAI_API_KEYis setRoot cause
The
model:option inuse Jido.AI.Agentis captured at compile time by the macro and baked into the strategy config.Goodwizard.Config.model()reads the runtime value but nothing wires it into the ReAct strategy'sconfig.model.The
TurnSetup.prepare/2hook (calledon_before_cmd) hydrates the system prompt and memory each turn, but doesn't override the strategy's model.Impact
agent.exandsub_agent.exsource code and recompilingGOODWIZARD_MODELor editingconfig.tomlwill get unexpected behaviorSuggested fix
In
TurnSetup.prepare/2oron_before_cmd, readConfig.model()and update the strategy config:This would make the runtime config actually take effect for LLM calls.