#19114: feat(usage): add default model costs for session_status
size: S
trusted-contributor
Cluster:
Model Fallbacks and Rate Limiting
Add built-in cost defaults for common models so session_status can show cost estimates without manual configuration.
Recreated from #18138 with only relevant files.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added built-in default cost configurations for common AI models (OpenAI GPT-4o/mini/turbo, Anthropic Claude 3.5 Sonnet/Haiku/Opus, Google Gemini 1.5 Pro/Flash, DeepSeek Chat) to enable cost estimation in `session_status` without requiring manual configuration.
- Enhanced `resolveModelCostConfig` to fallback to default costs when user config is not available
- Removed requirement for provider parameter (now works with model name alone)
- Implemented fuzzy matching to handle model names with provider prefixes (e.g., `anthropic/claude-3-5-sonnet-20240620`)
- Added comprehensive test coverage for exact match, fuzzy match, unknown models, and config override priority
- User config overrides still take precedence over defaults
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no significant risks
- The implementation is straightforward and low-risk: adds default cost data, enhances fallback logic, and includes comprehensive tests. The changes preserve backward compatibility (user config overrides still work), don't modify any runtime behavior beyond adding defaults, and follow existing code patterns. The fuzzy matching logic is simple and defensive.
- No files require special attention
<sub>Last reviewed commit: 17e5da8</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#13658: fix: silent model failover with fallback notification
by taw0002 · 2026-02-10
73.5%
#8258: feat: Add smart model tiering for cost optimization
by revenuestack · 2026-02-03
72.9%
#13215: fix: pass agentId to loadCostUsageSummary in /usage cost command
by veast · 2026-02-10
72.0%
#17538: feat(sessions): add resolvedModel field
by Facens · 2026-02-15
71.3%
#16543: [AI-assisted] feat(usage): support cache-hit differentiated pricing
by OwenJiong24 · 2026-02-14
71.0%
#13626: fix(model): propagate provider model properties in fallback resolution
by mcaxtr · 2026-02-10
70.9%
#9822: fix: allow local/custom model providers for sub-agent inference
by stammtobias91 · 2026-02-05
70.8%
#11901: feat: enhance /total_usage command with time units, model breakdown...
by cclank · 2026-02-08
70.7%
#13889: feat: Slack channel cache, session cost alerts & checkpoint/recover...
by trevorgordon981 · 2026-02-11
70.7%
#13650: feat(agents): support env var overrides for default provider and model
by xrehpicx · 2026-02-10
70.5%