Summary
The Rig agent path does not use the configured [llm].model or the CODEGRAPH_MODEL environment variable. With Anthropic selected, it defaults to claude-sonnet-4-20250514 unless CODEGRAPH_LLM_MODEL or CODEGRAPH_AGENT_MODEL is set.
This makes CLI/config output misleading and can unexpectedly route requests to a more constrained or more expensive model.
Related
- No matching issue or PR found for
CODEGRAPH_MODEL, CODEGRAPH_LLM_MODEL, Rig model selection, or Anthropic defaulting to Sonnet.
Clean Reproduction
Config file:
[llm]
provider = "anthropic"
model = "claude-haiku-4-5"
context_window = 200000
max_retries = 1
Environment:
CODEGRAPH_LLM_PROVIDER=anthropic
CODEGRAPH_MODEL=claude-haiku-4-5
Official MCP call with correct project id:
{
"name": "agentic_context",
"arguments": {
"query": "Find where this feature is implemented. Return concrete files and symbols.",
"focus": "search",
"limit": 1
}
}
Observed error shows the request went to Sonnet, not Haiku:
429 Too Many Requests ...
model: claude-sonnet-4-20250514
rate limit of 30,000 input tokens per minute
When rerun with:
CODEGRAPH_LLM_MODEL=claude-haiku-4-5
CODEGRAPH_AGENT_MODEL=claude-haiku-4-5
the same path used Haiku:
model: claude-haiku-4-5-20251001
rate limit of 50,000 input tokens per minute
Code Evidence
crates/codegraph-mcp-rig/src/adapter/llm_adapter.rs:
pub fn get_model_name() -> String {
env::var("CODEGRAPH_LLM_MODEL")
.or_else(|_| env::var("CODEGRAPH_AGENT_MODEL"))
.unwrap_or_else(|_| default_model_for_provider())
}
fn default_model_for_provider() -> String {
match RigProvider::from_env() {
Ok(RigProvider::Anthropic) => "claude-sonnet-4-20250514".to_string(),
// ...
}
}
The Rig path does not read config.llm.model from ConfigManager and does not read CODEGRAPH_MODEL, even though ConfigManager supports CODEGRAPH_MODEL.
Expected
Model selection should be consistent across config and runtime paths:
[llm].model should affect the Rig MCP path.
CODEGRAPH_MODEL should either work consistently or be documented as not applicable.
- If Rig requires
CODEGRAPH_LLM_MODEL, the CLI/config docs should make that explicit.
Actual
The official MCP Rig path silently defaults Anthropic to Sonnet despite config/env selecting Haiku.
Impact
Users can unknowingly run a different model from the one configured, changing cost, quality, context limits, and provider rate-limit behavior.
Summary
The Rig agent path does not use the configured
[llm].modelor theCODEGRAPH_MODELenvironment variable. With Anthropic selected, it defaults toclaude-sonnet-4-20250514unlessCODEGRAPH_LLM_MODELorCODEGRAPH_AGENT_MODELis set.This makes CLI/config output misleading and can unexpectedly route requests to a more constrained or more expensive model.
Related
CODEGRAPH_MODEL,CODEGRAPH_LLM_MODEL, Rig model selection, or Anthropic defaulting to Sonnet.Clean Reproduction
Config file:
Environment:
Official MCP call with correct project id:
{ "name": "agentic_context", "arguments": { "query": "Find where this feature is implemented. Return concrete files and symbols.", "focus": "search", "limit": 1 } }Observed error shows the request went to Sonnet, not Haiku:
When rerun with:
the same path used Haiku:
Code Evidence
crates/codegraph-mcp-rig/src/adapter/llm_adapter.rs:The Rig path does not read
config.llm.modelfromConfigManagerand does not readCODEGRAPH_MODEL, even thoughConfigManagersupportsCODEGRAPH_MODEL.Expected
Model selection should be consistent across config and runtime paths:
[llm].modelshould affect the Rig MCP path.CODEGRAPH_MODELshould either work consistently or be documented as not applicable.CODEGRAPH_LLM_MODEL, the CLI/config docs should make that explicit.Actual
The official MCP Rig path silently defaults Anthropic to Sonnet despite config/env selecting Haiku.
Impact
Users can unknowingly run a different model from the one configured, changing cost, quality, context limits, and provider rate-limit behavior.