Reliability

Models went unavailable and our incident table stayed empty

A model with no route showed unavailable but left no incident: why the table was empty, how we defined a no-route incident, and what the public status API reports.

On this page

Apertis runs one API in front of the major model providers, and each published model has a public service status. On 2026-11-14 a read-only query against our production database found the table that holds model-status incidents empty: 0 rows. In the same read, the table of status transitions held 557 rows whose reason was no_eligible_route, the state in which a model has no route that can serve it. A model in that state shows "Temporarily unavailable" on its page. An audit asking when such a model was down and when it came back had no record to read.

The short version

  • Before: 0 incident rows against 557 transition rows with reason no_eligible_route. Of those, 292 carried reporting state current, 189 delayed and 76 unavailable, counted over the whole transitions table, whose oldest row was from 2026-09-25.
  • Now a no-route period is one incident per model and capability. The first complete evaluation that finds no eligible route opens it, a repeat adds nothing, an incomplete evaluation neither opens nor resolves it, and the first complete evaluation that finds a route resolves it.
  • The change took effect at 11:54 UTC on 2026-11-14, when the worker process that reduces evaluations was replaced, not at the merge at 09:24 UTC or at the deploy. A read six minutes later found 45 open no-route incidents and no duplicates.

Why a no-route period left no row

The question came from an audit: which record shows a period in which a model could not serve, with a start, a reason, a remediation and a resolution? An incident row holds exactly that: an id, the capability, the reason, the actor, started_at, remediated_at and resolved_at, never pruned. A transition row is one change of the projected status, kept under a retention limit, with no remediation field.

Nothing produced incidents. In the 24 hours before 05:30 UTC that day, the status event log took only eligibility evaluations, source checkpoints and two qualification records. The reducer and the store accepted incident events, but no production code sent one; the only senders were an evaluation driver and the contract fixtures. That was deliberate. Decision D3 of our status design read: "A derived no-route condition is not an incident." A complete evaluation with zero candidates produced unavailable/no_eligible_route with incident: null; incidents were reserved for evidence-backed failures and maintenance.

So the empty table was the design working as written, and the design was wrong for the audit. We amended that decision rather than build an admin-only record from the transitions, which would have no remediation field and would expire with them.

The rule, case by case

A no-route incident is kept per model and capability; at the time of the change, production evaluated one capability, chat_completions. The rule comes from the reducer and its tests, and a scenario in our status contract replays it against the public API's output:

  • First complete evaluation with no eligible route, and no open no-route incident for that capability. One incident opens: actor signal, reason no_eligible_route, state unavailable, started at that evaluation.
  • The same period evaluated again. Nothing is added.
  • An evaluation that could not complete, routed or not. It opens nothing and resolves nothing.
  • First complete evaluation that finds a route. It resolves the incident; remediated_at and resolved_at are both that evaluation's time.
  • A route found for another capability or another model, or an evaluation older than the latest. The incident stays open.
  • A later no-route period. A new incident with a new id.

Each case is pinned by a test:

  • Opening, the repeat, the resolution and the new id for a later period: TestANoRoutePeriodIsOneIncidentFromFirstNoRouteToFirstRoute. The repeat is also covered by TestReconcilerNoRoutePeriodIsOneIncidentFromEvaluationsAlone, and the later period by a store test on PostgreSQL.
  • The incomplete evaluation: TestAnIncompleteEvaluationNeitherOpensNorResolvesANoRouteIncident.
  • Another capability, another model or an older evaluation: TestEvidenceForAnotherScopeOrAnOlderEvaluationLeavesANoRouteIncidentOpen.

The incident id is derived from the model, the capability and the start time. Every later evaluation in the period names the same incident, so a restart or a second worker cannot add one. Incidents opened by any other actor, or with any other reason, still go through the separate recovery gate. The spec counts this resolution as corrected configuration, never as a passed probe.

The first design did not survive the code

Our first plan had the status reconciler, the loop that evaluates routes, send an incident.opened event beside each no-route evaluation. Three facts in the code moved it while it was being written:

  • The reconciler keeps no memory of when a period began, which an id derived from the period's first evaluation needs. A restarted worker would have opened a second incident for the same period.
  • The reconciler writes in batches, and the batch path in the store never created an incident row. In that path, an incident the store had not seen before was skipped without an error.
  • The reducer already held both facts that decide a period: the capability's last evaluation and the model's unresolved incidents.

So the reducer derives the incident from evaluations it already accepts, and the batch path inserts the rows it opens, rolling the batch back if one does not land.

What the public status API reports

Two unauthenticated endpoints serve the status: GET /api/v2/models/:modelId/service-status for one model and GET /api/v2/model-service-status?model_ids=... for several. Both are defined by one JSON schema whose objects are closed, so a field added anywhere fails validation instead of extending the response silently. Here is one real batch request, read at 2026-11-18T16:33Z. We replaced the model ids, the incident ids and the second item's times with placeholders; every other value is as served, pretty-printed:

curl -s "https://apertis.ai/api/v2/model-service-status?model_ids=<model-a>,<model-b>"
{
  "schema_version": 1,
  "snapshot_generated_at": "2026-11-18T16:33:08.328502751Z",
  "items": [
    {
      "model_id": "<model-a>",
      "service_state": "unavailable",
      "reporting_state": "current",
      "reason_code": "no_eligible_route",
      "capabilities": [],
      "incident": {
        "id": "inc_<id-a>",
        "reason_code": "no_eligible_route",
        "capabilities": ["chat_completions"],
        "started_at": "2026-11-14T11:55:08.853175Z",
        "updated_at": "2026-11-14T11:55:08.853175Z",
        "resolved_at": null
      }
    },
    {
      "model_id": "<model-b>",
      "service_state": "accepting_requests",
      "reporting_state": "current",
      "reason_code": "no_known_incident",
      "capabilities": [],
      "incident": {
        "id": "inc_<id-b>",
        "reason_code": "no_eligible_route",
        "capabilities": ["chat_completions"],
        "started_at": "<started>",
        "updated_at": "<resolved>",
        "resolved_at": "<resolved>"
      }
    }
  ],
  "not_found": []
}

The first item is an open period; the second is serving again and shows the incident it recovered from. The schema enforces the pairing: an accepting_requests item may carry only a resolved incident, an unavailable item only an unresolved one, and an item whose state is null carries none. A resolved incident stays on the item for a fixed display window and then drops off.

Deployed is not in effect

The pull request merged at 09:24:56 UTC on 2026-11-14, and the API process was running the merge commit from 10:00 UTC. A production read at 10:37 UTC still found 0 incident rows. Only the worker role reduces evaluations, and a code deploy replaces the API process but leaves the long-lived worker running; replacing the worker is a separate step this release did not include. The worker still ran a commit from before the merge, so in production a no-route period behaved exactly as before.

The worker was replaced at 11:54 UTC with release 8249b8db3d. A read at 12:00 and 12:01 UTC found 45 open incidents with actor signal and reason no_eligible_route, opened in the first two reconciler passes after the replacement, with 0 duplicates for one model and capability and 0 on a capability that had a route.

Two things follow. First, those 45 incidents carry the first or second pass after the replacement as started_at, not the real start of their periods; the first item in the response above is one of them, and the earlier history is only in the transitions table. Second, 62 other capability rows were complete and without a route but were last evaluated between 2026-09-17 and 2026-11-10. The reconciler no longer evaluates them, so no evaluation reaches the reducer and no incident opens for them.

One staging run, and a check that encoded the old design

Before the production change we drove it on staging, in one run. A fixture model lost its only route; the next complete evaluation opened one incident row. When the route came back, the next complete evaluation resolved the same row, with remediated_at equal to resolved_at, and a later evaluation added nothing. The public status for the fixture then read accepting_requests, no_known_incident, with the resolved incident attached.

That correct item broke something else. Our staging deploy checks the fixture's public status and required incident == null, so every staging deploy would have failed until the incident left the display window, and no backend release ships without a staging receipt. We deleted the one test row from the staging database by hand. The fix changed the check: an accepting_requests item with a resolved incident passes, an open incident still fails, and the failure line names the state, the reason and the incident.

Production since the worker was replaced

We read the incident table on production once, with a read-only query, at 16:42 UTC on 2026-11-18, a little over four days after the transition.

No-route incidents since 11:54 UTC on 2026-11-14 Count
Opened 47
Already running at the transition 45
Began after the transition 2
Resolved 2
Still open at the read 45
Model and capability pairs with more than one open incident 0

The two periods that began after the transition both resolved within minutes. The 45 that were running at the transition were all still open at the read, 100.8 hours after it. These are models that already had no route before the change, and their pages already showed "Temporarily unavailable". The change gave each one an incident row; it did not take any of them down. Two periods in four days is a small sample. It shows the rule opening and closing a row on production, and it says nothing yet about how often a model loses its routes.

What we would do differently

  • Ask what an audit will read before deciding what is not an incident. The gap showed only when someone asked for the record.
  • Name the process that runs the changed code before calling it live. The deploy reached the API process; the code we changed runs only in the worker.
  • Search for checks that assert the old behavior. The staging check was written for the old design, and we found it only because the staging run left a resolved incident on the fixture.

Still open

  • The 62 capability rows that are no longer evaluated have no incident. Whether they should stay visible as unavailable was left open; they predate this change.
  • A rollback to the previous image would leave every open no-route incident unresolved, because that image never resolves one. The written rollback has a second step, a gated row edit that resolves them.

How each number was measured

  • The before numbers: one read-only production query on 2026-11-14 at 06:30:35 UTC: incident rows, and transition rows with reason no_eligible_route by reporting state.
  • The rule: the reducer, store and reconciler tests named under the cases, and the contract scenario, at the merge commit.
  • The 10:37 and 12:00 UTC reads: the same read-only production script, before and after the worker was replaced.
  • The staging run: one staging window on 2026-11-14, with every database read in a read-only transaction.