Repository navigation
fix(sweep): with warm on, keep the copy without a ping (#1191) - #1193
Conversation
The warm question asks after a forwarded request, from the ping registry's conversation copy. That copy was kept only for a thread the keep-alive can ping, so IBM Bob's route (an OpenAI provider, cache strategy none) never asked. With warm: true the registry now keeps its copy for any thread. Still one copy only (option B); presets without warm keep today's rule. Blocker 1 of #1191. 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 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 | b98d64d86072 |
blocking |
Verdict: blocking
The fix does what the PR says for the warm question on IBM Bob. But keepsCopy also feeds the keep-alive's ping path, and the PR does not name that change. The new copy can also stay in memory longer than the row says.
Findings
-
components/offload/extract_sweep_ping.go:265 — with
warm: true, the keeper's ping substitute now asks on threads thatcanPingrefused. The PR does not name this behavior change.- What fails:
registerPingis the only gate between the keep-alive and a ping-time sweep question. Before this PR, a thread had a registry entry only whencanPingsaid yes. Now, withwarm: true, every thread has one. Two kinds of thread that the keeper does ping, butcanPingrefuses, now get a paid sweep question in place of a plain ping:- An OpenAI thread with keep-alive on.
canPingrefuses OpenAI on purpose: "the provider is not OpenAI (the sweep's question is Anthropic only)" (proxy/keepalive.go:422-428). But the keeper still pings OpenAI threads, on their own cadence (proxy/keepalive.go:490-495, keepalive/keeper.go:934 "OpenAI pings 28 minutes").fireSubstitute(keepalive/keeper.go:2347) has no provider gate.ClaimPingseeshasSweep(ping_claim.go:116) and picksPingSweep.SweepPingSubstituteasks through the storedPrefixAsk, which on OpenAI Chat ischatPrefixAsker(proxy/prefixask.go:395). - A tool wait outside a time window (#858). proxy/keepalive.go:431-433 says such a thread "registers no conversation copy and still gets its plain ping; it loses only the sweep substitute". With
warm: trueit now keeps the substitute. - The same entry also makes
extraReadyLocked(keepalive/keeper.go:2282,HasSweepPingCandidate) fire the #776 extra sweep request on these threads.
- An OpenAI thread with keep-alive on.
- Proof: the trace above. The row text added in this PR also says "A ping never comes on such a route, so the warm question is the only one that reads the copy". That is true for Bob with cache strategy
none, but false for the 2 cases above. The PR's "Who / Old / New" block names only the warm question. - Fix: keep the ping path on its old rule. One way: store on the candidate whether
CanKeepAlive()said yes at registration (for examplepingable bool). ThenSweepPingSubstituteandHasSweepPingCandidaterefuse an entry that is not pingable, and only the warm path reads it. Add a test: warm on,CanKeepAlivefalse, thenSweepPingSubstitutereturns ok=false andHasSweepPingCandidatereturns false. If the wider behavior is wanted, name it at the top of the PR and get a human's yes, as CLAUDE.md requires.
- What fails:
-
components/offload/extract_sweep_ping.go:283 — on a route the keeper never tracks, the new copy is not bounded to 30 minutes, and it is kept on every request, not only when a question waits.
- What fails: the row says the copies are kept "for at most 30 minutes". Three things clear a copy:
pruneSweepPingLocked,clearSweepPingandclearStaleSweepPing.pruneSweepPingLockedruns only insideregisterPing(line 303), so it runs only when some thread registers.clearSweepPingruns fromClearKeepAliveCandidate, and the keeper calls it only for a thread ink.live(retireLockedreturns at keepalive/keeper.go:1175-1177 when there is no entry). A Bob thread with strategynoneis never ink.live:Recordretires at line 836 and finds nothing.clearStaleSweepPingruns on the next request of the same thread only. So, on a local proxy with one Bob user, the last thread's 2 full conversation copies stay in memory until a later registration on any thread. That can be hours, not 30 minutes. Before this PR, this gap existed only for a host without a keeper. Now it is the main route of the feature. - Also: on such a route, the copy is read only by the warm question of the same request (
registerWarm→ResolveWarmQuestion). ButregisterPingkeeps it on every request, also when the trigger did not fire. So the content stays in memory for the whole idle span, though nothing can read it after the warm question is resolved or not fired. - Proof:
grep -rn pruneSweepPingLockedgives one caller, extract_sweep_ping.go:303. keepalive/keeper.go:1173-1177 and 832-839 for the retire path. - Fix: for an entry that is not pingable (see finding 1), drop it in
runWarmQuestionafter the ask ends, and on the request path when no warm question is pending. Or at least prune by age on every read (SweepPingSubstitute,runWarmQuestion), and correct the row text to say what the bound really is. David Amid must confirm the row in any case.
- What fails: the row says the copies are kept "for at most 30 minutes". Three things clear a copy:
Non-blocking
- extract_sweep_ping.go:262-264: the
keepsCopydoc says "The keep-alive asks from it at a ping". After finding 1 is fixed, say which of the 2 readers can read a non-pingable entry. - The PR says
bob-plugintests were still running. Post the result before merge.
What I checked
- The full diff: extract_sweep_ping.go, extract_sweep_warm.go, extract_sweep_warm_test.go, both data-dependence row files and the generated page (the page lines match the rows).
registerPing,snapshotCandidate, the prune and clear functions,SweepPingSubstitute,registerWarm,runWarmQuestionand its latch.- Every reader of
sweepPingCand:ClaimPing,HasSweepPingCandidate,SweepPingSubstitute,runWarmQuestion. - Host side:
canPing,resolvePolicyWindows(OpenAI cadence), keeperRecord,retireLocked,fireSubstitute,fireSweepSubstitute,extraReadyLocked,prefixAskerForAPI. - The test: both cases (hook false, hook nil) set
warmon throughwarmCfg, and the old assertion was replaced on purpose, as the PR says. The remaining "no registry copy" subtests still guard option B. No test covers the ping path with warm on andCanKeepAlivefalse. - The PR states the behavior change and the data-dependence change at the top, and names David Amid as the person who must still confirm.
- I did not run Go tests (not approved here).
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 | b98d64d86072 |
blocking |
Verdict: blocking
The code change is small and correct for its goal. One finding: on the newly enabled route, the "at most 30 minutes" bound in the data-dependence row is not true.
Findings
- components/offload/extract_sweep_ping.go:283 — a copy on a thread the keeper does not track can stay in memory past 30 minutes
- What fails: a Bob session with
bob-ultrahighregisters its 2 conversation copies, then the user stops. No later request registers on any thread. The copies stay in memory for as long as the process runs, not 30 minutes. With 256 threads, that is up to 256 full conversations, kept longer than the row says. - Proof:
- Only 3 paths remove a
sweepPingCandentry:clearSweepPing(fromClearKeepAliveCandidate),clearStaleSweepPing(from the next request on the same thread, proxy/proxy.go:1594), andpruneSweepPingLocked. ClearKeepAliveCandidateruns only from the keeper (keepalive/keeper.go:663, 1187, 1229, 1291, 1326; lifecycle.go:121; manualhold.go:242). The keeper never tracks a thread thatcanPingrefuses (proxy/keepalive.go:426, OpenAI is refused at :427-428).pruneSweepPingLockedruns only insideregisterPing(extract_sweep_ping.go:303). There is no timer and no age check at read time (runWarmQuestion, extract_sweep_warm.go:1144).- The code comment at extract_sweep_ping.go:230-232 says it: the keeper clears a registration, and the 30-minute age "is the backstop for hosts that run without it". Before this PR, a registered thread always had the keeper. After it, the backstop is the only path on Bob's route.
- The rows this PR edits say "for at most 30 minutes" (docs/data-dependence/components/extract_llm_sweep.md
where, and the body-stash row by reference). The PR banner asks David Amid to confirm "30 minutes each".
- Only 3 paths remove a
- Fix: one of these.
- Enforce the bound: prune on read as well (in
runWarmQuestion,HasSweepPingCandidate,SweepPingSubstitute), and run a prune from a timer or fromResolveWarmQuestionon every request. A test: register a copy withCanKeepAlivefalse, moveregisteredAtback past 30 minutes, call no other registration, and expect the entry gone at the next read. - Or change the row to the true bound ("30 minutes, removed at the next registration after that") and let David confirm that text.
- Enforce the bound: prune on read as well (in
- What fails: a Bob session with
Non-blocking
- Stale comments that now contradict the code. Please update them with this PR:
- components/offload/extract_sweep_warm.go:30-31: "so it asks only on threads the keep-alive can ping". That is the old rule.
- components/component.go:753-758 (
CanKeepAlive): "registers only when it returns true". Withwarm: trueit registers without it. - proxy/keepalive.go:430-432 (
canPing): "A tool wait outside a window then registers no conversation copy". Withwarm: trueit does. - components/offload/extract_sweep.go:80 and :174, and extract_sweep_warm.go:25: "in no preset".
bob-ultrahighsetswarm: true(proxy/testdata/bob_ultrahigh.yaml:27). The PR fixed this in the row but not in the code.
e.warmskips everycanPinggate, not only the OpenAI one. It also skips the kill switch, the policy-off case and the "no tool call yet" case. So an Anthropic thread withwarm: trueand keep-alive off now keeps copies too. The banner says "on a thread that the keep-alive cannot ping", so this is covered in words, but the "Who" line names only Bob. Consider saying in the banner that any route withwarm: trueis affected, and that the kill switch does not stop the warm question.- A side effect on Anthropic threads. A thread that
canPingrefused at record time (a tool wait outside a window, proxy/keepalive.go:430) can now have a copy. If the keeper pings that thread later,ClaimPingcan pickPingSweep(components/offload/ping_claim.go:116-125) where it used to send a plain ping. TheendsAtTextguard (keepalive/keeper.go:2356-2359) still keeps the cache rule. I think this is safe, but it is a behavior change the banner does not name.
What I checked
- Read the full diff:
extract_sweep_ping.go,extract_sweep_warm.go,extract_sweep_warm_test.go, the 2 row files and the generateddocs/data-dependence.md. The generated page matches the 2 row files. - Read the commit message and the PR body, including the behavior-change banner.
- Read
registerPing,snapshotCandidate,mayHaveCandidate, the prune and clear functions,registerWarm,runWarmQuestion,askWarm,ClaimPing,HasSweepPingCandidate. - Traced every caller of
ClearKeepAliveCandidateandClearStaleKeepAliveCandidate, and the proxy'scanPingandCanKeepAlivewiring (proxy/modes.go:71). - Checked that the OpenAI Chat route gets a
PrefixAsk(proxy/prefixask.go:392-418), soregisterPingdoes not return early on Bob for that reason. - Checked that the manual Ping button sends a plain ping and never a sweep question (keepalive/manual.go:137), so a new copy cannot turn a press into a paid question.
- Checked the new test: both cases (
falsehook andnilhook) expect 1 question andNotRegistered == 0. The kept subtests still cover "no registry copy" and "no own copy". The warm-off guards (TestWithKeepAliveOffNothingIsRegistered,TestNoAskerOrObserveModeRegistersNothing) are unchanged. - Fail open: no new error path.
keepsCopyis a pure boolean. - Did not run tests: live tests are not approved and Go is not installed here.
Round 1 review of #1193. A copy kept for a thread the keep-alive cannot ping is now marked not pingable: SweepPingSubstitute and HasSweepPingCandidate do not see it, so the keep-alive pings exactly as before. It is kept only while a warm question is due, and dropped when the question ends or the request fails, so it never outlives the 30-minute bound on a route no keeper tracks. Stale comments and the data-dependence rows now say so. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
|
Round 1 replies. Both findings were real. Fixed test-first in 035a635. The PR text at the top is updated. Reviewer 2, finding 1: the ping path read the new copy. Fixed.
Both reviewers: the 30-minute bound was not enforced on a route no keeper tracks. Fixed by a shorter life, not by a timer.
Reviewer 1, non-blocking: stale comments. Fixed: Reviewer 1, non-blocking: Reviewer 2, non-blocking: the Checks on 035a635: 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 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 | 035a63570519 |
blocking |
Verdict: blocking
The round-1 findings from both reviewers are fixed. One small new gap remains: if the request runs for more than 5 minutes, the non-pingable copy is not dropped. That breaks the new "at most 300 seconds" text in the row. The fix is one line.
Findings
- components/offload/extract_sweep_warm.go:1127 — if the due window ends before the host resolves the request, the non-pingable copy is never dropped
- What fails: a Bob request with
bob-ultrahighsets a warm question due (registerWarm,pendingAt).registerPingkeeps a non-pingable copy. The forward takes more thanwarmPendingMax(5 minutes): a long stream, or several expand rounds. Then the proxy's deferredResolveWarmQuestion(proxy/proxy.go:2045) reachesrunWarmQuestion.!t.warmPending()is true, so it returns at line 1129 and does not calldropUnpingable. Nothing else drops that copy except:- the next request on the same thread (
registerPing→clearSweepPing, extract_sweep_ping.go:95 of the diff), or pruneSweepPingLocked, which runs only when some thread registers, and only after 30 minutes.
If the user stops after that turn, the 2 full conversation copies stay in memory with no time limit. This is the round-1 problem again, only in this edge case.
- the next request on the same thread (
- Proof:
- extract_sweep_warm.go:1126-1130:
if !ok || !t.warmPending() { warmMu.Unlock(); return }. No drop on this path. The other exits (not forwarded, latched, held, goroutine end) all calldropUnpingable. - extract_sweep_warm.go:92:
warmPendingMax = 5 * time.Minute, measured frompendingAt, which is set during the pipeline, before the forward. - The row now says "only while a warm question is due or running (#1191; at most 300 seconds after the request)". David Amid is asked to confirm that text.
- No test covers it: the 4 new subtests resolve the request at once.
- extract_sweep_warm.go:1126-1130:
- Fix: in that early exit, call
dropUnpingable(tkey, sweepPingCand[tkey])too, undersweepPingMu, as the!forwardedbranch does. When no question starts for this request, the copy has no reader. Add a subtest: setwarmPendingMaxto a short value (it is avarfor tests), let it pass, callResolveWarmQuestion(..., true, ...), and expect no entry.
- What fails: a Bob request with
Non-blocking
- New side effect for presets without warm.
registerPingnow callsclearSweepPing(key)whenever a thread is not registered (diff line 95). Before, it only returned. A thread that was pingable on request N and is not on request N+1 now loses its older copy. On the proxy this changes nothing, becauseClearStaleKeepAliveCandidate(proxy/proxy.go:1594) already clears that older copy after every request. It is also the safer direction. I note it only because it touches presets without warm. - A library host that sets
PrefixAskbut never callsResolveWarmQuestion(apply.OptsexposesPrefixAsk) keeps a non-pingable copy with only the old backstop. ThePrefixAskhost contract (components/component.go:748-751) namesResolveDeferredCacheAwareSummarybut notResolveWarmQuestion. Consider adding it there. The proxy is the only host today, and it calls it in a defer on every path. - The
bob-pluginresult is still open. The author's reply says a run on cleanmainis in progress. Post it before merge.
What I checked
- Last review: round 1, b98d64d, 2026-11-17T10:32:44Z
- New commits read: 1 (035a635 fix(sweep): an unpingable copy lives only for its warm question)
- Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Commit 035a635: read the full diff (10 files) and the code around it. See below.
- The author's comment at 2026-11-17T10:40:19Z: I checked each reply.
- Reviewer 2, finding 1 (the ping path read the new copy): fixed.
pingableis set fromCanKeepAlive()at registration.SweepPingSubstitutetreats a non-pingable entry as nil, andHasSweepPingCandidatereturns false for it.ClaimPing(ping_claim.go:116) still reads the map directly. So it can pickPingSweepfor a non-pingable entry, but thenfireSweepSubstitutegets nil fromSweepPingSubstituteand the ping stays plain. A new subtest covers both readers. - Reviewer 2, finding 2, and my finding 1 (the 30-minute bound): fixed for the normal paths. With no question due, no copy is kept and the old one is dropped. The copy is also dropped when the question ends, on each early exit after the due check, and when the request was not forwarded.
dropUnpingabledeletes only its own entry (pointer check), so a newer registration stays. One exit is still open: my new finding 1. - My non-blocking stale comments: fixed in extract_sweep_warm.go (header), extract_sweep.go:80 and :174, component.go (
CanKeepAlive), proxy/keepalive.go (canPing). - My non-blocking point that warm skips every
canPinggate: fixed. It now skips them only for the warm question's own copy, and no ping reads that copy. - Reviewer 2, non-blocking (
bob-plugin): still open, see Non-blocking.
- Reviewer 2, finding 1 (the ping path read the new copy): fixed.
- Order:
registerWarmruns in the body ofOffload(extract_sweep_warm.go:932, extract_sweep_v3.go:767).registerPingis deferred (extract_sweep.go:588). SowarmDuesees this request's trigger, as the author says. - Locks:
warmDuetakeswarmMubeforeregisterPingtakessweepPingMu. The!forwardedbranch releaseswarmMubefore it takessweepPingMu. No nested order, so no deadlock. - The running question uses its own
candwith the slices fromreg, so a drop during the question is safe. - The proxy calls
ResolveWarmQuestioninside the deferred finish ofserve(proxy/proxy.go:2024-2045), so it runs on every return path. - The question's outer limit is
CacheAwareSummarizerCallTimeout(300 s, extract_sweep_warm.go:1249-1252). That matches the row's "300 seconds" once the response is in. - The new tests:
r.key()isthread.Key(session, ""), the same keyResolveWarmQuestion(r.session, "", ...)uses. Each subtest asserts the map state directly. - The rows and the generated page: the page lines match the 2 row files.
- Did not run tests: live tests are not approved and Go is not installed here.
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 | 035a63570519 |
blocking |
Verdict: blocking
Both round-1 findings are fixed for the normal path. One exit of runWarmQuestion still leaves a non-pingable copy behind. In that case the new row text "at most 300 seconds after the request" is not true. The fix is 1 line.
Earlier findings
- Reviewer 2, finding 1 (the ping path read the new copy): fixed.
pingableis set at registration (extract_sweep_ping.go:320).SweepPingSubstitutetreats a non-pingable entry as no candidate (:432-434).HasSweepPingCandidatereturns false for it (ping_claim.go:83). SofireSweepSubstituteandextraReadyLockedbehave as before. The new subtest "question due: the ping path cannot read the copy" covers both functions. - Reviewer 2, finding 2 / reviewer 1, finding 1 (no 30-minute bound on an untracked route): fixed, except for the exit below.
registerPingkeeps a non-pingable copy only whenwarmDueis true, and clears an old one otherwise (:304-309). I checked the order:warmStep→registerWarm(extract_sweep_warm.go:932) runs insideOffload, before the deferredregisterPing(extract_sweep.go:588), sowarmDuesees this request's trigger.dropUnpingableruns on the not-forwarded exit, on both "already asked" exits, and in a defer of the question goroutine. It deletes only its own entry (sweepPingCand[threadKey] == reg), so a newer registration stays. - Reviewer 1, non-blocking (stale comments): fixed. I read the new text in component.go, extract_sweep.go (2 places), extract_sweep_warm.go (header) and proxy/keepalive.go
canPing. - Reviewer 1, non-blocking (
e.warmskips everycanPinggate): this now holds only for the short-lived copy that the warm question reads. The author's reply says the PR text names the kill-switch case andwarm: false. I accept this. - Reviewer 2, non-blocking (
bob-pluginresult): the author saysTestBobReleasePythonSuitefails on the Mac, and this PR changes no Bob or installer file. The run on cleanmainis not posted yet. See Non-blocking.
Findings
- components/offload/extract_sweep_warm.go:1127-1130 — when the trigger expired before the host's hook,
runWarmQuestionreturns withoutdropUnpingable, so the copy is not bounded to 300 seconds- What fails: a Bob thread with
bob-ultrahighfires the warm trigger.registerPingkeeps a non-pingable copy. The response streams for more thanwarmPendingMax(5 minutes; extract_sweep_warm.go:92). The proxy callsResolveWarmQuestiononly after the response ends (proxy/proxy.go:2045). Thent.warmPending()is false, the function returns at the first branch, and nobody drops the copy. If the user stops after that turn, the 2 full conversation copies stay in memory until a registration on another thread runs the 30-minute prune, or for as long as the process runs on an idle proxy. This is the round-1 gap again, on a narrower path. The same happens on a host that setswarm: trueand never callsResolveWarmQuestion(only the proxy calls it). - Proof: in
runWarmQuestion, the branchif !ok || !t.warmPending() { warmMu.Unlock(); return }comes before every newdropUnpingablecall.pruneSweepPingLockedstill has one caller,registerPing, and it removes only entries older than 30 minutes. The row now says "only while a warm question is due or running (#1191; at most 300 seconds after the request)", and the PR asks David Amid to confirm that text. - Fix: drop the non-pingable copy on that branch too (read
sweepPingCand[tkey]and calldropUnpingable, as the!forwardedbranch does). As a second guard, letpruneSweepPingLockedalso drop a non-pingable entry whenwarmDueis false for its key. Add a subtest: shrinkwarmPendingMax, fire the trigger, wait past it, callResolveWarmQuestion(..., true, ...), and expect no entry.
- What fails: a Bob thread with
Non-blocking
- ping_claim.go:116
ClaimPingstill reads_, hasSweep := sweepPingCand[threadKey]withoutpingable. On a pinged thread that has only a non-pingable copy (an OpenAI thread with keep-alive on), it picksPingSweepand notPingNone.fireSweepSubstitutethen declines, and a plain ping goes out, so the result is the same. Butsweep_summary_owned_ping/sweep_summary_in_flightcount wrong, and the claim holds the thread during that ping. Use the samepingablecheck there. - The warm question can run while the next request clears the entry. The author says that is safe because the goroutine holds its own slice references. I agree:
candcopiesreg.inputandreg.rawbefore the goroutine starts. - Post the clean-
mainTestBobReleasePythonSuiteresult before merge, as the author's reply promises.
What I checked
- Last review: round 1, b98d64d, 2026-11-17T10:32:41Z
- New commits read: 1 (035a635 fix(sweep): an unpingable copy lives only for its warm question)
- Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-1 review (10:32:44Z): checked its finding (same as my finding 2) and its 3 non-blocking points. See "Earlier findings".
- The author's reply (10:40:19Z): checked every claim against the code. The order claim (
registerWarmbefore the deferredregisterPing) is true. The "at most 300 seconds" claim is not true on one exit (finding 1). The bob-plugin result is still pending.
- The whole diff of 035a635: component.go, extract_sweep.go, extract_sweep_ping.go, extract_sweep_warm.go, extract_sweep_warm_test.go, ping_claim.go, proxy/keepalive.go, the 2 row files and the generated page (its #1191 text matches the row).
- Code around the change:
Offload(the defer order),warmStep,registerWarm,runWarmQuestionwith all its exits,askWarm,ClaimPing,SweepPingSubstitute,HasSweepPingCandidate,pruneSweepPingLocked, the proxy'sResolveWarmQuestioncall site. - The new test
TestAnUnpingableWarmCopyLivesOnlyForItsQuestion: 4 subtests, each with a specific assertion. No subtest covers the expired-trigger exit. - I did not run Go tests (not approved here).
Round 2 review of #1193. runWarmQuestion now drops the warm question's own copy also on its first exit, when the due window ended during a long forward. ClaimPing ignores that copy too. The flag is now warmOnly, so a registration made without it is an ordinary one. The PrefixAsk host contract names ResolveWarmQuestion. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
|
Round 2 replies. Both reviewers found the same real gap. Fixed test-first in 67cb46f. Both reviewers, finding 1: the due window ends before the host resolves the request. Fixed. Reviewer 2, non-blocking: The flag is renamed Reviewer 1, non-blocking: the host contract. Fixed. Reviewer 1, non-blocking: The Checks on 67cb46f: 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 | 3 of 3 | 67cb46fc5536 |
approve |
Verdict: approve
All earlier findings are fixed. The new commit closes the last exit that left a warm-only copy behind, and ClaimPing now ignores that copy. I found no new defect. The data-dependence change still needs David Amid's confirmation, as the PR banner says.
Earlier findings
- Reviewer 2, round 1, finding 1 (the ping path read the new copy): fixed (round 2). Still true after the rename:
SweepPingSubstitute(extract_sweep_ping.go:433),HasSweepPingCandidate(ping_claim.go:83) and nowClaimPing(ping_claim.go:116-117) all skip awarmOnlyentry. - Reviewer 2, round 1, finding 2 / reviewer 1, round 1, finding 1 (no 30-minute bound): fixed.
- Reviewer 2, round 2, finding 1 / reviewer 1, round 2, finding 1 (the expired-trigger exit kept the copy): fixed. The first exit of
runWarmQuestion(extract_sweep_warm.go:1128-1136) now callsdropWarmOnly. Every exit after awarmOnlyregistration now drops it: no thread or nothing due, not forwarded, no registry entry (nothing to drop), latched, held answer, and the question goroutine's defer. The new subtest "due window ended before the host resolved" setswarmPendingMax = 0after the 3 requests, so the copy was registered while due, and then checks that it is gone. - Reviewer 2, round 2, non-blocking (
ClaimPingread the copy): fixed. The new subtest "a ping claim picks no sweep" expectsPingNone. - Reviewer 1, round 2, non-blocking (host contract): fixed.
components.Ctx.PrefixAsknow namesoffload.ResolveWarmQuestion. - Reviewer 1, round 2, non-blocking (
registerPingclears an older copy with warm off): kept by the author. I accept the reason. On the proxy,ClearStaleKeepAliveCandidate(proxy/proxy.go:1594) already clears that copy after every request, and the change keeps less in memory, not more.
Findings
None.
Non-blocking
- The
bob-pluginresult. The author reports 10 installer failures inTestBobReleasePythonSuiteon cleanmainand 11 on this branch. The PR changes no Bob plugin or installer file, so the difference is likely an unstable test. But please name the 11th test in the reply, and the issue you file, so that someone can check it fails onmaintoo. This should not wait for this PR. - The rename
pingable→warmOnlyis right. The zero value is now an ordinary registration, so the bare&sweepPingCandidate{}entries in the existing ping-claim tests behave as before.
What I checked
- Last review: round 2, 035a635, 2026-11-17T10:43:03Z
- New commits read: 1 (67cb46f fix(sweep): drop the warm-only copy when no question starts)
- Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-2 review (10:42:56Z): its finding is the same as my round-2 finding, and it is fixed. Its 3 non-blocking points: host contract (fixed), the clear with warm off (kept, reason accepted), bob-plugin (see Non-blocking).
- The author's round-2 reply (10:49:29Z): I checked each claim against the code: the first-exit drop, the
ClaimPingchange, the rename and why, the host contract text. The bob-plugin numbers (10 against 11) are in Non-blocking.
- The whole diff of 67cb46f: component.go, extract_sweep_ping.go, extract_sweep_warm.go, extract_sweep_warm_test.go, ping_claim.go.
- Code around the change: every exit of
runWarmQuestion,dropWarmOnly(deletes only its own entry, by pointer),registerPing(setswarmOnly = !canPing),ClaimPing's switch with the newhasSweep. - Locks: the first exit releases
warmMubefore it takessweepPingMu, the same order as the!forwardedexit. No nested lock. - A thread with warm off, or a pingable thread:
warmOnlyis false, so the new drop on the first exit (which runs on every request without a trigger) does nothing for it. - I did not run Go tests (not approved here).
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 | 3 of 3 | 67cb46fc5536 |
approve |
Verdict: approve
All earlier findings from both reviewers are fixed. The new commit adds no defect that I can find. The merge still needs David Amid's confirmation of the data-dependence row, as the PR banner says.
Earlier findings
- Reviewer 1, round 1, finding 1 / reviewer 2, round 1, finding 2 (no 30-minute bound on an untracked route): fixed in 035a635, and completed in 67cb46f.
- Reviewer 2, round 1, finding 1 (the ping path read the new copy): fixed in 035a635. 67cb46f also covers
ClaimPing. - Reviewer 1, round 2, finding 1 / reviewer 2, round 2, finding 1 (the expired-due exit kept the copy): fixed. The first exit of
runWarmQuestion(extract_sweep_warm.go:1127-1136) now reads the entry and callsdropWarmOnly. I checked that this cannot drop a copy that a question still needs:- If a question is due,
warmPending()is true, so this branch does not run. - If a question runs (
t.asking), its goroutine holds its owncandwith the slices, so a drop is safe. dropWarmOnlyreturns at once for an ordinary (pingable) entry, so presets without warm and pingable threads do not change.- The pointer check (
sweepPingCand[threadKey] == reg) keeps a newer registration.
- If a question is due,
- Reviewer 2, round 2, non-blocking (
ClaimPingread the copy): fixed.hasSweepnow ignores awarmOnlyentry (ping_claim.go:116-117). With no summary, the claim isPingNoneand is released at once (ping_claim.go:133-135).fireSubstitutethen tries both substitutes, and both decline, becauseSweepPingSubstitutetreats the entry as nil. A new subtest assertsPingNone. - Reviewer 1, round 2, non-blocking (host contract): fixed.
components.Ctx.PrefixAsknow namesoffload.ResolveWarmQuestion(component.go:751-753). - Reviewer 1, round 2, non-blocking (
clearSweepPingfor presets without warm): the author kept it, with a reason. I accept it: on the proxy,ClearStaleKeepAliveCandidatealready clears that copy, and the change goes in the safe direction. - Reviewer 2, non-blocking (
bob-pluginresult): answered. See Non-blocking.
Findings
None.
Non-blocking
TestBobReleasePythonSuite: 10 failures on cleanmain, 11 on this branch. The author says the extra one is in the same installer group, and this PR changes no Bob plugin or installer file. I agree that no file in this diff touches that suite. Please name the 11th test in the follow-up issue, and say whether it also fails on a second run ofmain. That shows it is flaky and not caused by this PR.- The rename
pingable→warmOnlyis right. The zero value is now an ordinary registration, so the existing tests that build bare&sweepPingCandidate{}entries (2 places) keep their old meaning.
What I checked
- Last review: round 2, 035a635, 2026-11-17T10:42:56Z
- New commits read: 1 (67cb46f fix(sweep): drop the warm-only copy when no question starts)
- Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-2 review (10:43:03Z): its finding 1 is the same as my round-2 finding 1. Its non-blocking
ClaimPingpoint I checked in the code (see above). It is fixed. - The author's round-2 reply (10:49:29Z): I checked each claim against 67cb46f. The fix, the
ClaimPingchange, the rename reason and the host-contract text are all true. Thebob-pluginanswer: see Non-blocking. - Commit 67cb46f: read the full diff (5 files) and the code around it:
runWarmQuestionwith all its exits,dropWarmOnly,registerPing,SweepPingSubstitute,HasSweepPingCandidate,ClaimPingwith its release path.
- Reviewer 2's round-2 review (10:43:03Z): its finding 1 is the same as my round-2 finding 1. Its non-blocking
- The 2 new subtests:
question due: a ping claim picks no sweepassertsPingNone.due window ended before the host resolvedsetswarmPendingMax = 0, which makeswarmPending()false, and restores it int.Cleanup. No test in the file usest.Parallel, so the change to the global is safe. - Locks in the new branch:
warmMuis released beforesweepPingMuis taken, as in the!forwardedbranch. No nested order. - No row or generated-page change in this commit. The round-2 row text ("at most 300 seconds after the request") is now true on every exit of
runWarmQuestionon the proxy, which calls it in a defer on every path. - Did not run tests: live tests are not approved and Go is not installed here.
|
Moved to draft: this PR is now a proposal for @amiddavid.
Assisted-By: Claude (Anthropic AI) [email protected] |
Signed-off-by: Vitaly Zabershinsky <[email protected]>
|
@amiddavid, this PR already does D1 from #1191. The 2 review rounds yesterday added the short lifetime.
I merged main (cd90d55) and updated the PR text. Tests and lint pass. Please confirm that the code matches D1. I mark the PR ready for review now. It does not merge before your yes. Assisted-By: Claude (Anthropic AI) [email protected] |
test(offload): wait on the condition, not on time Drop 3 sleeps that waited for nothing, replace 2 hand-made polls with testutil.WaitFor, and raise one 3 s hang detector to 30 s. Remove 7 tests from the pending timing list. The warm-sweep tests and the modes tests stay, because open PRs #1193 and #35 change their files. Test only. Approvals carried over: the head moved only by a merge of main (SAME CHANGE). Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
|
Behavior change and data-dependence change: approved by the owner. David Amid approved both in a session on 2026-11-26: "I approve the behavior". He also asked for this PR to be taken to merge. Next steps, by the flaky-tests session:
|
Signed-off-by: DAVID AMID <[email protected]>
|
Local tests: waived (owner rule) |
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @amiddavid) | Claude Code 2.1.332 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 4 of 5 | a9b4bc9abc5a |
blocking |
Verdict: blocking
The PR's own code is the same as the approved round-3 head (67cb46f). The 2 merges of main resolved it correctly. But main now has the fix for #1191 blocker 2 (#1196) and the end-to-end Bob test (#1192). This PR is the last fix that test waits for, and the test is still skipped. So nothing proves the change works through the proxy on Bob's route.
Findings
- proxy/bobsweep_test.go:105-109 — the end-to-end Bob sweep test is still skipped, and its skip text is now false
- What fails:
TestBobUltrahighSweepAsksBobOnALongChatis the only test that drives the warm question through the proxy on Bob's route (bob-ultrahigh, the realcanPing,lifecycle.Prepareandlifecycle.Finish). It is skipped with "the sweep cannot ask on Bob's route yet (no copy without a ping; every request cold)". With this PR on currentmain, both reasons are gone: - The unit tests use
warmRig. They do not cover the host wiring: the order ofClearStaleKeepAliveCandidate(lifecycle/prepare.go:157) againstregisterPing, andTouchbeforeResolveWarmQuestioninlifecycle.Finish(lifecycle/finish.go:54-61). I read both orders and I think they are safe: the clear spares an entry written afterstartedAt. But only the end-to-end test proves it. - Proof:
git merge-base --is-ancestor 0aa90706 67cb46fcis false: the test came in with the merge ofmain, after round 3. The PR body still says "This PR alone does not make the sweep act on Bob. Blocker 2 ... still stops the trigger." That was true at round 3. It is not true now. - Fix: remove the
t.Skipand rungo test ./proxy/ -run TestBobUltrahighSweepAsksBobOnALongChat(no-race, as the interim rule says). If it passes, keep it on. If it fails, the failure is a real gap of this PR or of #1191: fix it, or change the skip text to name the true remaining blocker. Update the PR body's Summary to match.
- What fails:
Non-blocking
- PR banner is out of date. It says "Do not merge until @amiddavid says yes" and "Still needed: his yes that the code matches". The comment of 2026-11-26T11:21:41Z records his yes for both the behavior change and the data-dependence change. Update the banner so the integrator does not stop on it.
- components/offload/extract_sweep_warm.go:1099-1108: the doc line "warmPending reports whether a trigger is waiting ..." sits above
warmDue, not abovewarmPending. SowarmDuehas 2 doc lines andwarmPendinghas none. This was already so at 67cb46f. Move the line down.
Earlier findings
- Reviewer 2, round 1, finding 1 (the ping path read the new copy): still fixed.
SweepPingSubstitute(extract_sweep_ping.go:433-435),HasSweepPingCandidate(ping_claim.go:82-83) andClaimPing(ping_claim.go:116-117) all skip awarmOnlyentry. I grepped every reader ofsweepPingCandon the new head: lines 282, 328, 331, 383 (prune), 402 (clear stale), 431, the 3 reads inrunWarmQuestion, and the 2 in ping_claim.go.mainadded no new reader. - Reviewer 2, round 1, finding 2 / reviewer 1, round 1, finding 1 (30-minute bound): still fixed. The proxy now calls
ResolveWarmQuestionfromlifecycle.Finish(lifecycle/finish.go:61), inside the deferred finish ofserve(proxy/proxy.go:1836-1850). So it still runs on every return path, and every exit ofrunWarmQuestiondrops awarmOnlycopy. - Both reviewers, round 2, finding 1 (expired due window): still fixed. The first exit (extract_sweep_warm.go:1150-1156) calls
dropWarmOnly. - Round-2 non-blocking points (
ClaimPing, host contract, clear with warm off, bob-plugin): fixed or accepted in round 3. No change since. - Data-dependence and behavior change: @amiddavid approved both on 2026-11-26 (PR comment). The 2 row files and the generated page match: the
extract_llm_sweepand body-stash lines in docs/data-dependence.md are the same text as the row files.
What I checked
- Last review: round 3, 67cb46f, 2026-11-17T10:52:43Z
- New commits read: 2 on the PR branch (first parent), plus 160 commits of
mainthat they bring in: - Read in full: 6 reviews, 6 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-3 review (10:52:44Z): approve, no findings. Its 2 non-blocking points are the same as mine in round 3.
- Comment by vz-ibm, 2026-11-17T13:24:46Z (moved to draft, a proposal for @amiddavid): superseded by the later comments.
- Comment by vz-ibm, 2026-11-18T08:00:21Z (the code does D1; merged main cd90d55): I checked D1 against the code. The
warmOnlycopy lives only while a question is due or running, and no ping reads it. True. - Comment by amiddavid, 2026-11-26T11:21:41Z (behavior and data change approved; merge main, review, hand off): the merge is done. The approval is recorded. See Non-blocking for the stale banner.
- Comment by amiddavid, 2026-11-26T12:37:15Z (
Local tests: waived (owner rule)): noted. It is the interim rule's hand-off line.
- The full PR diff against the new base e0ad5c5 (10 files). I compared it with the round-3 PR diff: the code lines are the same. Only the context around the test changed, because
mainaddedTestAnUnknownPhaseThreadThatReadTheCacheIsWarmForTheWarmPathandTestAHeldWarmAnswerOnAnUnknownPhaseGoesThroughTheWarmGate. - The merge resolution of extract_sweep_warm_test.go: the old subtest "keep-alive cannot ping the thread" is gone, the 2 #1196 tests are kept, and the new test sits between them. No test of
mainstill asserts that a warm thread the keep-alive cannot ping never asks. I grepped everyCanKeepAlive = func() bool { return false }in the test files (extract_sweep_ping_test.go:568, :849, extract_sweep_v3_test.go:115): all run with warm off, or test the ping path. - Host wiring on the new
main:lifecycle.Prepare(the stale clear, withstartedAttaken beforeApply) andlifecycle.Finish(the order ofTouch,ResolveDeferredCacheAwareSummary,ResolveWarmQuestion). warmPendingMaxis still 5 minutes, and the warm question's outer limit is stillCacheAwareSummarizerCallTimeout()(300 s), so the row text "at most 300 seconds after the request" still holds.- Host boundary and client rules: the PR adds no logic to a host package (only a comment in proxy/keepalive.go) and no client rule.
- I did not run Go tests (live tests are not approved here).
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @amiddavid) | Claude Code 2.1.332 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 4 of 5 | a9b4bc9abc5a |
approve |
Verdict: approve
The 2 merges of main keep the PR's own change the same as the approved round-3 head. The merge resolutions are correct. I found no new defect. The owner's yes for the behavior change and the data-dependence change is now recorded on the PR (2026-11-26).
Findings
None.
Non-blocking
- The banner at the top of the PR body is out of date. It still says "Do not merge until @amiddavid says yes on this PR" and "Still needed: his yes that the code matches". The yes is in the comment of 2026-11-26T11:21:41Z. Update the banner so that the integrator does not stop on it. Use
gh api -X PATCH, becausegh pr editdoes nothing on this repo. - The row's
decided_bydoes not name this change. The other changes in theextract_llm_sweeprow each have an entry, for example "approved by David Amid 2026-11-22 (#1196)". This PR changes what the row keeps in memory, but adds no entry. Consider adding "the warm question's copy on a thread the keep-alive cannot ping: approved 2026-11-26 (#1193)", then rungo run ./cmd/gen-datadep. - components/offload/extract_sweep_warm.go:1099: an orphan doc comment. The line "warmPending reports whether a trigger is waiting…" now sits above
warmDue, sowarmPending(line 1108) has no doc comment andwarmDuehas 2. Move the line down towarmPending. This was already the case at the round-3 head. - "How it was tested" names only the 2026-11-18 run. The new head merges about 160 commits of
main. The waiver line is in the 12:37:15Z comment, whichcheck-ready.shaccepts. Say in the body that no test ran on this head, so that no reader thinks it did.
What I checked
- Last review: round 3, 67cb46f, 2026-11-17T10:52:44Z
- New commits read: 2 on the PR branch (first parent), and 160 commits of
mainthat they bring in: - Read in full: 6 reviews, 6 comments, 0 inline comments (from the three files)
- New items since my last review:
- Comment 2026-11-17T13:24:46Z (PR moved to draft; David owns the sweep): noted. The later comments answer it.
- Comment 2026-11-18T08:00:21Z (the code matches D1 of #1191): I checked each point against the code. All 5 are true:
warmDuegate inregisterPing,dropWarmOnlyon every exit,warmOnlyskipped bySweepPingSubstitute,HasSweepPingCandidateandClaimPing, no change tocanPing, no newCtxhook. - Comment 2026-11-26T11:21:41Z (owner approves the behavior and the data-dependence change): recorded. See the banner point in Non-blocking.
- Comment 2026-11-26T12:37:15Z (
Local tests: waived (owner rule)): accepted under the interim rule.
- How I checked the merges. I compared the PR's own diff at round 3 (
d008870e..67cb46fc) with the PR's diff now (e0ad5c51..a9b4bc9a). The only differences are hunk positions, blob ids, and context lines frommain. The code lines that the PR adds and removes are the same. Two places needed a real resolution, and both are correct:runWarmQuestion:main(#1196) added thelastReadupdate before the first exit. The merge keeps it, and the PR'sdropWarmOnlycall stays afterwarmMu.Unlock(). The lock order is unchanged:warmMuis released beforesweepPingMuis taken.extract_sweep_warm_test.go:TestAWarmThreadTheKeepAliveCannotPingStillAsksnow sits after the #1191 test, andTestAnUnpingableWarmCopyLivesOnlyForItsQuestionandTestAThreadWithNoRegistryCopyNeverAsksAWarmQuestionfollow the #1196 test. Each of the 3 functions is defined once. No test name is duplicated.
- What
mainchanged around the PR:ResolveWarmQuestionmoved from the proxy tolifecycle.Finish(lifecycle/finish.go:61). The proxy callslifecycle.Finishin the deferred finish ofserve(proxy/proxy.go:1850), so it still runs on every return path.apply/opts.go:61documents the call. So every exit that drops a warm-only copy is still reached.- The readers of
sweepPingCandare the same as at round 3: extract_sweep_ping.go (register, prune, clear, clear-stale,SweepPingSubstitute), extract_sweep_warm.go (runWarmQuestion), ping_claim.go (HasSweepPingCandidate,ClaimPing).mainadds no new reader. The keeper's new value rule (#1444) reaches the registry only throughSweepPingSubstitute,HasSweepPingCandidateandClaimPing(keepalive/keeper.go:2593, 2604, 2657; keepalive/substitute.go:465), and all 3 skip awarmOnlyentry. CanKeepAlivehas no new reader incomponents/. The Responses route (apply/responses.go:621) sets it the same way as the Chat route.canPing(proxy/keepalive.go) now returnskeepalive.CanKeepAlive(...). The PR changes only its comment there.
- Data dependence: the
whereandofflines ofextract_llm_sweep.mdand the body-stash text are indocs/data-dependence.mdword for word (checked with a script). Kind stayscontent. - No binary, no
go.modchange, no client rule, no new host logic (the proxy change is a comment). - I did not run Go builds or tests. Live tests are not approved for this review.
Blocker 1 (this PR) and blocker 2 (#1196) of #1191 are both on the branch, so the skip in TestBobUltrahighSweepAsksBobOnALongChat goes. - The chat runs 45 turns. The first check is at turn 30 and finds the grep, so one question goes out. A 64-turn chat sees a second one at turn 60, because the stub's reply is unusable and no answer is held. - Each run uses its own task id. The warm state is process-wide, so -count=N in one process failed on the second run. - TestStatsRendersPerComponentExtractionAttribution now checks cost_source "none" only when the baseline row has none. The Bob test prices a call in the process-wide counter. - Move the warmPending doc line back above warmPending. Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5
|
Fixed in 33c4129. The end-to-end Bob test is on and passes.
|
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @amiddavid) | Claude Code 2.1.332 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 5 of 5 | 33c4129fee36 |
approve |
Verdict: approve
My round-4 finding is fixed. The Bob end-to-end test is on, and the author reports that it passes 5 of 5 runs. The new commit changes no production logic. I found no new defect.
Findings
None.
Non-blocking
- The PR banner is still out of date. It still says "Do not merge until @amiddavid says yes" and "Still needed: his yes that the code matches". The author's reply says the block is "unchanged" on purpose. But the yes is in the comment of 2026-11-26T11:21:41Z. Add one line to the banner that points to that comment, so the integrator does not stop on it. Reviewer 1 raised the same point in round 4.
- proxy/extract_attribution_test.go:112 — the new guard skips the
cost_sourcecheck when the baseline is not "none". It does not check that the value stays the same as the baseline.tail.CostSource == baseTailSourcewould keep a check in both cases. The checks on calls and cost against the baseline (lines 89-99) still guard #176, so this is minor.
Earlier findings
- Reviewer 2, round 4, finding 1 (the Bob end-to-end test is still skipped): fixed in 33c4129.
- The skip and the old 2-blocker text are removed (proxy/bobsweep_test.go:107-109).
- The test now goes through the real
canPing,lifecycle.Prepareandlifecycle.Finishon Bob's route. That covers the host wiring that the unit tests do not. - The PR Summary now says that this PR, with #1196, makes the sweep act on Bob.
- The 45-turn change is explained: at 64 turns a second check at turn 60 asks again, because the stub's 2-byte reply holds no answer. The test still asserts exactly 1 question, the chat's model, Bob's model path and the
Apikeyscheme. 45 turns stay below the next check at turn 60, so the "exactly 1" assertion is sound. - The task id is unique per run (
bobSweepRuns), because the warm state is process-wide. This is correct for-count=N. - I did not run it. Live tests are not approved for this review. I rely on the author's report.
- Reviewer 2, round 4, non-blocking (the orphan
warmPendingdoc line): fixed. The line now sits abovewarmPending(extract_sweep_warm.go:1107). - Reviewer 1, round 4, non-blocking points:
- Banner: not fixed. See Non-blocking.
decided_byentry for this change: not added. The approval is recorded in the PR comment. I leave it to the author.- Doc line: fixed.
- "How it was tested": the author's reply names
go test ./proxy/and./components/offload/on the new head.
- All earlier findings of rounds 1 to 3: still fixed. The new commit does not touch
extract_sweep_ping.go,ping_claim.goor the logic inextract_sweep_warm.go.
What I checked
- Last review: round 4, a9b4bc9, 2026-11-26T12:40:14Z
- New commits read: 1 (33c4129 test(proxy): turn on the Bob end-to-end sweep test)
- Read in full: 8 reviews, 7 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-4 review (2026-11-26T12:42:23Z): approve. I checked its 4 non-blocking points. See "Earlier findings".
- The author's reply (2026-11-26T12:58:46Z): I checked each claim against 33c4129: the skip is removed, the run is 45 turns, there is a task id per run, the attribution test guard is new, the doc line is moved, and the Summary is updated. All are true. The claim that the tests pass is the author's, and I did not run them.
- The full diff of 33c4129 (3 files): extract_sweep_warm.go (comment move only), proxy/bobsweep_test.go, proxy/extract_attribution_test.go. I also read the code around each change: the whole Bob test with its assertions, and the whole attribution test with its baseline reads.
- The PR body, read from the server: the Summary is updated. The banner is unchanged.
- The commit has the DCO sign-off and
Assisted-By. There is no binary and nogo.modchange. - I did not run Go builds or tests. Live tests are not approved for this review.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @amiddavid) | Claude Code 2.1.332 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 5 of 5 | 33c4129fee36 |
approve |
Verdict: approve
The new commit fixes reviewer 2's round-4 finding. The end-to-end Bob test is now on. The test changes that came with it are correct. The sweep code is the same as in round 4, except for one moved doc line. I found no new defect.
Findings
None.
Non-blocking
- The banner at the top of the PR body is still out of date (my round-4 point, and reviewer 2's). It still says "Do not merge until @amiddavid says yes on this PR" and "Still needed: his yes that the code matches". The author's reply says "The behavior-change block is unchanged". The yes is in the comment of 2026-11-26T11:21:41Z. Add one line to the banner that points to that comment, so that the integrator does not stop on it. Use
gh api -X PATCH. - The row's
decided_bystill has no #1193 entry (my round-4 point). The author did not answer it. This is a record, not a defect, and the PR comment holds the yes. Add the entry in this PR, or say in a reply why you leave it out.
Earlier findings
- Reviewer 2, round 4, finding 1 (the end-to-end Bob test is still skipped): fixed. The
t.Skipand its false text are gone (proxy/bobsweep_test.go:106-107). The test drives the realcanPing,lifecycle.Prepareandlifecycle.Finish. The author reports 5 of 5 passes without-race. The PR Summary now says that this PR, together with #1196, makes the sweep act on Bob. - Reviewer 1 and reviewer 2, round 4, non-blocking (orphan
warmPendingdoc line): fixed. The line now sits abovewarmPending(extract_sweep_warm.go:1107), andwarmDuehas only its own line. - Reviewer 1, round 4, non-blocking ("How it was tested" names only the 2026-11-18 run): fixed. The reply gives the run on this head:
go test ./proxy/(no-race) and./components/offload/pass. - All findings of rounds 1 to 3: still fixed. The new commit does not touch
extract_sweep_ping.go,ping_claim.goorrunWarmQuestion.
What I checked
- Last review: round 4, a9b4bc9, 2026-11-26T12:42:23Z
- New commits read: 1
- 33c4129 test(proxy): turn on the Bob end-to-end sweep test
- Read in full: 8 reviews, 7 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-4 review (12:40:14Z, blocking): its finding (the skipped end-to-end test) and 2 non-blocking points (banner, doc line). The finding is fixed. The doc line is fixed. The banner is not fixed (see Non-blocking).
- The author's reply (12:58:46Z): I checked each claim against the commit. The skip is gone. The chat is 45 turns. Each run has its own task id. The attribution test compares with the baseline. The doc line is moved. The Summary is updated. The banner is not changed, as the reply says.
- The diff of 33c4129 (3 files), read in full, with the code around it:
proxy/bobsweep_test.go. The skip and the blocker list are gone. The 45-turn length agrees with the assertions.WaitForStatewaits for at least 1 question. Then the test asserts exactly 1, with the modelpremium-ide, Bob's model path and theApikeyscheme. No request comes after turn 45, so no second question can start. The next check is due at turn 60, so== 1is not a race. The test waits on a condition, not on time, sotimingguardhas nothing to flag.- The per-run task id (
bobSweepRunsatomic counter) is right. The warm state (warmThreads) and the registry are process-wide and keyed by thread, so-count=Nwould reuse the request count of run 1. Withoutt.Parallel, the counter gives each run a fresh thread. proxy/extract_attribution_test.go: thecost_source == "none"check now runs only when the baseline row hasnone. The check is the same as before when this test runs alone. With the Bob test before it,metrics.ExtractSnapshotalready holds a pricedextract_llmcall, so the old check failed for a reason that is not #176. The calls and cost checks still subtract the baseline, so the test still proves its claim.components/offload/extract_sweep_warm.go: only the doc line moves. No code change.
- No row or generated-page change in this commit. No
go.modchange, no binary, no client rule. The host change is test code only. - I did not run Go builds or tests. Live tests are not approved for this review.
|
@vz-ibm this PR is merged, as e2d4177. Thank you.
|
#1463) test(offload): the warm-sweep tests wait on the condition, not on time Three warm-sweep tests used fixed 5 s polls or a tiny real-time bound. They fail on a loaded machine. - The two-asker and shared-read-rule tests wait with testutil.WaitFor. The rig gets one waitIdle helper, which forward also uses. - The outer-timeout test keeps an always-on check that all 3 batches run. Its 3-batches-over-one-bound check is time by design: it is gated with RequireTiming and uses 10x wider margins. - Remove the 3 tests from the pending list and lower the timing baseline. - Add #1193 to the decided_by line of extract_llm_sweep. test(offload): check the warm sweep's outer deadline without waiting The timing subtest of the outer-timeout test slept in the asker and ignored its context, so it did not test the outer bound at all. - The asker now records the time left on its context. - With one question's bound set far above the outer one, the first deadline is the outer deadline. The test checks that it is the keeper's timeout, and that the keeper's timeout is at least 3 questions long. No sleep, no gate. Test only, plus the #1193 approval added to the extract_llm_sweep row's decided_by line (a record, no data-dependence change). No behavior change. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Summary
Blocker 1 of #1191. The sweep's warm question asks after a forwarded request, from the ping registry's conversation copy. That copy was kept only for a thread the keep-alive can ping. IBM Bob's route can never be pinged (an OpenAI provider, and cache strategy
none), so the warm question never asked on Bob. Now, withwarm: true, the copy is kept without a ping.With blocker 2 fixed on main (#1196), this PR makes the sweep act on Bob.
TestBobUltrahighSweepAsksBobOnALongChat(the end-to-end test of #1192, through the proxy on Bob's route) is now on and passes: one sweep question goes to Bob after 45 turns, at the first warm check (turn 30).What changed
components/offload/extract_sweep_ping.go: newkeepsCopy(c):e.warm || CanKeepAlive().registerPinguses it.components/offload/extract_sweep_warm.go:registerWarmuses the same rule.registerPingkeeps a copy only while a warm question is due (warmDue), and marks itwarmOnly.runWarmQuestiondrops it (dropWarmOnly) when the question ends, when no question starts, or when the request was not forwarded.components/offload/ping_claim.go,HasSweepPingCandidate: awarmOnlycopy is not a ping's. The keep-alive, the ping substitute and the fix(keepalive): ping 2 re-writes the whole prefix after a ping 1 that wrote 6 tokens #776 extra request never see it.components/component.go: thePrefixAskhost contract now namesResolveWarmQuestion.Ctxhook. bob-ultrahigh: 3 blockers stop the sweep on Bob (no copy without a ping, every request cold, 30-turn defaults) #1191 proposed one (CanWarmAsk). The rule fits inside the sweep, becausewarmis the sweep's own setting, so a hook would add an interface with one caller.extract_llm_sweepand body-stash data-dependence rows, rebuilt withmake datadep. The row also said "warm: true... in no preset"; that was out of date since feat(bob-plugin): add the bob-ultrahigh preset (replaces lossless-defer) #973.Tests
TestAWarmThreadTheKeepAliveCannotPingStillAsks, with 2 cases: the keep-alive hook says no, and there is no hook at all. Each expects 1 question and nonot_registered. Red before the fix: "asked 0 times, want 1", in both cases.TestAnUnpingableWarmCopyLivesOnlyForItsQuestion, with 6 cases:warmCtx). They still pass, so a pingable copy keeps its 30-minute life.TestAThreadTheKeepAliveCannotPingNeverAsksAWarmQuestionasserted the old behavior (a warm thread that cannot be pinged never asks). It is replaced by the new test above. The other 2 subtests (no registry copy means no question; the warm path keeps no copy of its own) stay, in a test renamedTestAThreadWithNoRegistryCopyNeverAsksAWarmQuestion.TestWithKeepAliveOffNothingIsRegisteredandTestNoAskerOrObserveModeRegistersNothingrun withwarmoff. They still pass, so presets without warm keep no copy.How it was tested
go test ./components/offload/ok.go test ./components/all/ok (the data-dependence row check).make lintclean.go test ./...on macOS: every package passes exceptcontext-guru-pluginandbob-plugin.context-guru-plugintests also fail on cleanmain(d008870) on this Mac:/private/varagainst/varpaths, and golden-file differences. They are not related to this PR.bob-pluginhit Go's 10-minute limit when the whole suite ran at once.go test ./components/... ./proxy/... ./apply/... ./config/...ok.make lintclean. Not run again:context-guru-pluginandbob-plugin(this PR does not touch them).Assisted-By: Claude (Anthropic AI) [email protected]