Repository navigation
fix(aggregator): expose search stage timings on cache hits - #16790
Conversation
A search-context cache hit returned only a lone cache timing, so the Server-Timing header lost every in-process stage (board, roadmap, ...) and the boot test's stage-timings oracle failed on main whenever the page fetch followed the JSON fetch for the same query. The computed stage timings now ride the cache entry (as a snapshot, so per-request render/serialize/total mutations cannot leak into it) and a hit merges them with its own cache timing.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Executor verdict for run 46266693307 (Felix fix lane, 2026-11-29): this run's Linux job FAILED AT TARGET CHECKOUT — the verification command for this PR (aggregator boot + search-cache tests, then tsc) never executed. actions/checkout's git fetch of ref |
Closes #16785
Problem
On a search-context cache hit,
searchContextreturned only{cache}as its timings, so the Server-Timing header lost every in-process stage (board, roadmap, registry, dns, usage, orchestration, items, search). The boot test fetches/api/search.json(a miss, which warms the cache) and then/searchfor the same query (a hit), somainfails the stage-timings oracle attest/boot.test.ts:81withcache;dur=…, render;dur=…, total;dur=…and noboardstage.Fix
The stage timings recorded while a search value is computed now ride the cache entry (stored as a snapshot, so per-request render/serialize/total mutations cannot leak into the stored entry). A hit merges the stored stage timings with its own
cachetiming; a miss is unchanged.Verification
Remote fleet-command run at the exact head (dispatched with this PR; run id + executed counts recorded on #16785):
bun test test/boot.test.ts test/search-cache-14060.test.tsin pm-stack/aggregator plusbunx tsc --noEmit.Oracle: the boot test named in the issue — every named stage present in the Server-Timing header for both the JSON and page fetches.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-29T13:17:22Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "ac3f377b7f752f50918f491d7443b79e95b5dc34" }, "auth_subject": "felix", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.