Add configuration for dynamic sub-agent model routing to prevent model hallucination
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Currently, the agent frequently hallucinates model names during dynamic sub-agent calls. For example, if a provider has an invalid model like gpt-5-codex-mini, the agent attempts to call openai/gpt-5-codex-mini. Since it doesn't exist, the call fails, and the system ends up returning the full list of models as a fallback.
Proposed Solution Introduce a new configuration option to control whether the available model list is injected into the tool arguments description. This will allow us to hide the list from the agent when needed or strictly enforce a provided list.
Add a new configuration key dynamic-subagent-model with the following options:
inherited: Dynamic routing is bypassed. The sub-agent simply inherits the model from the parent agent.
system-provided: The agent is provided with a list of available models in the tool description. (Note: We might need some prompt engineering/improvements here to ensure the model actually respects the provided list).
user-provided: The list is removed from the tool args description entirely. The agent is "blind" to the system's models and simply passes along whatever the user requested in the prompt. It has been verified that this option removes the problem mentioned https://github.com/editor-code-assistant/eca/issues/369.
Isn't needed, the current default looks good (no list, user can specify model manually).