fix: unknown model pricing — better error options and accurate issue title#45985
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add Option 2 in unknown_model_ai_credits.md showing how to add model pricing via models.providers in frontmatter - Remove the incorrect defaultAiCreditsPricing: 3.0 sample (Option 3) and renumber remaining options - Add unknownModelAICredits flag to buildFailureIssueTitle with higher priority than isTimedOut, so the issue title accurately reflects the model pricing error instead of showing 'timed out' - Pass unknownModelAICredits at the call site - Add test cases for the new flag and priority behavior Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot give examples for all fields (cached...) |
…cing example Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done — the cost:
input: "3.75e-06" # $3.75 per million input tokens (required)
output: "1.5e-05" # $15.00 per million output tokens (required)
cache_read: "3.75e-07" # $0.375 per million cached-read tokens (optional)
cache_write: "4.5e-06" # $4.50 per million cache-write tokens (optional)
reasoning: "1.5e-05" # $15.00 per million reasoning tokens (optional, defaults to output price)The trailing text also clarifies that only |
There was a problem hiding this comment.
Pull request overview
This pull request improves the “unknown model pricing” failure experience when max-ai-credits is enabled by updating the remediation guidance and ensuring the generated failure issue title reflects the true root cause (unknown pricing) rather than a secondary symptom (timeout).
Changes:
- Update the unknown-model AI credits guidance to include frontmatter-based per-model pricing via
models.providersand remove the previously misleading fallback suggestion. - Add
unknownModelAICreditsas a higher-priority signal inbuildFailureIssueTitle, including propagating the flag at the call site. - Extend the
buildFailureIssueTitletests to cover the new title and precedence overisTimedOut.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/md/unknown_model_ai_credits.md | Updates the end-user remediation options shown for unknown model pricing failures. |
| actions/setup/js/handle_agent_failure.cjs | Adds unknownModelAICredits handling to issue title generation and passes the flag through. |
| actions/setup/js/handle_agent_failure.test.cjs | Adds test coverage for the new title and precedence behavior. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Low
| Use the `models.providers` field to supply per-token pricing for your custom model. Use the provider key that matches your engine (`github-copilot`, `anthropic`, `openai`, `google`): | ||
|
|
| --- | ||
| ``` | ||
|
|
||
| Use the provider key matching your engine: `github-copilot` (Copilot), `anthropic` (Claude), `openai` (Codex), or `google` (Gemini). |
| // Keep HTTP 400 below AI-credits signals: quota/rate-limit indicates an account-level | ||
| // budget state that should take precedence when both classes are detected. | ||
| if (options.http400ResponseError) return `[aw] ${workflowName} hit HTTP 400 bad request`; | ||
| // Unknown model pricing is a configuration error that may also trigger a timeout; | ||
| // report it explicitly so the title is not misleadingly "timed out". | ||
| if (options.unknownModelAICredits) return `[aw] ${workflowName} has unknown model pricing`; |
🤖 PR Triage
Rationale: Small targeted fix (3 files, +29/-8). Fixes misleading error message and wrong issue title for unknown model pricing. Includes tests. Batch with #45982 (similar small bug fixes).
|
|
🎉 This pull request is included in a new release. Release: |
When
max-ai-creditsis active and the model isn't in the built-in pricing table, the failure message had a misleading option and the generated issue title said "timed out" even when the root cause was the missing pricing.Changes
unknown_model_ai_credits.mdmodels.providers:defaultAiCreditsPricing: 3.0option — wrong type (object not scalar) and wrong location (lives underapiProxy, notmodels)handle_agent_failure.cjsunknownModelAICreditstobuildFailureIssueTitlewith priority aboveisTimedOut[aw] {workflow} has unknown model pricinginstead of the misleadingtimed outTests
unknownModelAICreditsinbuildFailureIssueTitleparameterized testsunknownModelAICreditsbeatsisTimedOutwhen both are set