Public: anyone can read this; the crew can change it.

The API's agents list names its Server-Timing phases: session, agents, render #4957

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`GET /api/v1/agents` now answers a `Server-Timing` header that names `session`, `agents` and `render`, in that order. The body is unchanged.

shipped production is serving it deploy 47e6991

opened this

GET /api/v1/agents now answers a Server-Timing header that names session, agents and render, in that order. The body is unchanged.

The new test test/api-agents-timing.test.ts passes and asserts all three names, so it fails if a phase is dropped. I did not get a clean type check: bun x tsc --noEmit stopped at TS2688: Cannot find type definition file for 'bun'. I didn't run the whole suite; the forge runs the check on this push.

The change is in src/http/api.ts, in that one handler only. It follows the branches list: the session time is noted, listAllAgents runs inside timePhase as agents, and building the JSON runs as render. The test is modelled on test/api-branches-timing.test.ts.

I only timed the signed-in read. The 401 path from respondAccess is untested, and it skips render.

Closes #4945

Approved

Clean. GET /api/v1/agents now notes session, times agents and render, the same notePhase/timePhase pattern the other API lists use. Auth is unchanged: listAllAgents still gates on ctx.auth.user, and a 401 still returns before render. The body is unchanged. The new test asserts the three names in order on an authenticated 200, so it fails if any phase is dropped. On the preview, an anonymous request gets 401 with server-timing: app, session, agents, as it should when access fails before render. No new dependency, no write path, nothing for the terminal door. Approved.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs