Check Routing Health
Use this worker when the developer wants to know whether Understudy routing is
causing errors, which workloads are routed, whether a declared route is really
taking effect, or where their gateway usage and spend goes. These are read-only
hosted endpoints that answer "is this us?" without asking the team.
Checked against existing skills: use-understudy-gateway owns auth, routing
setup, and route writes; ramp-and-verify owns production traffic changes.
This skill owns read-only diagnostic queries against the reporting surface and
does not write routes or change traffic.
Safety Gates
These endpoints are read-only and carry no side effects. They do not change
routes, traffic percentages, or provider configuration. Do not print the full
sk_* key in output — mask it to the last 4 characters. Prefer the first-class
understudy reporting commands, which resolve the signed-in organization and
project without exposing credentials to a child process.
Vocabulary — use these words, exactly
Everything you say to the user must use the canonical routing vocabulary:
- Route outcomes (
route_shares): primary — the customer-requested
model was served (includes catalog-by-name); understudy — an
Understudy-configured route moved the traffic; fallback — a recovery
re-issue after a routed attempt failed.
- Declared config (
declared): pin | steer | none, plus the split
percent (split_pct).
- Provider labels:
anthropic | openai | managed — nothing else.
- A served model of
understudy-managed is a managed model whose catalog
mapping hasn't synced yet — a fail-closed placeholder, not an error.
- Never use "passthrough", "BYO", or "relay" in output to users. Older
responses (the legacy
routing-status endpoint) still emit some of these
words — translate, don't echo.
Prerequisites
The developer must be signed in (understudy status --json shows
signed_in: true) and have a project configured. If not, route to
../use-understudy-gateway/SKILL.md for
auth setup first.
Resolve CLI
Prefer the installed understudy binary. If it is unavailable inside a repo
checkout, run through the package script:
npm run build
node dist/bin.js status --json
Flow
Confirm auth and project:
understudy status --json
Extract org_id and project_slug from the output. Resolve the project
slug to a project id via understudy projects list --json if needed — the
API path requires the proj_... id, not the slug. If not signed in, route
to ../use-understudy-gateway/SKILL.md.
Ground in volume first — one org-wide call. Before analyzing or
recommending anything, rank workloads by spend and request count across
the whole org:
understudy reporting summary --window 7d --group-by workload --json
Rank by customer_cost_usd and requests (group_by defaults to
project — use that first when the org has many projects, then
workload). For a tight incident window add --granularity minute (ranges
up to 24h); drill down with the project_id / workload_id filters.
Every statement you make must be grounded in that volume ranking — lead
with the workloads that carry the spend and traffic. Do not anchor on
low-leverage generic advice about workloads that barely run.
Organization reporting has no pricing-coverage block. Use
understudy reporting cost-breakdown before treating the cost ranking as
complete enough for an exact billing claim.
Pull the unified per-workload view:
understudy reporting workload-status --project <project> --window 24h --json
One row per workload: status (healthy | degraded | idle), the declared
config, observed route_shares, rerouted_pct, served_models,
error_rate, and example_request_ids. Field details in
reference.md.
Interpret, in priority order of the volume ranking from step 2:
status: degraded — the 5xx rate crossed the threshold. Report the
workload-level error_rate and the example_request_ids. Do NOT name a
failing upstream from served_models[] — it carries request shares only,
no per-provider error counts, so traffic labels cannot say which provider
produced the 5xxs. Leave provider attribution to the Understudy team and
quote the request ids.
- Declared-vs-observed drift is a finding — normalize units first.
declared.split_pct is 0–100; route_shares.understudy is a 0..1 share.
Compare split_pct / 100 against the share — never the raw numbers
(declared 30 vs observed 0.28 is healthy, not drift). Flag drift when
split_pct / 100 − route_shares.understudy exceeds ~0.1; the loudest
case is a declared split with an observed share of ~0 — tell the user
plainly their routing config is declared but not actually taking effect.
rerouted_pct (= route_shares.understudy) is THE number to watch
during a ramp or cutover — compare it against declared.split_pct / 100.
- Non-zero
route_shares.fallback means routed attempts are failing and
being recovered — upstream instability on the routed arm.
- Error rate above ~2% is worth investigating; a workload with
declared.routed: none and errors is provider-side, not routing-caused.
If example_request_ids are present, offer to look them up:
understudy captures get <request-id> --project <project>
If they are empty (or the team needs more ids), pull recent capture
metadata for the project — request ids, timestamps, sizes; metadata only,
capture content stays behind the dashboard login
(reference.md § Captures metadata list):
understudy captures list --project <project> --limit 25 --json
If any call fails or a number looks wrong, capture the
x-understudy-request-id response header and quote it when reporting the
problem to the Understudy team — it is the join key on their side.
If issues are found and the developer wants to roll back, route to
../ramp-and-verify/SKILL.md or clear the
route immediately with understudy routes clear <workload> --project <project>.
Project-scoped alternatives. usage-summary remains the detail tool
within one project when the org-wide view isn't enough: it carries what
org reporting doesn't — the computed cache_read_pct share, a per-group
error_rate, and multi-dimension group_by (e.g. workload,day). Raw
cache token counts are in both:
understudy reporting usage --project <project> --window 7d --group-by workload,day --json
See reference.md § Usage summary. The
older routing-status, provider-health, and status endpoints still
exist but are deprecated — see the legacy section of
reference.md. Only fall back to them if workload-status
or usage-summary return 404 (an older deployment).
Output Standard
End with:
- project/org context (without revealing the full key);
- the volume ranking (top workloads by spend/requests) that grounds the answer;
- per-workload status and any declared-vs-observed drift findings, in
canonical vocabulary;
- the window queried and when the data was generated;
- recommended next action (investigate a request ID, adjust the window, roll
back a route, or confirm healthy) — with any request ids quoted.
References
1---2name: check-routing-health3description: Use when a developer asks "is Understudy causing my errors", "which workloads are routed", "is my routing config actually taking effect", "is my provider healthy", "are there 500s on staging", "what's our error rate", "where is my gateway spend going", or wants self-service diagnostics without asking the team. Reads the hosted reporting endpoints with the developer's sk_* key.4---56# Check Routing Health78Use this worker when the developer wants to know whether Understudy routing is9causing errors, which workloads are routed, whether a declared route is really10taking effect, or where their gateway usage and spend goes. These are read-only11hosted endpoints that answer "is this us?" without asking the team.1213Checked against existing skills: `use-understudy-gateway` owns auth, routing14setup, and route writes; `ramp-and-verify` owns production traffic changes.15This skill owns read-only diagnostic queries against the reporting surface and16does not write routes or change traffic.1718## Safety Gates1920These endpoints are read-only and carry no side effects. They do not change21routes, traffic percentages, or provider configuration. Do not print the full22`sk_*` key in output — mask it to the last 4 characters. Prefer the first-class23`understudy reporting` commands, which resolve the signed-in organization and24project without exposing credentials to a child process.2526## Vocabulary — use these words, exactly2728Everything you say to the user must use the canonical routing vocabulary:2930- **Route outcomes** (`route_shares`): `primary` — the customer-requested31 model was served (includes catalog-by-name); `understudy` — an32 Understudy-configured route moved the traffic; `fallback` — a recovery33 re-issue after a routed attempt failed.34- **Declared config** (`declared`): `pin` | `steer` | `none`, plus the split35 percent (`split_pct`).36- **Provider labels**: `anthropic` | `openai` | `managed` — nothing else.37- A served model of `understudy-managed` is a managed model whose catalog38 mapping hasn't synced yet — a fail-closed placeholder, not an error.39- Never use "passthrough", "BYO", or "relay" in output to users. Older40 responses (the legacy `routing-status` endpoint) still emit some of these41 words — translate, don't echo.4243## Prerequisites4445The developer must be signed in (`understudy status --json` shows46`signed_in: true`) and have a project configured. If not, route to47[`../use-understudy-gateway/SKILL.md`](../use-understudy-gateway/SKILL.md) for48auth setup first.4950## Resolve CLI5152Prefer the installed `understudy` binary. If it is unavailable inside a repo53checkout, run through the package script:5455```sh56npm run build57node dist/bin.js status --json58```5960## Flow61621. Confirm auth and project:6364 ```sh65 understudy status --json66 ```6768 Extract `org_id` and `project_slug` from the output. Resolve the project69 slug to a project id via `understudy projects list --json` if needed — the70 API path requires the `proj_...` id, not the slug. If not signed in, route71 to [`../use-understudy-gateway/SKILL.md`](../use-understudy-gateway/SKILL.md).72732. **Ground in volume first — one org-wide call.** Before analyzing or74 recommending anything, rank workloads by spend and request count across75 the whole org:7677 ```sh78 understudy reporting summary --window 7d --group-by workload --json79 ```8081 Rank by `customer_cost_usd` and `requests` (`group_by` defaults to82 `project` — use that first when the org has many projects, then83 `workload`). For a tight incident window add `--granularity minute` (ranges84 up to 24h); drill down with the `project_id` / `workload_id` filters.85 Every statement you make must be grounded in that volume ranking — lead86 with the workloads that carry the spend and traffic. Do not anchor on87 low-leverage generic advice about workloads that barely run.8889 Organization reporting has no pricing-coverage block. Use90 `understudy reporting cost-breakdown` before treating the cost ranking as91 complete enough for an exact billing claim.92933. Pull the unified per-workload view:9495 ```sh96 understudy reporting workload-status --project <project> --window 24h --json97 ```9899 One row per workload: `status` (healthy | degraded | idle), the declared100 config, observed `route_shares`, `rerouted_pct`, `served_models`,101 `error_rate`, and `example_request_ids`. Field details in102 [`reference.md`](reference.md).1031044. Interpret, in priority order of the volume ranking from step 2:105 - `status: degraded` — the 5xx rate crossed the threshold. Report the106 workload-level `error_rate` and the `example_request_ids`. Do NOT name a107 failing upstream from `served_models[]` — it carries request shares only,108 no per-provider error counts, so traffic labels cannot say which provider109 produced the 5xxs. Leave provider attribution to the Understudy team and110 quote the request ids.111 - **Declared-vs-observed drift is a finding — normalize units first.**112 `declared.split_pct` is 0–100; `route_shares.understudy` is a 0..1 share.113 Compare `split_pct / 100` against the share — never the raw numbers114 (declared `30` vs observed `0.28` is healthy, not drift). Flag drift when115 `split_pct / 100 − route_shares.understudy` exceeds ~0.1; the loudest116 case is a declared split with an observed share of ~0 — tell the user117 plainly their routing config is declared but not actually taking effect.118 - `rerouted_pct` (= `route_shares.understudy`) is THE number to watch119 during a ramp or cutover — compare it against `declared.split_pct / 100`.120 - Non-zero `route_shares.fallback` means routed attempts are failing and121 being recovered — upstream instability on the routed arm.122 - Error rate above ~2% is worth investigating; a workload with123 `declared.routed: none` and errors is provider-side, not routing-caused.1241255. If `example_request_ids` are present, offer to look them up:126127 ```sh128 understudy captures get <request-id> --project <project>129 ```130131 If they are empty (or the team needs more ids), pull recent capture132 metadata for the project — request ids, timestamps, sizes; metadata only,133 capture content stays behind the dashboard login134 ([`reference.md`](reference.md) § Captures metadata list):135136 ```sh137 understudy captures list --project <project> --limit 25 --json138 ```1391406. If any call fails or a number looks wrong, capture the141 `x-understudy-request-id` response header and quote it when reporting the142 problem to the Understudy team — it is the join key on their side.1431447. If issues are found and the developer wants to roll back, route to145 [`../ramp-and-verify/SKILL.md`](../ramp-and-verify/SKILL.md) or clear the146 route immediately with `understudy routes clear <workload> --project <project>`.147148**Project-scoped alternatives.** `usage-summary` remains the detail tool149within one project when the org-wide view isn't enough: it carries what150org reporting doesn't — the computed `cache_read_pct` share, a per-group151`error_rate`, and multi-dimension `group_by` (e.g. `workload,day`). Raw152cache token counts are in both:153154```sh155understudy reporting usage --project <project> --window 7d --group-by workload,day --json156```157158See [`reference.md`](reference.md) § Usage summary. The159older `routing-status`, `provider-health`, and `status` endpoints still160exist but are deprecated — see the legacy section of161[`reference.md`](reference.md). Only fall back to them if `workload-status`162or `usage-summary` return 404 (an older deployment).163164## Output Standard165166End with:167168- project/org context (without revealing the full key);169- the volume ranking (top workloads by spend/requests) that grounds the answer;170- per-workload status and any declared-vs-observed drift findings, in171 canonical vocabulary;172- the window queried and when the data was generated;173- recommended next action (investigate a request ID, adjust the window, roll174 back a route, or confirm healthy) — with any request ids quoted.175176## References177178- [`reference.md`](reference.md) — endpoint details, response shapes, field179 descriptions, and the deprecated legacy endpoints.180- [`../use-understudy-gateway/SKILL.md`](../use-understudy-gateway/SKILL.md) —181 auth setup, route writes, and gateway inference.182- [`../ramp-and-verify/SKILL.md`](../ramp-and-verify/SKILL.md) — production183 ramp/rollback when diagnostics reveal a problem.