Repository navigation
Description
Problem
When the model gateway or its provider is down, the roadmap jobs keep starting work that cannot finish. On 2026-11-16 from 10:40Z to 11:35Z, OpenRouter timed out, and the Service still ran refine, alternatives, stage and implement: 12 steps failed with class=provider, two implement Jobs stopped after their groups had used tokens, and stage planned #3655 three times. Each failed item then waits for its retry rule, and an implement item can spend a digest clear.
Expected behavior
- The Service checks the health of the gateway and of each upstream group that a job uses (for example the gateway's readiness and the recent failure share of the group) before it starts a round or a Job.
- While a group is unhealthy, the jobs that use it are parked: no new round or Job starts, a running step is not cut, and nothing counts as a failure of the item.
- A parked job resumes by itself when the group is healthy again, and the Service logs the park and the resume, and shows them on the dashboard.
Related
- The retry and deadline issue of the same outage (filed with this one).
Alternatives check of 2026-11-24: in-use.
The repository already uses this tool.
Tool: BerriAI/litellm (https://github.com/BerriAI/litellm), NOASSERTION, last activity 2026-11-24, maintained.
Reason: Searches confirm LiteLLM as the open LLM API gateway, and the issue body already names it as in use; it reports gateway readiness and per-group deployment health, but holds no parking, resume or park records.
Covers:
- Gateway readiness for the proxy
- Per-deployment health and cooldown of each model group
- Load balancing across the providers of a group
Lacks:
- Valkey park key shared by lanes and replicas
- Automatic resume when a group turns healthy
- Park and resume records for logs and dashboard
- Rule that a parked step is not an item failure
Proposed design
Problem statement
On 2026-11-16 the model gateway timed out for 55 minutes. The Service kept starting refine, alternatives, stage and implement work that could not finish. Twelve steps failed with class=provider, two implement Jobs spent tokens, and stage planned #3655 three times. Each failed item then waited for its retry rule. The change makes the Service ask the gateway health before it starts a round or a unit of work. It parks the rows of an unhealthy model group and resumes them by itself when the group recovers.
Acceptance criteria
Requirement: Health gate before a round
The Service MUST ask the gateway health gate before it starts a lane round.
Scenario: An unready gateway holds the round
- WHEN the gateway readiness check fails and a lane is due for a round
- THEN the lane starts no round and the gate returns
parkwith the gateway reason
Requirement: No unit for an unhealthy group
The Service MUST create no unit of work and no runner Job for a row whose model group is unhealthy.
Scenario: A row of a group in cooldown gets no unit
- WHEN the sweeps runs and one model group of a due row is in cooldown at the gateway
- THEN the sweeps creates no unit and no runner Job for that row, and writes one park record with the group and the reason
Requirement: Park state in Valkey
The Service MUST keep each park in Valkey with a TTL, so that each lane and each replica sees the same park.
Scenario: A second replica sees the park
- WHEN one replica writes a park for a repository and a model group
- THEN the gate of another replica returns
parkfor that repository and model group
Requirement: No item failure during a park
The Service MUST NOT write a failure entry or change the status of an item whose step stops while its group is parked.
Scenario: A provider stop during a park
- WHEN a runner step exits 1 with
class=providerand the gate returnsparkfor its group - THEN the job record holds no failure entry and the item keeps its status
Requirement: Resume by itself
The Service MUST clear a park and resume its row when the group becomes healthy, with no person action.
Scenario: A healthy check resumes the row
- WHEN the next sweeps finds the group healthy and a park record exists
- THEN the Service deletes the park key, writes one resume record, and creates the unit of work that the park held
Requirement: A running step is not cut
The Service MUST NOT stop a running unit when its group becomes unhealthy.
Scenario: A running unit keeps its claim
- WHEN the gate turns to
parkwhile a unit holds an item - THEN the Service sends no stop and the unit keeps its claim
Requirement: Park and resume records
The Service MUST write one structured record for each park and each resume, with the repository, the group, the reason and the time.
Scenario: The records carry their fields
- WHEN a park and then a resume occur for a repository and a model group
- THEN two records are written with
event=parkandevent=resumeand the four fields
Requirement: Health policy settings
The health policy MUST read its switch and its check interval from roadmap.health in .github/roadmap.toml, and MUST use a default when a key is absent.
Scenario: Defaults when the table is absent
- WHEN the loader reads a config that has no
roadmap.healthtable - THEN it returns
enabled=trueandcheck_interval_seconds=60
Existing Tool Considered
BerriAI/litellm, verdict in-use: the repository already uses this tool, so no person decision applies (alternatives check of 2026-11-17 in the issue body). The check in the issue body lists what the tool covers and lacks: it gives the readiness and the per-deployment health of each model group, and it lacks parking, automatic resume, park and resume records, and the rule that a parked step is not an item failure. The proposal reads the tool health for the gate and builds only that lacking layer: the Valkey park key, the start-only gate at unit creation, the resume on a healthy check, and the records. Cost to build and keep that layer: about 250 lines of Python, about 30k tokens to write, about 5k tokens a year to keep, and about 2 days.
Key questions
- Which health signal tells the Service that a model group is unhealthy?: The gateway readiness for the proxy, and the per-deployment health and cooldown of each model group. The Service reads the gateway answer for each group that a row names, and keeps no second failure counter. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md]
- Chosen: Gateway readiness and per-group health. The alternatives check in the issue body shows that the gateway already reports readiness and per-deployment health, so the Service reads one source.
- Rejected: Synthetic check request for each group. A check spends tokens and can fail for a reason that is not the health of the group.
- Rejected: Failure share that the Service computes from its own result lines. It duplicates the gateway cooldown and is behind the gateway by one window.
- Where does the Service check the gate: at unit creation, in the lane round, or in the runner?: At the one place that creates a unit of work or a runner Job, which the router and the sweeps both call, and in the lane round before it starts. The runner does not gate itself. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
- Chosen: The unit-creation path and the lane round. Only the router and the sweeps create a unit, so one gate covers both (CONTEXT.md, Sweep).
- Rejected: The runner pod. The Job already costs a pod and a clone, and the issue says no Job starts.
- Rejected: The router webhook only. A sweeps with no webhook would still start work.
- Where does the Service keep the park state?: In Valkey, one key for each repository and model group, with a TTL. Each lane and each replica reads the same key. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
- Chosen: A Valkey key with a TTL. Lanes do not share memory, and a restart must not lose a park (CONTEXT.md, Lane; Due mark).
- Rejected: The memory of the lane. A restart or a second replica loses it.
- Rejected: A label on the issue. It changes the Status of the item, and the issue says a park is not a failure.
- What does the Service do with a step that stops while its group is parked?: It records a park and writes no failure entry. The item keeps its status, and the normal retry rule takes the step after the resume. (best practice) [sources: CONTEXT.md, docs/ROADMAP_WORKFLOW.md]
- Chosen: Park, with no failure entry. The issue says a parked step is not an item failure, and a failure would spend the retry budget.
- Rejected: Count the stop as a failure. It contradicts the issue and it spends a digest clear.
- Rejected: Mark the item Blocked. A person would clear a state that the Service can clear by itself.
- How does a parked row resume?: Each sweeps checks each parked group. When the gateway reports the group healthy, the Service deletes the park key, writes one resume record, and lets the normal due logic create the unit on that tick. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
- Chosen: Check on each sweeps. The sweeps is the reconcile round that creates units, so the resume needs no new schedule (CONTEXT.md, Sweep).
- Rejected: Wait for a person to clear the park. The issue requires a resume by itself.
- Rejected: Use the cooldown expiry as the wake time. The gateway does not tell the Service when the group is healthy again.
- Does the Service stop a running unit when its group becomes unhealthy?: No. The gate is read before a start only, and the stop path never consults it. (best practice) [sources: CONTEXT.md]
- Chosen: Start-only gate. The issue says a running step is not cut.
- Rejected: Stop the unit. It discards work that the unit can still finish.
- Which settings hold the health policy?:
roadmap.health.enabledandroadmap.health.check_interval_secondsin.github/roadmap.toml, with the defaultstrueand60. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md]- Chosen: A
roadmap.healthtable. The road map settings already live in one file (ADR 0004 cites.github/roadmap.toml). - Rejected: A fixed interval with no setting. A person cannot turn the gate off during an incident.
- Rejected: A separate file. It splits the road map settings.
- Chosen: A
- Which records show a park and a resume?: One structured log line for each event, with
event,repository,group,reasonandtime, and one counter increment with thegroupandeventlabels. The dashboard panel is a new issue. (best practice) [sources: CONTEXT.md]- Chosen: A log line and a counter. The log line gives the detail, and the counter gives the dashboard a series (CONTEXT.md, Road map step; TELEMETRY.md).
- Rejected: A log line only. The dashboard needs a metric.
- Rejected: A new state file. Valkey already holds the state.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 16, 2026
Both address gateway failure, but #5564 adds a fallback group to one route while the candidate parks all jobs that use an unhealthy group and resumes them when it recovers.dan-petty commentedon Nov 16, 2026
Related: #5965 (one retry layer and a deadline for a gateway call), filed from the same outage.
devops-cli-service commentedon Nov 17, 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:
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at c49fd02 (see proposed design in issue body).
Moved to new items: #6304.
dan-petty commentedon Nov 25, 2026
Returning #5967 to
Newper Rule 2 (AGENTS.md): key parts of the Proposed design rely on unshipped ADR 0021 components and a deleted configuration path.Verified against
origin/main(0b9c6983f)CONTEXT.md:153-160,src/devops_cli/server/service.py,src/devops_cli/roadmap/run.py):#5967requires a start-only park gate"At the one place that creates a unit of work or a runner Job, which the router and the sweeps both call, and in the lane round before it starts", and its scenarios specify that"sweeps creates no unit and no runner Job"and"deletes the park key ... and creates the unit of work that the park held".origin/main,#4517(feat(roadmap): move Service work to Workflows and Valkey),#4566(WorkflowLauncher), and#4574(feat(roadmap): run the reconcile sweep on a cluster schedule) are still open. There is noSweepor router/sweep unit-creation layer insrc/devops_cli/server/service.pyorsrc/devops_cli/roadmap/run.py(CONTEXT.md:158:"Until #4574 merges, the poll of the Service does this work."). Only the single-podRepoWorkerlane loop andRunnerUnit(src/devops_cli/roadmap/job_launcher.py, used byimplement_submit,fix_checks_row,infra_plan, andinfra_apply) exist today..github/roadmap.toml(docs/adr/0016-labels-hold-the-roadmap-items-fields.md:42,src/devops_cli/config/constants.py:3945):#5967requires readingroadmap.health.enabledandroadmap.health.check_interval_secondsfrom.github/roadmap.toml.docs/adr/0016-labels-hold-the-roadmap-items-fields.md:42),.github/roadmap.tomlwas deleted; repository toolchain config lives in.devops/roadmap.tomland Service/roadmap policy settings live inconfig.yaml(load_settings().roadmap).Next: Either hold
#5967on#4574/#4517and update the configuration source toconfig.yaml(or.devops/roadmap.toml), or narrow#5967to probe gateway health cleanly beforeRepoWorkerlane rounds andRunnerUnitlaunches in the current single-pod Service.dan-petty commentedon Nov 26, 2026
Evidence from the provider cut of 2026-11-25, 13:12Z to 20:43Z, for the narrow form of this item.
class=providerin those 8 hours (refine 315 on 119 items, stage 87, alternatives 34, implement 3) and 4 successes. That is about half of all failed attempts of the 7-day window.max_tokensgot the 402.FailureLedger,roadmap/run.py) suspends a row afterservice.max_failed_roundsfailed rounds and probes it afterRETRY_AFTERof the failure class, with no Valkey key. It did not park on 2026-11-25, because a job fails only the item for anAIClientErrorand stops its round only forAICredentialsError. So no round failed.RoadmapProviderKeySpendLimit.What stays open for this item after #7261: a short provider failure with no cause in its reply (HTTP 429 of the cooldown, a timeout) still fails one item after the other. A narrow form that needs no probe and no new state: a job ends its round with a provider error when a set number of model calls in a row fail with the class
provider, so the ledger that exists suspends the row.dan-petty commentedon Nov 26, 2026
This item closes as not planned (AGENTS.md Rule 2: newer code replaces it, and the design cannot be built as written).
.github/roadmap.toml. None of them is inmain(comment of 2026-11-25).FailureLedger) suspends the row and probes each hour, no item gets a failure, andRoadmapProviderKeySpendLimitfires. The gaugedevops_cli_service_job_suspendedand the alertRoadmapServiceRowSuspendedshow each suspended row with its class.