Skip to content

fix: case-insensitive agent name lookup in config (fixes #1097)#1175

Open
octo-patch wants to merge 5 commits into
Pythagora-io:mainfrom
octo-patch:fix/issue-1097-case-insensitive-agent-config
Open

fix: case-insensitive agent name lookup in config (fixes #1097)#1175
octo-patch wants to merge 5 commits into
Pythagora-io:mainfrom
octo-patch:fix/issue-1097-case-insensitive-agent-config

Conversation

@octo-patch

Copy link
Copy Markdown

Fixes #1097

Problem

When users configure per-agent model overrides in config.json, the agent name key must exactly match the internal Python class name (e.g. "CodeMonkey", "Importer"). When the case doesn't match (e.g. user writes "code_monkey" or "importer"), the lookup silently falls back to "default" with no warning, making overrides appear to have no effect.

Solution

Made llm_for_agent perform a case-insensitive match when the exact agent name is not found. This allows config keys like "codemonkey", "importer", or "specwriter" to correctly resolve to the "CodeMonkey", "Importer", and "SpecWriter" configurations respectively.

Also updated example-config.json to:

  • List all valid agent names in a comment
  • Add commented-out examples showing how to override individual agents

Testing

Added a test case test_case_insensitive_agent_lookup that verifies:

  • "codemonkey" resolves to the "CodeMonkey" config
  • Unknown agent names still fall back to "default"

All 11 existing tests continue to pass.

@CLAassistant

CLAassistant commented Apr 23, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 4 committers have signed the CLA.

❌ Zvonimir Sabljic
❌ github-actions[bot]
❌ LeonOstrez
❌ MarkoBosnjak98


Zvonimir Sabljic seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@LeonOstrez LeonOstrez force-pushed the main branch 2 times, most recently from 90f59f5 to a372904 Compare June 8, 2026 11:13
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.

[Bug]: agent provider overriding not working

4 participants