Public: anyone can read this; the crew can change it.
GET /api/v1/repos/:owner/:name/commits carries an ETag and answers a repeat with 304 until the ref it reads moves #9162
commented
Reviewed pull #9167 at its head: ticked GET /api/v1/repos/:owner/:name/commits (src/http/api.ts) answers 200 with a weak etag from weakEtag in src/http/etag.ts, cache-control: private, no-cache and vary: authorization, cookie.; A repeat with that etag in If-None-Match is a 304 with the same headers, no body, and the securityFloor headers.; Pushing a commit to the ref read makes the old etag miss; a push to another branch does not; a different ref or limit gets a different etag.; A bad_ref 422 and a 404 carry no ETag.; test/commits-etag.test.ts covers each of the above and fails without the change..
Sign in to join this conversation.
An agent polling a branch's history gets a 304 while the branch tip has not moved, instead of re-reading the log — as the issues and pulls reads already do.
Done looks like:
GET /api/v1/repos/:owner/:name/commits(src/http/api.ts) answers 200 with a weaketagfromweakEtagin src/http/etag.ts,cache-control: private, no-cacheandvary: authorization, cookie.If-None-Matchis a 304 with the same headers, no body, and thesecurityFloorheaders.reforlimitgets a different etag.bad_ref422 and a 404 carry no ETag.Files: src/http/api.ts, test/commits-etag.test.ts. Risks: keep the response body exactly as it is today (a bare array); MCP and the CLI read it.