Diagnose a failed job or run
Classifies why a CI job failed (sling why) — step_failure / timeout / cancelled / terminated / oom / infra / network_egress / hang / unknown — with evidence, suggested actions, and a downstream-agent prompt, read deterministically from the CI facts store. No LLM in the request path.
/api/whyAuthorization
bearerAuth Session token from sling login.
In: header
Query Parameters
GitHub organization login. Scopes the request to your membership.
1 <= lengthDiagnose this job. Give either job_id or run_id, not both.
^[1-9]\d*$Diagnose this run — the most diagnosable failed job in it is chosen.
^[1-9]\d*$Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/why?org=acme"{ "job_id": "88886665361", "job_name": "typecheck", "conclusion": "failure", "classification": "step_failure", "summary": "Step `Run bun run typecheck` failed with exit code 2.", "evidence": [ { "kind": "step", "ref": "Run bun run typecheck" }, { "kind": "log_line", "ref": "812" } ], "logs": "##[error]Process completed with exit code 2.", "log_window": "src/index.ts(42,7): error TS2322: Type 'string' is not assignable to type 'number'.", "suggested_actions": [ { "title": "Read the failing step's log", "command": "sling logs att_88886665361.1" } ], "prompt": "The job `typecheck` failed at step `Run bun run typecheck` with a TS2322 type error in src/index.ts:42.", "meta": { "truncated": false }}Read job log lines GET
Ingested job-log lines for a completed attempt (sling logs), filtered SERVER-SIDE so an agent reads only what matters: grep (RE2), since (the log tail), job (narrow a run to one job). A run id reads all its jobs; a job/attempt id reads one attempt. Keyset-paginated via an opaque cursor. Authenticated; a run/job in another org 404s (opaque).
Break down CI wall-clock time GET
Phase decomposition: job/attempt level splits wall-clock into the frozen phase enum with a per-step breakdown; run level adds a timing-inferred critical path, parallelism efficiency, and the blocking job; repo level aggregates p50/p95 per phase per runner label. Scoped to the caller's orgs by membership.