Repository navigation
Closed
Labels
effort/mediumEffort Mediumpriority/p0-criticalPriority P0: a release blocker or a critical defectscope/roadmapThe roadmap jobs: intake, refine, stage, implement and the Service that runs themsource/agentFiled by an agenttype/bugType bug: the code does not do what it mustvalue/highValue High: the delivery of the item matters much
Description
Problem
Since 2026-11-22 15:17 UTC the roadmap stage and refine Jobs fail with ✗ Could not run the stage Job: The model refused the key (HTTP 403). (alert RoadmapServiceJobsFailing, 6 series on 2026-11-23 00:20).
- The key is not refused. The gateway log gives the cause:
OpenrouterException - {"error":{"message":"Key limit exceeded (total limit). ... $100.00 of $100.00 used; does not reset.","code":403, ...}}. The OpenRouter key of the gateway used all of its total spend limit. model_call_error(src/devops_cli/roadmap/agent_run.py:66-67) maps each 401 and 403 toAICredentialsError("The model refused the key ..."). So the Job report, the alert and the person who reads them look at the gateway key, not at the spend limit of the provider key.- No alert names a spent provider key. The person finds the cause only in the gateway log.
Proposed remedy
- Read the error body of a 403 reply: when the provider says that the key limit is used up (OpenRouter
Key limit exceeded), raise a budget error that says "The provider key reached its spend limit" and names the person step (raise the limit or change the key at the provider), with no key, URL or amount from the reply. - Give that error its own outcome in the Job metrics, and an alert for it, so RoadmapServiceJobsFailing is not the only signal.
Acceptance criteria
- A test: a 403 reply with the OpenRouter key-limit body gives the budget error; a 403 with another body still gives the credentials error.
- The Job report and the new alert name the spend limit and the person step.
Dependencies
None.
Alternatives check of 2026-11-23: none.
Tool: none found.
Reason: Searches found only general LLM gateways such as LiteLLM, which normalise some provider errors but do not classify OpenRouter spend-limit 403 bodies; the outcome metric and alert are project-specific, so nothing covers the need.
Lacks:
- Reads the 403 body and tells a spend limit from a refused key
- Raises a distinct budget error with a person step
- Own Job metric outcome and alert for a spent provider key
- Keeps the existing credentials error for other 403 bodies
Metadata
Metadata
Assignees
Labels
effort/mediumEffort Mediumpriority/p0-criticalPriority P0: a release blocker or a critical defectscope/roadmapThe roadmap jobs: intake, refine, stage, implement and the Service that runs themsource/agentFiled by an agenttype/bugType bug: the code does not do what it mustvalue/highValue High: the delivery of the item matters much
Activity
dan-petty commentedon Nov 23, 2026
Roadmap stage and refine Jobs are failing and the alert RoadmapServiceJobsFiring is active, which matches the P0 criterion for service jobs failing.Both deal with budget limits in the roadmap Service, but #3066 adds new per-item and per-day budgets while the candidate fixes the error message and alert when an existing provider key spend limit is hit.devops-cli-service commentedon Nov 23, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
docs(openspec): plan the error of a spent provider key
fix(ai): name a spent provider key, not a refused key
fix(roadmap): give a spent provider key the class spend_limit
feat(k8s): alert on a spent provider key
docs: name the spend limit class and its alert
test(ai): check the parent class of the spend-limit error by value
docs(openspec): archive the change of a spent provider key
devops-cli-service commentedon Nov 23, 2026
Released in v0.198.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.198.0
devops-cli-service commentedon Nov 23, 2026
Live since 2026-11-23 04:05 UTC