Repository navigation
test(proxy): drive the sweep's warm path on Bob's route (#1191) - #1192
Conversation
A 64-turn Bob chat on bob-ultrahigh, with Bob's prices and a large, old grep output, must get one sweep question at Bob's model path with Bob's Apikey login. It fails on main on 2 blockers, each one enough alone: no conversation copy without a ping, and every Bob request counted cold. Skipped with #1191 until the fix PRs remove the skip. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | fresh | 1 of 2 | 1 of 2 | aa4bd29fe3fe |
approve |
Verdict: approve
Findings
None. The PR adds one test file and changes no code. The test is skipped with a reason and a linked issue (#1191), as the repo rules require.
Non-blocking
proxy/bobsweep_test.go:150— the test waits forlen(up.questions()) > 0. The header comment and the PR say "one sweep question". If the fix PRs want to prove "exactly one", add a check after the wait (with 64 turns, the next check comes at about turn 90, so a second question is a defect). Polling for "== 1" is racy, so check it after the loop, not in the wait.proxy/bobsweep_test.go:154— the failure message printsw.TriggerReasonsas the full process total, but the other values as deltas frombefore. Other tests in the package can add to that map. A delta, or a note in the message, makes the diagnosis clearer.proxy/bobsweep_test.go:158— the test checks path and auth, but not the question'smodel. A check that the question usespremium-ide(or the model the fix intends) would also catch a wrong-model route on Bob.- I could not confirm the PR's table of runs (fails on
main, passes with both blockers fixed). Go is not installed here, and live tests are not approved.
What I checked
- The full diff (166 lines, one new file) and the commit message (DCO sign-off and
Assisted-By:present). - Every helper the test uses exists with the right signature in the
proxytest package:bobPreset(bobdefer_test.go:106),bobFixtureTools(bobdefer_test.go:43),csCall(tooldefer_search_test.go:87),itoa(prefixask_test.go:61),authScheme(agentmodel_test.go:279),bobModelPath(proxy.go:747). - Library calls:
offload.SweepWarmCounters/SweepPingCountersand the fieldsFired,Asked,NotRegistered,TriggerReasons;testutil.WaitForState(t, what, cond, state);modelinfo.LoadTablereturns*Table, and*TablehasPrice, so it satisfiesOptions.Prices(modelinfo.Pricer);tooldefer.FileName;store.NewMemory(store.Options{});Handler.CloseandHandler.Mux. sweepQuestionMarkmatches the text thatinternal/extract/adjudicate.go:239(BuildPrefixAsk) writes, so the comment's reference is right.proxy/testdata/bob_ultrahigh.yamlturns onextract_llm_sweepwithwarm: trueandmin_tokens: 1000. The grep output (600 lines, about 36 KB) is far above that.- The defaults the comment names are real:
defaultWarmEveryN = 30,defaultWarmMinAgeTurns = 30(components/offload/extract_sweep_warm.go:44-45). The turn-60 reasoning agrees with them. bob-plugin/context-guru/prices.yamlhas apremium-iderow, so the request model has a price.- The JSON the test builds: the
\\nin the grep format string and the\\(in the tool argument both give valid JSON escapes. The fake upstream'scached_tokens = prompt-50stays positive, because the smallest prompt carries the full grep. - The fake key
bob-caller-keyis a placeholder. The failure message prints only the auth scheme, not the value. - Fail open and data dependence: not affected (test only, no feature).
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | fresh | 2 of 2 | 1 of 2 | aa4bd29fe3fe |
approve |
Verdict: approve
Findings
None.
Non-blocking
- The test does not run yet.
t.Skipatproxy/bobsweep_test.go:124is the first statement, so the PR adds no coverage until a fix PR of #1191 removes the skip. The skip has a reason and a linked open issue, so it follows the rules. I could not confirm the claim "fails on main today" for the intended reason, because live tests are not approved. The fix PR that removes the skip must show the test fail before its fix and pass after. - 2 blockers in the test, 3 in the issue. The comment at lines 121-123 names 2 blockers. Issue #1191 names 3 ("30-turn defaults" is the third). The test steps around the third with 64 turns (lines 132-134). Say so in the comment, so the fix PR for the defaults knows that this test does not cover it.
- The turn-30 comment may not match the trigger. Lines 132-134 say the count "restarts" after a check with no candidate. If the trigger instead checks again on each next turn, the question comes at about turn 31, not 60. The test passes either way (it only waits for one question by turn 64). Only the comment can be wrong.
bobSweepHandler(lines 69-87) is a copy of the handler set-up inbobdefer_test.go:92-104, with onlyPriceschanged. A shared helper with aPricesargument would keep the two in step. Small point.- The failure message at line 164 prints only the auth scheme (
authScheme), not the key. Good.
What I checked
- Read every line of the only changed file,
proxy/bobsweep_test.go(166 new lines), and the commit message. - No behavior change: test-only PR. No data-dependence row is needed (no feature or component change).
- Every helper it uses exists in package
proxywith the used signature:bobPreset,bobFixtureTools(bobdefer_test.go),csCall(tooldefer_search_test.go:87),itoa(prefixask_test.go:61),authScheme(agentmodel_test.go:279),bobModelPath(proxy.go:747). - Library calls match:
offload.SweepWarmCounters(fieldsFired,Asked,NotRegistered,TriggerReasons),offload.SweepPingCounters(NotRegistered),testutil.WaitForState(t, what, cond, state),modelinfo.LoadTable,tooldefer.FileName,Options.BobUpstream/ToolDeferPath/Prices,Handler.Close/Mux. All imports are used. - JSON escapes are valid: the grep lines use
\\nin a Go string, so JSON gets\n.csCallquotes the arguments with%q, soserve\\(w, rbecomes a valid JSON\\. bob-plugin/context-guru/prices.yamlexists and pricespremium-ide. The presetproxy/testdata/bob_ultrahigh.yamlturns onextract_llm_sweepwithwarm: true. The defaultswarm_every_nandwarm_min_age_turnsare 30 (extract_sweep_warm.go:44-45), as the comment says.- The fake upstream uses the
sweepQuestionMarkline to find sweep questions. The normal Bob request bodies do not hold that text. - Issue #1191 is open.
Round 1 review of #1192: the test now checks exactly 1 question and the question's model, prints the trigger reasons as deltas, and says that #1191's blocker 3 is not covered. bobDeferHandlerBare and the sweep test share one priced Bob handler. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
|
Round 1 replies. Both reviewers approved; the non-blocking points are answered here. The fixes are in 810f30c. Reviewer 1
Reviewer 2
Assisted-By: Claude (Anthropic AI) [email protected] |
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 2 of 2 | 2 of 2 | 810f30c5f3ad |
approve |
Verdict: approve
Findings
None.
Earlier points
Both round-1 reviews had no findings. Status of the non-blocking points:
Reviewer 1
- Check exactly 1 question: fixed (
bobsweep_test.go:152-155). - Trigger reasons as a process total: fixed. The message now prints deltas from
before(lines 140-145). A read from a nilbefore.TriggerReasonsmap gives 0, so this is safe. - Check the question's model: fixed (lines 157-159).
- Run table not confirmed: the author reports a local run (fails on
mainwithping: not_registered 64, passes with both blockers patched out). I cannot confirm it. Live tests are not approved.
Reviewer 2 (mine)
- The test does not run yet: accepted as intended. The fix PR removes the skip.
- 2 blockers in the test, 3 in the issue: fixed (line 108).
- The count may not restart: rejected by the author, and the reason is right.
extract_sweep_warm.go:921-926setst.count = 0beforewarmWorthAsking, under the comment "The count restarts here whether or not a question follows". So the check at about turn 30 finds no candidate, and the next check is at about turn 60. The test comment is correct. I withdraw the point. - Copied handler set-up: fixed.
bobHandlerPriced(bobdefer_test.go:96-112) holds the set-up.bobDeferHandlerBareandbobSweepHandlerboth call it.
Non-blocking
- The "exactly 1" check (line 152) runs right after the first question arrives. A second question that is still in flight at that time is not seen. Today this cannot happen, because the next check is due at about turn 90. If a fix PR makes the trigger fire more often, this check can miss it. It cannot give a false failure.
What I checked
- Last review: round 1, aa4bd29, 2026-11-17T09:40:33Z
- New commits read: 1 (810f30c "test(proxy): check one question, its model; share the Bob handler")
- Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review: 1 author comment (2026-11-17T09:45:53Z) with replies to both reviews. I checked each reply against the code, as listed under "Earlier points".
- Read the full diff
aa4bd29f..810f30c5(2 files, +27 -20), and the code around it inbobdefer_test.go:60-112. - Imports:
bobsweep_test.godropsconfig,metrics,store,tooldefer, which it no longer uses. It still usesfilepath,modelinfo,strings,sync,gjson.bobdefer_test.goaddsmodelinfofor the newprices modelinfo.Pricerparameter. tdPrices{}was already passed asOptions.Prices, so it satisfiesmodelinfo.Pricer.bobDeferHandlerbehaves the same as before.- No typed-nil risk:
modelinfo.LoadTablereturns*Table. On an error,t.Fatalstops the test before the value is passed. - The model check matches the request:
bobSweepBodysends"model":"premium-ide". - Test only. No behavior change and no data-dependence change.
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 1 of 2 | 2 of 2 | 810f30c5f3ad |
approve |
Verdict: approve
Findings
None. The new commit fixes my 3 non-blocking points and 3 of reviewer 2's 4 points. The author rejected one point with a correct reason.
Status of earlier points
- Reviewer 1, point 1 (exactly 1 question): fixed.
proxy/bobsweep_test.go:150-154checkslen(qs) == 1after the wait, not in the wait. That is not racy. The wait returns at the first question. A second question needs a second trigger, and the trigger restarts its count (see below), so a second question by turn 64 is a real defect. - Reviewer 1, point 2 (trigger reasons as totals): fixed. Lines 140-145 print deltas from
before. The counters only grow, so a key inbeforeis always inwtoo, and the loop overw.TriggerReasonsdoes not miss one. - Reviewer 1, point 3 (question model): fixed. Line 157 checks
model == "premium-ide". - Reviewer 1, point 4 (run table not confirmed): the author re-ran on 810f30c with a local patch and gave the results. I still cannot run Go here. This stays unverified by me. It is not a defect.
- Reviewer 2, point 1 (the test does not run yet): the author agrees. The skip is intended, and the fix PR must show fail-then-pass. I agree.
- Reviewer 2, point 2 (blocker 3 not named): fixed. Line 108 says that this test does not cover blocker 3.
- Reviewer 2, point 3 (the count may not restart): rejected by the author. The reason is correct.
components/offload/extract_sweep_warm.go:921-927setst.count = 0beforewarmWorthAsking, under the comment "The count restarts here whether or not a question follows". So the check at about turn 30 resets the count, and the next check comes at about turn 60. The comment at lines 118-120 is right. - Reviewer 2, point 4 (copied handler set-up): fixed.
bobHandlerPriced(proxy/bobdefer_test.go:95-109) holds the set-up.bobDeferHandlerBarecalls it withtdPrices{}, so its behavior does not change.bobSweepHandlercalls it with the loaded price table.
Non-blocking
- None new.
What I checked
- Last review: round 1, aa4bd29, 2026-11-17T09:40:18Z
- New commits read: 1 (
810f30c5test(proxy): check one question, its model; share the Bob handler) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-1 review (09:40:33Z): read each of its 4 points. Checked the author's answer to each, above.
- The author's round-1 replies (09:45:53Z): checked each claimed fix in the diff. Checked the rejection of reviewer 2's point 3 against
extract_sweep_warm.go:921-927.
- The full diff
aa4bd29f..810f30c5(2 files, +27 −20), and the code around each change. - Imports:
bobsweep_test.godropsconfig,metrics,store,tooldefer. None of them has a use left in the file.gjson,modelinfo,testutilandoffloadstill have uses.bobdefer_test.goaddsmodelinfofor themodelinfo.Pricerargument. *modelinfo.TableandtdPricesboth satisfymodelinfo.Pricer. The other callers that build their own handler withtdPrices{}(tooldefer_search_test.go:103,tooldefer_866_test.go:99) do not change.- The commit has a DCO sign-off and an
Assisted-By:line. - Test only: no behavior change, no data-dependence change, fail-open not affected.
No behavior change. This PR adds one test and changes no code. Data dependence: none (test only, no feature).
Summary
PR 1 of the plan in #1191. A test drives the sweep's warm path end to end through the proxy, on Bob's route, with the real
bob-ultrahighpreset and Bob's real prices. It expects one sweep question, sent to Bob's model path with Bob'sApikeylogin. It fails onmaintoday, so it is skipped with#1191. The fix PRs remove the skip.What changed
proxy/bobsweep_test.go:Authorizationand body. It bills about 1.5× the local size and reports most of the prompt as a cache read, as both Bob backends do.proxy/testdata/bob_ultrahigh.yamlandbob-plugin/context-guru/prices.yaml.X-Task-Id). It starts with a largegrepresult, then 63 small tool calls.TestBobUltrahighSweepAsksBobOnALongChat: waits (testutil.WaitForState) for a body with the sweep question. Then it checks the path and the auth scheme. On failure it prints the sweep's warm and ping counters.How it was tested
mainas isping: not_registered 64,trigger_reasons map[]ping: not_registered 64,warm: not_registered 1trigger_reasons map[](every request cold)--- SKIP;make lintclean;go test ./proxy/okSo each blocker alone stops the sweep, and the test passes when both are fixed.
What we found while writing it
extract_llmcuts a large source-file read on the first turn. Its model-free window keeps 4,000 characters. So the sweep never sees that output. The test uses agrepresult instead, becauseextract_llmtreats it as fact-dense and leaves it whole (components/offload/contentclass.go). This is the preset working as designed. It means that on Bob, the sweep can only work on whatextract_llmleaves.warm_every_n(30). At that time the first tool output has only 29 later model turns, andwarm_min_age_turnsis 30. The count then restarts, so the next check is at about turn 60. This adds to blocker 3 in bob-ultrahigh: 3 blockers stop the sweep on Bob (no copy without a ping, every request cold, 30-turn defaults) #1191.Why skip, not merge red
A red test breaks CI for every PR. The skip names #1191. PRs 2 and 3 of #1191 remove it, and the test then proves the fix end to end.
Assisted-By: Claude (Anthropic AI) [email protected]