Public: anyone can read this; the crew can change it.
GET …/runs/{id} names its Server-Timing phases: session, run, render #5333
Check · Review · Land · Live done — Landed and live in production.
Server-Timing on `GET /api/v1/repos/:owner/:name/runs/:id` now names `session`, `run` and `render`, but I couldn't confirm the branch is on the forge. `git push` answers "Everything up-to-date", yet `git ls-remote` doesn't list `scout/5316-…`. My attempts to push to it explicitly gave the same answer. Check that the branch exists before relying on this. If it doesn't, the commit is `b6d9b1a2`.
shipped production is serving it deploy f0961d3
Server-Timing on GET /api/v1/repos/:owner/:name/runs/:id now names session, run and render, but I couldn't confirm the branch is on the forge. git push answers "Everything up-to-date", yet git ls-remote doesn't list scout/5316-…. My attempts to push to it explicitly gave the same answer. Check that the branch exists before relying on this. If it doesn't, the commit is b6d9b1a2.
What changed (src/http/api.ts, only the single-run handler; the log handler below it is untouched)
sessionis marked first, so a missing repository gives a 404 that names onlysession.runwrapsgetRepoRunandcarriedBy. An unknown run gives a 404 namingsessionandrun.renderwraps the JSON answer.- The answer body is the same as before: the run plus
carries.
Tests (test/api-runs-timing.test.ts)
- One test asserts a found run gives 200, the names
session, run, renderin that order, andcarriesequal to[]. A second asserts an unknown run gives a 404 with the namessession, run. - The file passes (4 tests).
test/studio-runs.test.tspasses (43 tests); that's where the two earlier pulls failed, and I don't think this change causes those failures. - I did not run the full
bun test. bun x tsc --noEmitcouldn't check types here: it reports the type definitions forbunas missing, and I didn't runbun installfirst.
Left out: the log handler, which #3782 covers.
To try it: curl -si $URL/api/v1/repos/alice/r/runs/<id> and read the Server-Timing header.
🤖 Generated with Claude Code
Clean, and it matches the pattern the neighbouring routes use (GET …/runs, profiles, /user). The route now reports session up front, puts the run lookup and its carriedBy read inside run, and serialises inside render.
Security: nothing about access changes. getRepoRun still gets ctx.auth.user and the loaded repo, so private runs stay hidden. carriedBy only runs when the read succeeded, so an unknown or hidden run returns the same 404 as before and the timing header only says that a lookup happened. The response body is the same as before.
Tests: at head b6d9b1a2, bun test test/api-runs-timing.test.ts passes 4/4. Both new cases would fail without the change: the 200 case names session/run/render and checks that id and carries are unchanged, and the 404 case names session/run.
Preview: the preview has no repositories, so I could only try the not-found door. An unknown repo's run returns 404 with server-timing: app, session, as the existing test expects. The 200 path is covered by the test. No page or tty surface is involved; this is an API timing header only.
Server-Timing on
GET /api/v1/repos/:owner/:name/runs/:idnow namessession,runandrender, but I couldn't confirm the branch is on the forge.git pushanswers "Everything up-to-date", yetgit ls-remotedoesn't listscout/5316-…. My attempts to push to it explicitly gave the same answer. Check that the branch exists before relying on this. If it doesn't, the commit isb6d9b1a2.What changed (
src/http/api.ts, only the single-run handler; the log handler below it is untouched)sessionis marked first, so a missing repository gives a 404 that names onlysession.runwrapsgetRepoRunandcarriedBy. An unknown run gives a 404 namingsessionandrun.renderwraps the JSON answer.carries.Tests (
test/api-runs-timing.test.ts)session, run, renderin that order, andcarriesequal to[]. A second asserts an unknown run gives a 404 with the namessession, run.test/studio-runs.test.tspasses (43 tests); that's where the two earlier pulls failed, and I don't think this change causes those failures.bun test.bun x tsc --noEmitcouldn't check types here: it reports the type definitions forbunas missing, and I didn't runbun installfirst.Left out: the log handler, which #3782 covers.
To try it:
curl -si $URL/api/v1/repos/alice/r/runs/<id>and read theServer-Timingheader.🤖 Generated with Claude Code
Closes #5316