_resolve_endpoint raises ValueError when provider/model in agent config is not a string
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
Research direction
Start in artemis/services/llm.py at _resolve_endpoint and compare provider/model handling with the other fields using _get_val. Run tests/unit/agents/test_explorer.py to reproduce the nine failures. Done means non-string provider or model attributes use the documented string defaults and the affected tests pass.
Written by the indexing model from the issue text.
Description
In artemis/services/llm.py, _resolve_endpoint extracts provider_val and model_val using bare getattr:
provider_val = getattr(cfg, "provider", "google")
model_val = getattr(cfg, "model", "gemini-2.5-flash")
While other fields in the same function use _get_val(obj, attr, expected_type) to safely validate types, provider_val and model_val do not. When cfg has non-string or mock attributes (such as in tests/unit/agents/test_explorer.py), getattr does not fall back to the default string, causing ModelProvider.from_string to raise:
ValueError: Unknown LLM provider <MagicMock name='mock.llm_config.get_agent().provider'>. Valid providers: ['anthropic', 'claude', 'custom', 'gemini', 'google', 'grok', 'ollama', 'openai', 'openrouter', 'vertex', 'vertexai', 'vllm', 'xai']
This currently breaks 9 unit tests in tests/unit/agents/test_explorer.py.
Fix
Use _get_val(cfg, "provider", str) or "google" and _get_val(cfg, "model", str) or "gemini-2.5-flash" consistent with the other fields in _resolve_endpoint.
- Dominant language
- Python
- Stars
- 8.2k
- Forks
- 779
- Avg merge
- 20m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/artemis
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100