Skip to content

test(proxy): measure the dashboard latency guard in up to 3 rounds - #1014

Merged
amiddavid merged 1 commit into
mainfrom
fix/flake-latency
Nov 10, 2026
Merged

amiddavid merged 1 commit into
mainfrom
fix/flake-latency

Conversation

@amiddavid

Copy link
Copy Markdown
Collaborator

Closes #1013

Test-only. No behavior change.

Summary

The latency guard now measures up to 3 rounds. It fails only when all 3 are over budget.

What we found

What changed

  • proxy/dash_test.go: the 40-pair measurement is now a round closure. The test runs it up to 3 times and returns on the first round within budget.
  • Budget, cap (45 ms) and TestLatencyBudgetStillCatchesTheRedactionRegression are unchanged.
  • No skip on CI.

How it was tested

All on the eval box, -race, 4 busy-loop cores (killed by pid after). Box shared, so the load was higher than 4 cores at times.

  • Before (origin/main test): go test -v -race -count=14 -run ^TestDashboardAddsNoRequestLatencyWithContentCapture$ ./proxy/. The command timed out at 8 runs. 1 of 8 failed (45.79 ms vs 45 ms). Others added 30 to 38 ms.
  • After: same command. 0 of 8 failed. Added 20 to 34 ms, all in round 1.
  • Mutation: time.Sleep(50ms) at the top of capture.finish, no load, -count=1. Baseline 59 ms, budget 12 ms. Added 55 ms in all 3 rounds. The test fails.
  • Full go test -race -count=1 ./proxy/...: ok. go vet and gofmt -l: clean.

Not verified

  • The -count=30 run did not finish in 10 minutes under load. I used 8 runs each way. The sample is small.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session fresh 1 of 2 1 of 2 c86ce3b8ba14 blocking

Verdict: blocking

Findings

  1. proxy/limitheaders.go:1 (file deleted) — the commit silently reverts three merged PRs while the commit message and the PR body say "test-only, no behavior change".
    • What fails: merge this head and main loses shipped features:
      • #991 (subscription limit headers, #984). The proxy stops reading anthropic-ratelimit-unified-* response headers. The requests schema columns, the two partial indexes, the Event.Limits and Event.AuthSubscription fields, the insert/scan code and the GET /api/me/limits route all go. Users lose that API.
      • #996 (restart seeding). SeedSessions goes back to seeding any status, not 2xx only, and to a per-thread tier, not per thread and model. dash/restartseed_test.go is deleted. The mislabeled cache_miss_reason values after a restart come back.
      • #1009 (Pi docs). The README "Pi (experimental)" section, docs/reference/pi-vs-claude-code.md and the mkdocs nav entry are deleted.
      • The docs/data-dependence.md row for #984 is removed with the feature.
    • Proof: git diff 1c624f0f..HEAD touches only proxy/dash_test.go (48 insertions, 32 deletions). 1c624f0f is main right before #991 merged. So the head tree is old main plus the test edit, while the commit's parent is 68113b9e, which contains #991, #996 and #1009. The diff 68113b9e..HEAD deletes 23 files / 1,230 lines: proxy/limitheaders.go, proxy/limitheaders_test.go, dash/limits.go, dash/limits_test.go, dash/restartseed_test.go, docs/reference/pi-vs-claude-code.md, plus the schema, query, store, capture, api, proxy.go and doc hunks named above. The commit looks like it was built from a stale checkout.
    • Extra fact: GitHub reports the PR mergeable_state: dirty against current main (7fd26dcd, #999).
    • Fix: do not merge this head. Rebuild the branch from 68113b9e carrying only the proxy/dash_test.go change, and force-push. The test change itself is good (see below). Per RELEASING.md, removing a user-facing API and reverting a shipped fix needs a human's named decision at the top of the PR; nothing here names it.

Non-blocking

  • The new failure message in proxy/dash_test.go:675 reports only the last round's added, budget and baseline. Round 1 and 2 figures appear only in t.Logf output, which -v-less CI drops. Consider naming every round's added/budget pair in the error.
  • Best-of-3 slightly weakens the guard: a real regression now passes if any one round hides it, not only the single round. This needs the off side to stall ~8 ms more than the on side across the median of 40 pairs, so it stays unlikely. No change needed.
  • The comment "noise only ever ADDS to the paired difference" (proxy/dash_test.go:657) is not strictly true: a stall on the off request subtracts. The median of 40 pairs is what makes the claim hold in practice. Comment-only.

What I checked

  • The full diff 68113b9e..HEAD: all 23 files, every hunk, including the deleted proxy/limitheaders.go and its 286-line test.
  • Tree proof of the silent revert: git diff 1c624f0f..HEAD (one file), git ls-tree HEAD for the deleted files, and the GitHub PR file list (same 23 files).
  • The intended change, proxy/dash_test.go: the round closure keeps pairing, interleaving and medians. The budget is recomputed from each round's own baseline. The test returns on the first round within budget and errors only after all 3 rounds fail. latencyBudget, the 45 ms cap and TestLatencyBudgetStillCatchesTheRedactionRegression are unchanged, as the PR says. No CI skip was added. I found no defect in this part.
  • Greps at head for me/limits, noteLimits, AuthSubscription, limitsRoutes, readLimitHeaders, callerIsSubscription, seedModels: no dangling references. The head tree is self-consistent (it is an old, compiling main tree plus one test edit).
  • The PR body and issue #1013: the intended change matches the issue's proposal.
  • No builds or tests were run (not approved). Read-only review.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session fresh 2 of 2 1 of 2 c86ce3b8ba14 blocking

Verdict: blocking

Findings

  1. The diff is not test-only: it reverts merged features #991 and #996 and deletes the docs its own parent #1009 added.

    • What fails: The PR says "Test-only. No behavior change." The commit c86ce3b8 deletes proxy/limitheaders.go, proxy/limitheaders_test.go, dash/limits.go, dash/limits_test.go, dash/restartseed_test.go, the GET /api/me/limits route, 8 schema columns, 2 partial indexes, the README Pi section and docs/reference/pi-vs-claude-code.md (added by the parent commit 68113b9e, #1009). That is 23 files and 1230 deleted lines against one test file named in the PR body. Users lose GET /api/me/limits and the stored limit and auth-kind values. The commit message and the PR body name none of it.
    • Proof: git diff 68113b9e..HEAD --stat shows the 23 files. git ls-tree 68113b9e dash/ lists limits.go, limits_test.go, restartseed_test.go; git ls-tree HEAD dash/ does not. git rev-parse HEAD^ = 68113b9e, so the deletions are made by this commit, not by a stale branch point. The PR body section "What changed" names only proxy/dash_test.go.
    • Fix: Restore every file the commit deleted except proxy/dash_test.go, and re-apply the #996 logic in dash/capture.go, dash/prefixcause.go, dash/event.go, dash/query.go, dash/schema.go, dash/store.go, proxy/dashcapture.go, proxy/proxy.go and the docs. If a revert of #991/#996/#1009 is wanted, it needs its own PR that names the change at the top, per the repo rule that a behavior change needs a human developer's written yes (CLAUDE.md, RELEASING.md).
  2. dash/capture.go:770 — restart seeding counts failed requests again, so a ttl_expiry reads as prefix_change or unknown.

    • What fails: A thread writes cache at T, then a request fails at T+5 min, then the proxy restarts. SeedSessions seeds the thread's recency from the latest row of any status (line 770-774 has no status >= 200 AND status < 300 filter). The failed request makes the entry look 5 minutes younger. The next request reports prefix_change or unknown instead of ttl_expiry. This is the exact defect #996 fixed.
    • Proof: The diff removes AND r.status >= 200 AND r.status < 300 from both halves of the query at dash/capture.go:770. Test TestRestartSeedRecencyIgnoresAFailedRequest (deleted dash/restartseed_test.go) covered it and fails on this code.
    • Fix: Restore the 2xx filter in both the outer query and the r2 subquery, and restore the deleted test.
  3. dash/prefixcause.go:107 — the seeded one-hour tier is per thread again, so one model's tier leaks into another model's TTL, and a fork loses its parent's tier.

    • What fails: A thread writes a 1-hour cache entry on model A, then works on model B. After a restart, seedTier is keyed by thread.Key(session, thread) only (dash/capture.go:200-203, 815-820). Model B's first read-only turn inherits A's 1-hour tier, so a miss 20 minutes later is not reported as ttl_expiry. Also, line 107 reads only r.seedTier[key]: a fork (hasFrom) no longer reads its parent's seeded tier, so the fork's first turn after a restart loses the parent's 1-hour tier and reports ttl_expiry at 5 minutes.
    • Proof: seededTier := !same && !hadAny && r.seedTier[key] at dash/prefixcause.go:107. #996 had r.seedTier[perModel(key)] plus the perModel(thread.Key(session, fromThread)) fallback for forks. Tests TestRestartSeedTierIsPerModel and TestRestartSeedTierGoesToAFork (deleted dash/restartseed_test.go) covered both.
    • Fix: Restore the per-model key (thread.Key + "\x00" + model), the fork fallback, and the two deleted tests.
  4. dash/capture.go:204 — seenModel is no longer seeded on restart, so the first request on a known model is again a cold_start.

    • What fails: The proxy serves model A, restarts, then serves model A again. SeedSessions no longer calls seedModels (the function is deleted), so r.seenModel starts empty. The first request on A after the restart is labeled first_on_model (cold_start) although the model was seen minutes earlier. The dashboard under-reports cache hits for every model in flight across a restart.
    • Proof: The diff deletes seedModels and the r.seenModel[mk] = true loop from SeedSessions. Tests TestRestartSeedsTheSeenModel, TestRestartSeedsNoModelFromFailedRows and TestRestartSeedsNoModelFromAPing (deleted dash/restartseed_test.go) covered it.
    • Fix: Restore seedModels (2xx, non-ping, distinct tenant+model) and the seeding loop, plus the deleted tests.

Non-blocking

  • The best-of-3 guard now passes a regression that is over budget in only 1 or 2 of 3 rounds. The comment at proxy/dash_test.go:657 argues a real regression adds its full size to every round. That holds for a fixed per-request cost, not for an intermittent one (a flush every N requests, lock contention). The PR documents the tradeoff and mutation-tested a fixed cost, so this is a note, not a block.
  • Existing databases keep the 8 limit columns and the 2 partial indexes forever (no DROP runs). Mixed schema state is harmless at runtime, but the indexes stay as dead weight on databases created before this change.
  • The round() closure and the 3-round loop in proxy/dash_test.go:603-678 are correct: budget recomputed per round, failure message reports the last round, early return on the first round within budget.

What I checked

  • The full diff, 1699 lines, all 23 files, including every deleted file in full.
  • Commit parentage: one commit on parent 68113b9e; the deletions are explicit in the commit, not a branch-point artifact. Verified with git ls-tree at base and head.
  • The PR body and issue #1013 (the flaky latency guard).
  • The new latency-guard test logic in proxy/dash_test.go, read in full at head.
  • Grep at head for me/limits, dash.Limits, LimitWindow, limit_seen, auth_subscription, seedModels, noteLimits, callerIsSubscription: no dangling references. The revert is self-consistent, so it compiles.
  • That no in-repo consumer calls GET /api/me/limits (the mod's band from #981 reads /api/stats), so nothing inside the repo breaks at compile time when the route disappears.
  • No builds or tests were run; live tests are not approved for this review.

The guard failed on a slow CI runner with 45.29 ms added against a 45 ms
budget, on a 759 ms baseline, with nothing wrong. Noise only adds time;
a real regression adds its full size to every round. The test now passes
on the first round within budget and fails only when all 3 rounds are
over budget. Budget and cap are unchanged. Test-only, no behavior change.

Closes #1013

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Both blocking findings are fixed. The head is rebuilt and contains only the test change.

  • Cause: the commit c86ce3b8 was made after a git reset --soft origin/main while the index still held the older 1c624f0f tree. So the commit recorded the old tree on top of the new parent. That deleted feat(proxy): record the subscription limit headers and serve GET /api/me/limits #991, fix(dash): seed seen models, per-model tier and 2xx recency on restart #996 and docs: compare Pi with the Claude Code plugin, add Pi to the README #1009.
  • Fix: I rebuilt the commit on origin/main. It carries only the proxy/dash_test.go diff. git diff --stat origin/main HEAD now shows 1 file. Reviewer 2's findings 2–4 (the fix(dash): seed seen models, per-model tier and 2xx recency on restart #996 regressions) go away with it.
  • Reviewer 1, non-blocking: the failure message now names the added time, the budget and the baseline of every round, because CI drops t.Logf without -v. Done.
  • Both, non-blocking (the comment on noise): the comment no longer says noise only adds. It says that over the median of 40 pairs, load pushes the difference up far more often than down. It also states the trade-off: a cost that shows up only now and then can pass one round. Done.
  • Tests on the box: go test -race ./proxy/... passes (544 s). go vet and gofmt are clean. The test alone passes 3 of 3 with -race.
  • Limit I found, older than this PR: under load (load average 9.3), a 50 ms sleep in capture.finish does not fail this test, on main and on this PR alike. Each handler has its own connection, and an "off" request takes longer than 50 ms. So the cost in the defer is absorbed before the next "on" request. The subagent's mutation run, with no load and a 59 ms baseline, did fail the test. I did not run that myself again. I will file this blind spot as its own issue.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 1 of 2 2 of 2 2fbb429763b9 approve

Verdict: approve

Findings

None. The head is rebuilt and now matches the PR description: one commit on current main, one test file changed.

Non-blocking

  • The author found a blind spot older than this PR: under load (load average 9.3), a 50 ms sleep in capture.finish does not fail this test, on main and on this head alike. I checked the reasoning and it holds: the defer's cost is charged to the next request on the same keep-alive connection, and when the pair-mate request on the other connection runs longer than the defer, the wait is absorbed. It is a limit of the guard on main, not a regression from this PR. The author will file it as its own issue — please make sure that issue is filed, so the blind spot is not forgotten.
  • The comment at proxy/dash_test.go:661-663 says the trade-off twice ("that is the price of not failing on one noisy round. One noisy round no longer fails the test"). Wording only.

What I checked

  • Last review: round 1, c86ce3b, 2026-11-10T08:20:50Z
  • New commits read: 1 (2fbb4297 test(proxy): measure the dashboard latency guard in up to 3 rounds). 7fd26dcd (#999) also appears in c86ce3b8..HEAD; it is main's own commit, not part of this PR.
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files in my folder).
  • New items since my last review: the rebuilt commit 2fbb4297 and the author's comment of 2026-11-10T08:46:13Z. Both read in full.
  • My round-1 finding (the silent revert of #991, #996, #1009): fixed. git diff 7fd26dcd..HEAD --stat shows one file, proxy/dash_test.go (50 insertions, 32 deletions). The parent of 2fbb4297 is 7fd26dcd, current main. dash/, proxy/limitheaders*, the schema, the docs and the README are untouched. The cause the author gives (git reset --soft over a stale index) matches my round-1 diagnosis of a stale tree.
  • My round-1 non-blocking notes: both adopted. The failure message now joins every round's added/budget/baseline into the t.Errorf (proxy/dash_test.go:665-680), so a -v-less CI run shows all rounds. The comment no longer claims noise only adds; it says a stall can land on either side and names the intermittent-cost trade-off.
  • Reviewer 2's findings 1-4: fixed or gone with the rebuild. I verified this myself: the diff no longer touches dash/capture.go, dash/prefixcause.go or any #996/#991 file, so the 2xx seeding, the per-model tier, seedModels and GET /api/me/limits are all back to main's state. Their non-blocking note about dead indexes is moot: the schema does not change any more.
  • The new commit's own code, read at head: the loop uses := inside the round loop (nothing escapes that should), every variable is used, the format strings match their arguments (4 verbs, 4 args in the error), rounds is never empty when the error fires, and fmt and strings are imported. latencyBudget, the 45 ms cap and TestLatencyBudgetStillCatchesTheRedactionRegression stay unchanged.
  • The PR body still says "Test-only. No behavior change." — now true of the diff.
  • The author reports go test -race ./proxy/... passes on the box, with go vet and gofmt clean. I did not run tests (not approved).

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 2 of 2 2 of 2 2fbb429763b9 approve

Verdict: approve

Findings

None. The head is rebuilt on the new base and carries only the test change.

Earlier findings

  • My finding 1 (hidden revert of #991, #996, #1009): fixed. git diff 7fd26dcd..HEAD --stat shows one file, proxy/dash_test.go (50 insertions, 32 deletions). The deleted files are back with their original blob ids: dash/limits.go f6aa6c4c, dash/limits_test.go 6a9eba50, dash/restartseed_test.go f4d428ab, proxy/limitheaders.go bdcbad45, proxy/limitheaders_test.go 4c79a28a, README.md 611af8c0, docs/reference/pi-vs-claude-code.md ea6c4873. git diff 68113b9e..HEAD -- dash/capture.go dash/prefixcause.go dash/event.go dash/schema.go proxy/dashcapture.go proxy/proxy.go is empty: the #991 and #996 logic is byte-identical to pre-rebase main.
  • My findings 2, 3, 4 (the #996 regressions: 2xx filter, per-model tier, seenModel seeding): fixed, by the same restoration. I re-read dash/capture.go:770-790 (2xx filter in both halves), dash/prefixcause.go:107-112 (per-model key and the fork fallback) and dash/capture.go (seedModels present, called from SeedSessions).
  • Reviewer 1's finding 1 (silent revert): fixed. Agree with reviewer 1; I verified it myself, as above. The rebase also clears the mergeable_state: dirty reviewer 1 saw: the head now sits on 7fd26dcd (#999), the current main.
  • Reviewer 1's non-blocking (failure message drops the earlier rounds): fixed. proxy/dash_test.go now builds a rounds slice, one line per failed round with its added, budget and baseline, and joins it into the t.Errorf. Format strings check out: 4 verbs, 4 args in the error; 8 verbs, 8 args in the per-round t.Logf.
  • Both reviewers' non-blocking (the "noise only ever ADDS" comment): fixed. The comment now says a stall can land on either request, that the median is what makes the claim hold, and states the tradeoff: an intermittent cost can pass one round.
  • My non-blocking (best-of-3 passes an intermittent regression): addressed as a documented tradeoff. The new comment names the exact case I raised (a flush every N requests). The design choice stands, and the PR's own mutation test covers a fixed cost. I accept it.
  • My non-blocking (dead limit columns on old databases): moot. The feature is back, so the columns and indexes are live again.

Non-blocking

  • The blind spot the author reported is not filed yet. The author's comment (2026-11-10T08:46:13Z) says a 50 ms sleep in capture.finish passes the guard under load, on main and on this PR alike, and "I will file this blind spot as its own issue." I checked the issue list: the newest issues (#1019 at 08:36, #1017 at 08:32) predate the comment, and #1017 is the false-positive flake, not this false negative. Please file the issue, so the guard's known limit is tracked.
  • The comment at proxy/dash_test.go:657 breaks one sentence across lines ("One noisy round / no longer fails the test"). Read as one sentence it is right. Comment-only.

What I checked

  • Last review: round 1, c86ce3b, 2026-11-10T08:21:00Z
  • New commits read: 2 (7fd26dcd feat(dash): store the accountant's tier tokens and serve them from /api/stats (#999) — the new base, merged from main; 2fbb4297 test(proxy): measure the dashboard latency guard in up to 3 rounds — the rebuilt PR head)
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt)
  • New items since my last review:
    • The force-push to 2fbb4297: read the full range diff c86ce3b8..HEAD (2964 lines — the restoration, #999, and the test change) and the PR diff 7fd26dcd..HEAD (108 lines, one file).
    • The author's comment at 08:46:13Z (cause: git reset --soft with a stale index; fix: rebuild on origin/main; two non-blocking fixes; box test results; the blind-spot report): checked every claim it makes against the head, as recorded above.
    • Reviewer 1's round-1 review at 08:20:50Z: read now that my round-1 review is posted. Its finding matches mine; its three non-blocking items are all addressed.
  • The PR's own change, proxy/dash_test.go:603-678 at head, read in full: the round closure keeps pairing, interleaving and medians; the budget is recomputed from each round's own baseline; the test returns on the first round within budget; latencyBudget, the 45 ms cap and TestLatencyBudgetStillCatchesTheRedactionRegression are unchanged; no CI skip; fmt and strings are imported.
  • The interaction of #999 with #991 in dash/query.go, dash/store.go and dash/schema.go at the new base: read in the range diff. The head adds nothing on top of main there, and #999's own review covered that merge.
  • The issue list, for the blind-spot issue the author promised.
  • No builds or tests were run; live tests are not approved for this review.

@amiddavid
amiddavid merged commit ca1f215 into main Nov 10, 2026
10 of 11 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 10, 2026
amiddavid added a commit that referenced this pull request Nov 10, 2026
Clean merge, no conflict.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
amiddavid added a commit that referenced this pull request Nov 10, 2026
At each Pi session start, the Pi extension now checks the local
proxy with one GET /healthz (5-second limit). If the proxy does not
answer, it restarts the proxy's user service once and checks again.
If the proxy is still down, Pi shows one warning, not only a
connection error on every routed request.

Behavior change: Pi users who installed context-guru with
/context-guru setup, and only when a Pi model goes to the proxy. Old:
nothing checked the proxy, and a down proxy showed only connection
errors. New: the check, one restart, and one warning. No switch;
pi --no-extensions turns off the whole extension, and
/context-guru uninstall removes the install record and so the check.
Owner's yes, 2026-11-10, in the integrator session: "1011 behavior change approved".

Data dependence: metadata only. A bare GET /healthz to localhost with
no body. It reads the install record and the model URLs Pi knows. No
change to stored data.

Reviews: 2 offload reviews (GLM), round 3 (owner granted round 3), both approve at 655a6a9. Round 3 reviewed the merge of main after #1010, which changed the same 5 pi-package files.
Two later merges of main (1077d80 after #1012, d4124cd after #1014)
change no #1011 code: their remerge-diff outside
docs/data-dependence.md is 0 lines; the one doc conflict kept both
rows.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
amiddavid added a commit that referenced this pull request Nov 11, 2026
#1031)

The latency test compared whole-request wall time with the dashboard on
and off. On a slow runner the baseline was 500-730 ms and the added time
was 49-77 ms in every round, so best-of-3 (#1014) did not help. It also
missed a 50 ms sleep in capture.finish under load.

The test now sums the time of the dashboard's own calls on the request
goroutine (newCapture, the note* methods, finish) through spendHook, a
test-only hook. The hook is nil in production.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
amiddavid added a commit that referenced this pull request Nov 11, 2026
#1031)

The latency test compared whole-request wall time with the dashboard on
and off. On a slow runner the baseline was 500-730 ms and the added time
was 49-77 ms in every round, so best-of-3 (#1014) did not help. It also
missed a 50 ms sleep in capture.finish under load.

The test now sums the time of the dashboard's own calls on the request
goroutine (newCapture, the note* methods, finish) through spendHook, a
test-only hook. The hook is nil in production.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test: TestDashboardAddsNoRequestLatencyWithContentCapture still flakes on a slow CI runner

1 participant