Repository navigation
Assert asset caching on the response, not the browser cache. - #319
Conversation
Test 1 read `cache-control` from a HEAD issued after the page load, so it reported the entry the browser had already stored instead of the response the platform produced. The immutable stamp lives on gets to hashed paths, so a conditional HEAD asserted a contract it never measured. Fetch with `cache: 'no-store'` for a network response, and assert the status too, so a missing or fallback-served asset fails with the status in the message.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_a61c2e51-d2f6-4dea-a16d-9a00fd6d25da) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d033544098
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The runbook told agents to HEAD a hashed asset — the probe this branch replaces in the automated test — so following it could report the same false failure. Document the sync XHR get instead (cache-busted, because `agent-browser eval` is sync-only) and the header to expect.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_7e06e1ff-7867-4cf2-b0e1-b0b8948162c3) |
The staging smoke test fails 1 of its 11 assertions, and the assertion is measuring the wrong thing.
What failed
The other ten assertions pass (SPA nav, layout, DB, KV, R2, env, queues, auth, cron, ISR). The app is fine; the check is not.
Why the check was wrong
It read
cache-controlfrom aHEADissued after the page load:Two things make that meaningless as an asset-caching assertion:
HEADis answered from (or revalidated against) what the browser stored, and the test reads whatever that entry says — not the response the platform just produced.HEADis outside the contract it claims to test. The dispatch edge cache stampspublic, max-age=31536000, immutableonGETs to hashed paths only (platform/packages/dispatch/src/index.ts:737); aHEADfalls through the generic path (the code says so explicitly atindex.ts:747-750). AHEADalso can't be stamped by theCache-Controlpass, which is applied to cache-eligibleGETresponses.The fix
Fetch with
cache: 'no-store'so the request must go to the network, and assert the status too, so a missing or fallback-served asset fails with the status in the message rather than only a header mismatch:Still an in-browser fetch (not curl) — CF edge cache rules differ for browser and non-browser clients.
The manual runbook carried the same
HEADprobe (platform/scripts/kitchen-sink-smoke-test.md, test 1), so an agent following it could report the same false failure. It now documents a sync XHRGETwith a cache-busting query parameter —agent-browser evalis sync-only, sofetch(..., { cache: 'no-store' })is not available there — plus the snippet and the expected header.Verified
platform-smoke-test.ymldispatched on this branch: all 11 assertions pass on staging.200+public, max-age=31536000, immutable, including the runbook's sync-XHR variant.Not in this PR
HEADs to hashed assets are not stampedimmutablewhen the origin answers 304 (dispatch only stampsresponse.ok, i.e. 2xx —index.ts:913,index.ts:942), and the WFP asset fallback omitsCache-Controlentirely on aHEAD. Both are unexercised by the suite today. Left alone here: the browser asset path isGET, where the contract holds.