← Back to PRs

#19114: feat(usage): add default model costs for session_status

by Clawborn open 2026-02-17 11:36 View on GitHub →
size: S trusted-contributor
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