Repository navigation
fix(keepalive): choose the keep-alive prefix floor by wait cause - #1040
Conversation
#867 lowered the default keepalive_min_prefix_tokens to 20000. The strategy table still wrote 80000 for auto, 1-ping and 2-ping. An explicit value beats the default, so every user on those strategies kept the 80k floor. - config/strategy.go: the three entries use DefaultKeepAliveMinPrefix. - settings.py and pi_plugin.py: 80000 becomes 20000. Desc text follows. - Test: every strategy floor equals the default. - Test: `strategy sync` rewrites an old 80000 file to 20000. - Docs: two stale 80k statements fixed. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
amiddavid
left a comment
There was a problem hiding this comment.
| 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 | 6a9f29a7c453 |
blocking |
Verdict: blocking
Findings
-
pi-package/scripts/pi_plugin.py:335 — the fix never reaches an existing Pi install, and the PR says it does
- What fails: a Pi user who armed
auto,1-pingor2-pingbefore this change has
keepalive_min_prefix_tokens: 80000written literally in their config file. Nothing on the Pi
side ever re-renders that file, so the floor stays 80000 indefinitely. The PR description says
"Existing user files need no migration.strategy syncruns before every proxy start. An old
file with 80000 becomes 20000 at the next start" — that is true for the Claude Code plugin
only (start-proxy.sh:570runsstrategy sync), and false for Pi. - Proof:
render_config(pi_plugin.py:320-332) writes the strategy's keys literally, with no
strategy:name in the file, so the proxy cannot re-derive the row either.
write_proxy_config(pi_plugin.py:335) is called only fromsetup(line 665, needs explicit
consent) andconfigure(line 795, a user slash-command).update(lines 822-857) swaps the
binary and restarts the service without touching the config;restartreuses the file as-is.
There is no Pi equivalent ofstrategy sync. - Fix: re-render the owned config on
update/restartthe waystart-proxy.shsyncs, or state
in the PR and inpi-package/README.mdthat a Pi user must re-run setup orconfigureto get
the 20k floor. Do not leave the "no migration" claim as written.
- What fails: a Pi user who armed
-
config/strategy.go:28 — the table's rule comment now contradicts the code it sits on
- What fails: lines 28-31 say "The numbers are written out here, not read from the Default*
constants, on purpose: a later change to a default must not silently re-tune a strategy that an
install already uses." This change does the exact opposite forkeepalive_min_prefix_tokens
(lines 79, 94, 109 now readDefaultKeepAliveMinPrefix). A reader who trusts the comment will
either "fix" the constant back to a literal, or miss that a future change to the default now
re-tunes every strategy — which is the approved intent here, and must be stated as the new rule. - Proof: config/strategy.go:28-31 against config/strategy.go:79.
- Fix: rewrite the comment: the prefix floor tracks
DefaultKeepAliveMinPrefixby owner decision
(this PR, approved 2026-11-10); the other numbers stay literal so a default change cannot
re-tune them.
- What fails: lines 28-31 say "The numbers are written out here, not read from the Default*
Non-blocking
- proxy/campaign.go:41-47 — pre-existing drift, same class this PR fixes. The comment says
campaignDefaultMinPrefixTokens"mirrors config.DefaultKeepAliveMinPrefix", but the constant is
80000 and the default has been 20000 since #867. It is outside this diff and the campaign arms
have their own pinned tests, so per the repo rules it deserves its own issue, not a ride on this PR. - context-guru-plugin/preset_default_test.go:834 — the assertion rejects the substring "80000"
anywhere in the synced file. Correct today (no other rendered value contains it), but a future key
could trip it for an unrelated reason.
What I checked
- The full diff (7 files) and the code around each change.
applyStrategy(config/strategy.go:165): a key the file sets itself always wins. So the PR's
turn-off instruction (keepalive_min_prefix_tokens: 80000in the config) is correct, and a
hand-tuned file is not overridden.TestStrategyTableMatchesPluginstill pins the Go table tosettings.pykey by key; both tables
were changed together, so they stay pinned.- The sync path:
strategy sync(settings.py:3973-4035) re-renders the whole file from the table,
andstart-proxy.sh:570runs it before every proxy start. The new
TestStrategySyncLowersAnOldPrefixFloorcovers the 80000→20000 rewrite end to end. - Every remaining
80000in the tree: the campaign arms (proxy/campaign.go, proxy/campaign_test.go)
are measured A/B arms with the 80k evidence floor, deliberately unchanged; RELEASING.md and the
dash tests already say 20000. DefaultKeepAliveMinPrefix = 20000since #867 (issue #858), config/config.go:263-265. The #858
and #867 citations in the new comments and docs are the issue and the PR, both correct.- The behavior change is named at the top of the PR (who, old, new, turn-off) with owner approval on
2026-11-10 — this meets the repo's behavior-change rule. - Data dependence: token counts only, metadata first; no row in docs/data-dependence.md changes.
Agree. - No live tests were run (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 (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 | 6a9f29a7c453 |
blocking |
Verdict: blocking
Findings
-
pi-package/scripts/pi_plugin.py:335 — an existing Pi install never gets the 20k floor
- What fails: a Pi user who armed
auto,1-pingor2-pingbefore this change keeps
keepalive_min_prefix_tokens: 80000in their config file. The file is re-rendered only by
setupandconfigure(write_proxy_config, line 335 and line 795). The session-start path
runspi_plugin.py restart, andrestart_servicenever touches the config.update
re-installs the binary and restarts with the old file. So the lower floor reaches that user
only when they runconfigureagain. The PR body says the opposite: "Existing user files need
no migration.strategy syncruns before every proxy start. An old file with 80000 becomes
20000 at the next start." That is true for the Claude Code plugin (start-proxy.sh:570) but
not for Pi. - Proof:
render_configwrites the cache keys literally (pi_plugin.py:320-332). The extension
runs onlystatusandrestartat session start (pi-package/extensions/context-guru.ts:136).
restart_serviceandupdatecall no config write. Nosyncop exists in the Pi package
(main's parser list: setup, status, configure, update, restart, uninstall). - Fix: add a re-render before the service start in the Pi package (the same rule as
start-proxy.sh), or correct the PR body: Pi files keep 80000 until the nextconfigure,
and the owner accepts that gap.
- What fails: a Pi user who armed
-
config/strategy.go:28 — the table's rule comment now contradicts the code
- What fails: the comment says "The numbers are written out here, not read from the Default*
constants, on purpose: a later change to a default must not silently re-tune a strategy that
an install already uses." This PR does the opposite for the floor: all three entries now read
DefaultKeepAliveMinPrefix(lines 79, 94, 109), and the newTestStrategiesUseTheDefaultMinPrefix
enforces that coupling. The file states two opposite rules. A future reader who trusts the
comment will "fix" the code back, or follow the dead rule for the other keys. - Proof:
git diff d407191b..HEAD -- config/strategy.gochanges the three values; the comment
block at lines 28-31 is untouched. - Fix: rewrite the sentence. Say the floor follows
DefaultKeepAliveMinPrefixsince this change
(completing #867), and the other numbers stay literal.
- What fails: the comment says "The numbers are written out here, not read from the Default*
-
proxy/campaign.go:47 — the campaign mirror of the default is stale at 80000
- What fails:
campaignDefaultMinPrefixTokens = 80000, and its comment (line 41) says it
"mirrors config.DefaultKeepAliveMinPrefix". That default has been 20000 since #867. So the
comment is false, and the live campaign armskeepalive-5mandkeepalive-5m-xK(K >= 2)
still arm an 80k floor:campaignArmFor(lines 137, 165) passes it into the strategy rows the
campaign writes (line 492). This PR fixes exactly this drift class in the strategy table but
leaves the campaign mirror broken. - Proof:
config/config.go:265—DefaultKeepAliveMinPrefix = 20000("since #858", landed with
the #867 series).proxy/campaign.go:41-47unchanged by this PR and by #867. - Fix: per the repo rule, this defect in
maingets its own issue and its own PR, not a change
on this branch. The issue needs an owner decision: either the campaign arms follow the 20k
default, or the value is kept for the K>=2 evidence (lines 49-52) and the comment drops the
"mirrors" claim.
- What fails:
Non-blocking
components/offload/extract_sweep_ping.go:31— the comment still says "a prompt under the
keep-alive floor (80k tokens, #444) gets none". The matching sentence in
docs/components/advanced-offload.mdwas updated to 20k in this PR. Update the comment too.kvcache/strategy.go:506— the comment says "the shipped config default is now 240 s / 80k
floor". Stale since #867. Pre-existing, not touched by this PR.config/strategy_test.go:87hardcodes 20000 where the new test uses the constant. Fine as a
pin; noted only so the duplication is known.
What I checked
- The full diff (7 files) and the code around each change.
- The value chain:
config/strategy.gorows →CacheConfigfill (explicit key beats the row,
row beats the default) →Resolved()atconfig/config.go:312. - The three-table drift chain stays closed: Go table ↔
settings.py
(TestStrategyTableMatchesPlugin, desc strings compared exactly — both sides now say
">=20k-token prefix") ↔pi_plugin.py(test_strategies_match_the_claude_code_plugin). - The new tests:
TestStrategiesUseTheDefaultMinPrefix(compares against the constant, requires
the floor in at least 3 rows) andTestStrategySyncLowersAnOldPrefixFloor(the sync path at
settings.py:3973-4035re-renders from the table; helperssettingsInandreadFileString
exist; the armedautofile carries exactly one floor line, so the replace and the
no-80000 assertion are sound). - The Claude Code upgrade story:
start-proxy.sh:570runsstrategy syncbefore every launch. - Every other copy of the old floor:
proxy/campaign.go(finding 3), two stale comments
(non-blocking), and historical analysis docs (scripts/analysis/README.md,
predictive/README.md) that record past measurements and are correctly untouched. - The PR body: it names the behavior change at the top, gives the old and new behavior, the
turn-off switch, and the owner's approval date (2026-11-03 / 2026-11-10). - No tests were run. Live tests are not approved, and Go is not on this machine.
The owner chose a floor by wait cause. A tool wait (main or subagent) gets 20k. A subagent thread gets 20k for every wait. A main thread that waits for a person, background work, a teammate or an unknown cause gets 80k. - keepalive_min_prefix_tokens default is 80000 again (general floor). - New keepalive_tool_wait_min_prefix_tokens, default 20000. - Policy.WaitMinPrefix picks the floor. pingable() reads it. - Dashboard replay and the adapt replay use the same floors. - Strategy table keeps the literal 80000. A test pins it to the default. The table does not write the new key, so old files get the 20k tool-wait floor without a re-render. - Pi re-renders the config it owns at restart and update. - With keepalive_wait_plan: false, one floor applies. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
|
Reply to Reviewer 1, round 1. Head is now
|
|
Reply to Reviewer 2, round 1. Head is now
|
The owner moved the Pi re-render to its own issue (#1044). The Pi strategy table is unchanged by this PR. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
|
The Pi config re-render moved to #1044. This PR no longer has it (removed in Finding 1 no longer applies to this change. The Pi table needs no new value: an old Pi file keeps 80000 as the general floor, and tool waits get 20000 from the proxy default. |
amiddavid
left a comment
There was a problem hiding this comment.
| 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 | c0a99f8ce8b2 |
blocking |
Verdict: blocking
Findings
-
dash/ui/app.js:9664 — the keep-alive tab still tells the reader the gate is 20k; this change makes it 80k for a main thread's other waits
- What fails: the calculator's PINGS note says pings are "gated as the request path gates (past
the session's first request, cached prompt over 20k tokens)". After this change the request path
gates a main thread's wait for a person, background work, a teammate or an unknown cause at
80k. Only a tool wait or a subagent keeps 20k. The same stale 20k claim sits at app.js:9474
("the default 'only sessions with a large cached prompt' filter costs almost nothing" —
measured at a 20k gate, no longer the shipped general floor) and app.js:9722. Two comments in
dash/keepalive.go also state it: line 591 ("the shipped floor is 20k since #858") and line 611
("is the shipped floor again since #858"). The base's gate comment kept the page self-consistent
on purpose ("the panel's copy names 20k so the page stays self-consistent"); this PR rewrote
that comment and dropped the panel-copy clause without updating the panel. - Proof:
WaitMinPrefix(keepalive/waitplan.go:86-94) returnsMinPrefixTokens(default 80000,
config/config.go:272) for every non-tool wait of a main thread;pingablereads it
(keepalive/keeper.go:329). The three copy spots and the two comments are unchanged by the diff. - Fix: name both floors in the three copy spots and the two comments: "over 20k for a tool wait
or a subagent, 80k otherwise".
- What fails: the calculator's PINGS note says pings are "gated as the request path gates (past
-
RELEASING.md:225 — the release traps list states the wrong default floor
- What fails: "The default floor is
keepalive_min_prefix_tokens: 20000(it was 80000 before
#858)". After this change the general default is 80000 again; 20000 is the tool-wait and
subagent floor. A release checker who follows this list configures the wrong expectation, and
check item 10 (line 220) tells them to verify the per-wait plan. - Proof: config/config.go:272 —
DefaultKeepAliveMinPrefix = 80000; the PR updated
docs/how-to/cache-keepalive.md, pi-package/README.md and two code comments, but not this file. - Fix: one line: the general floor is 80000, 20000 for a tool wait or a subagent
(keepalive_tool_wait_min_prefix_tokens).
- What fails: "The default floor is
Earlier findings
- Mine, round 1, finding 1 (Pi never re-renders): resolved, accepted. The redesign makes an old
Pi file correct: it states 80000, which is now the right general floor, and the tool-wait floor
(20000) reaches it from the proxy default with no re-render. The re-render itself moved to #1044,
and the PR body now separates the two plugins honestly ("Existing user files" section). Verified:
the diff against the base touches onlypi-package/README.md; the Pi strategy table is byte-equal
to base and its 80000 matchessettings.pyand the Go table. - Mine, round 1, finding 2 (strategy.go rule comment): fixed. The table keeps literals, as its
comment says. The comment now also states the two new rules: a test pins the table floor to
DefaultKeepAliveMinPrefix, and the table does not write the tool-wait key.
TestStrategiesPinTheGeneralFloorToTheDefaultenforces both. - Reviewer 1, round 1, findings 1 and 2: agree, and both are resolved the same way (checked
myself above). - Reviewer 1, round 1, finding 3 (campaign mirror stale at 80000): moot, and I add new proof.
This PR movesDefaultKeepAliveMinPrefixback to 80000, socampaignDefaultMinPrefixTokens = 80000(proxy/campaign.go:47) mirrors the default again and the comment is true. The author's
reply (own issue, not this branch) also matches the repo rule; nothing is left to do. - Non-blocking round 1: the stale 80k comments in
extract_sweep_ping.goand
kvcache/strategy.goare fixed (in the diff). The brittle no-"80000"-substring sync test is gone
with the redesign; the newTestStrategyFileHasNoToolWaitFloorchecks the key lines themselves.
Non-blocking
- Keeper and replay disagree on the floor at Idle >= 300 s. The keeper sets the wait cause
whenever the plan is on, with no Idle condition (keepalive/keeper.go:914-918), so a tool wait at
Idle >= 300 s still gets the 20k floor inpingable. The calculator forcesWaitPlanoff at
idleSeconds >= 300 (dash/keepalive.go:1664-1666), so its replay gates every span at the general
floor. The docs say idle must be under 300 s, and the replay under-counts, so I leave this here. SpanPrefixOKgives a subagent row with no stored cause the general floor (cause "" returns
MinPrefixTokens, keepalive/waitplan.go:87-88), though a live keeper always classifies a cause
and would use 20k. Old rows only, and the replay under-counts. Worth a line in the
storedWait/SpanPrefixOKcomment if the author keeps it.
What I checked
- Last review: round 1, 6a9f29a, 2026-11-10T12:24:37Z.
- New commits read: 6 in
git log 6a9f29a7..HEAD. The PR's own:ee1e01dc(floor by wait cause)
andc0a99f8c(drop the Pi re-render, moved to #1044) — both read in full, plus the merge
54a7eaa9. From main through the merge:407d9d1a(#483),54a51b57(#720),b57b2bda
(#1046, the new base) — main's own merged PRs, outside this PR's diff; I read their messages and
stats, not their thousands of lines, and the review diffb57b2bda..HEADexcludes them. - Read in full: 2 reviews, 3 comments, 0 inline comments (files
.review-in-reviews.txt,
.review-in-comments.txt,.review-in-inline.txt). - New items since my last review: the two PR commits (reviewed above), the merge of main, and the
author's three comments (two replies at 14:13, one note at 14:14). Each reply claim was checked
against the code: Pi re-render removed (diff vs base touches only the Pi README), PR body
corrected (read in full), strategy.go comment fixed (read), stale comments fixed (read). - The new rule end to end:
CacheConfigkey and default →Resolved()→cachePolicy
(cmd/context-guru-proxy/main.go:1214, usesc.Resolved()) →Policy.WaitMinPrefix→
pingable.WaitMinPrefixnever raises the general floor (min), returns one floor with the
plan off or an unknown cause, and gives every subagent wait the tool-wait floor. - The replay side:
gatePolicyfills zero floors with the shipped ones;pingSpansWithFactsgates
SQL atLowestMinPrefixand each span atSpanPrefixOK; the SELECT/Scan column order matches;
DefaultWaitPolicycarries both floors;DashWaitPolicy(proxy/keepalive.go:602) now threads
both floors from the tenant config. The golden fixture pins its account floor at 20k, so the
golden files stay valid. - The other floor readers: the session override sets
WaitPlan = false, so one floor applies
(proxy/keepaliveoverride.go:189); the predictive campaign zeroes the floor as before
(predictive.go:455, unchanged behavior);adaptcache.gomaps a tool stop to a tool wait and
flags subagent rows (rowFactshas one producer, campaignauto.go:137, which sets it). - The strategy tables: Go,
settings.pyandpi_plugin.pyagree at 80000; the drift tests
(TestStrategyTableMatchesPlugin, pi'stest_strategies_match_the_claude_code_plugin) compare
values and the auto desc, both consistent; no table writes the new key. - The behavior change is named at the top of the PR body: who, old, new, the owner's choice of
2026-11-10, and two turn-off switches. The extension to background/teammate/unknown causes is
flagged as the author's reading of the owner's two rules. Data dependence: metadata only (stop
reason, tool names, thread shape, token counts). Agree. - Remaining docs that name the floor:
kv-cache-keepalive-budget.mdand
test-subscription-sandbox.mdshow example values, not defaults — fine. The two wrong spots are
the findings above. - No tests were run. Live tests are not approved, and Go is not on this machine.
amiddavid
left a comment
There was a problem hiding this comment.
| 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 | c0a99f8ce8b2 |
blocking |
Verdict: blocking
Findings
-
proxy/adaptcache.go:157-161 — the adapt replay gives OpenAI rows the 20k tool-wait floor; the keeper and the dash replay do not
- What fails: an OpenAI row whose stop reason is
tool_callsorfunction_call(both in
keepalive.ToolStopReasons) reads as a tool wait, and any OpenAI subagent row reads as a
subagent wait. So the adapt report gates those rows at 20k. The request path does not: the
keeper reads no wait cause for an OpenAI thread (keepalive/keeper.go:914,
guard := ... && provider != bschemas.OpenAI), soe.waitstays""and
WaitMinPrefixreturns the general floor. The dash replay agrees with the keeper
(Policy.SpanPrefixOK:s.OpenAI→ general floor). For OpenAI traffic with a 20k-80k
prefix, the adapt report counts pings the policy never sends. - Proof:
ToolStopReasons = {"tool_use", "tool_calls", "function_call"}(waitplan.go:148);
tool_calls/function_callare OpenAI stop reasons.kvcache.Requesthas aProvider
field (kvcache.go:226), andautoRowsXbuildsrowFactsfrom those requests without a
provider filter, butrowFactsdoes not carry the provider, so the gate cannot see it. - Fix: copy the provider into
rowFactsand apply the general floor on OpenAI rows, the same
rule asSpanPrefixOK. The PR body says "Adapt replay uses the same floors" — today it does
not, for OpenAI.
- What fails: an OpenAI row whose stop reason is
-
RELEASING.md:225 — the release-check trap states a default this PR removes
- What fails: the Part B trap says "The default floor is
keepalive_min_prefix_tokens: 20000
(it was 80000 before #858), so a small session needs a lower value in its own config." After
this PR the default ofkeepalive_min_prefix_tokensis 80000 again, and 20000 is the default
of a different key. The sentence sends the release checker wrong: a small session on a tool
wait now gets pings at the 20k default, with no config change. - Proof:
config.DefaultKeepAliveMinPrefix = 80000andDefaultKeepAliveToolWaitMinPrefix = 20000(config/config.go, this PR). RELEASING.md is not in the diff. - Fix: rewrite the line to the two floors and their keys.
- What fails: the Part B trap says "The default floor is
-
dash/keepalive.go:591 and 611 — comments still say the shipped floor is 20k
- What fails: line 591 says "the shipped floor is 20k since #858" and line 611 says 20,000 "is
the shipped floor again since #858 (80,000 in between)". Both are false after this PR: the
shipped general floor is 80000 and 20k is the tool-wait floor. The same package now defines
kaGateMinPrefix = 80000(line 1299) and a pinning test asserts it, so the package states
two opposite facts about the same policy. - Proof: the diff touches dash/keepalive.go around lines 1290-1400 but not 591/611; I read the
current text of both lines. - Fix: reword both to the two-floor rule, as the gate comment at line 1293 already does.
- What fails: line 591 says "the shipped floor is 20k since #858" and line 611 says 20,000 "is
Non-blocking
docs/how-to/kv-cache-keepalive-budget.md:33— the example sets
keepalive_min_prefix_tokens: 20000. That now lowers the general floor, which re-enables 20k
pings for a main thread's wait for a person — the case the owner's 80k rule refuses (the PR
body: under 50k, 0 of 274 came back). Drop the line or use the new key.proxy/adaptcache.go:157— a main-thread ask-a-person tool stop reads as a tool wait (20k)
where the keeper reads a person (80k). A kvcache row has no tool names and no stored cause, so
the replay cannot do better. The comment could state the exception, as dash'sstoredWaitdoes.
Earlier findings
Mine, round 1:
- Pi never re-renders the config — fixed by scope change, accepted. The owner moved the
re-render to issue #1044 (open, I checked). This PR has no Pi re-render code (removed in
c0a99f8c). Under the new design an old Pi file needs no re-render for this change: it keeps
80000 as the general floor and gets the 20k tool-wait floor from the proxy default, because
the file does not state the new key. The PR body now says this for both plugins. strategy.go:28comment contradicted the code — fixed. The table writes literals again
(80000), the comment states the pinning rule, andTestStrategiesPinTheGeneralFloorToTheDefault
fails when the table and the default drift. The table does not write the new key, and a test
guards that too.campaign.go:47stale mirror — resolved by the redesign.DefaultKeepAliveMinPrefixis
80000 again, socampaignDefaultMinPrefixTokens = 80000matches the default it claims to
mirror. The author also says the main session tracks it in its own issue.
Reviewer 2, round 1 (read in full this round; it was posted before my round-1 review):
- Finding 1 (Pi) and finding 2 (strategy.go comment) are the same as mine — both addressed as
above. I checked both myself. - Non-blocking (campaign drift, the
80000substring assertion): the campaign point is tracked;
the substring assertion is gone — the newTestStrategyFileHasNoToolWaitFloorchecks the key
lines themselves.
What I checked
- Last review: round 1, 6a9f29a, 2026-11-10T12:25:54Z.
- New commits read: 3 —
54a7eaa9(merge of origin/main: #1046, #720, #483),ee1e01dc
(fix(keepalive): choose the prefix floor by wait cause),c0a99f8c(revert(pi): drop the Pi
config re-render). - Read in full: 2 reviews, 3 comments, 0 inline comments (from the three files;
.review-in-inline.txtis empty). - New items since my last review: the 3 commits above, the rewritten PR body, and 3 issue
comments by the author (two replies to the round-1 reviews, one note on the Pi revert). I
checked each reply against the code, and verified issue #1044 exists and is open. - The full net diff
b57b2bda..c0a99f8c(27 files) and the code around each change. The merge
brings main's own reviewed PRs; the net diff against the new base isolates this PR's change. - The new floor rule end to end:
Policy.WaitMinPrefix(min of the two floors, plan-off and
unknown-cause fall back to the general floor),pingable()(keeper.go:329), the keeper's wait
assignment (keeper.go:914-921: no wait cause for OpenAI or 1-hour counts),ForOneHour
(floor still applies on the 1h tier, and dash'sSpanPrefixOKagrees — no drift there). - The dash replay:
gatePolicy,LowestMinPrefixin SQL thenSpanPrefixOKper span,
scanFactssetsSubagentfrom the thread id, the SELECT/Scan column order matches, and the
golden fixture pins its floor at 20k so the golden files stay unchanged. - The policy plumbing:
cachePolicyin cmd/main.go carriesToolWaitMinPrefixon both return
paths;proxy.CachePolicyis an alias ofkeepalive.Policy, so manager strategies
(applyStrategyWindows) and overrides keep the account's plan fields;DashWaitPolicypasses
both floors. - The strategy chain: the table writes 80000 and no tool-wait key;
settings.pymatches (desc
strings equal on both sides);pi_plugin.pyis byte-identical to base again; the round-1
sync-lowers test is gone and the new file test matches the new design. - Docs and comments for stale floor claims:
cache-keepalive.mdand the two stale comments are
fixed; RELEASING.md, the two dash comments, and the budget-doc example are not (findings 2 and
3, non-blocking). - The PR body names the behavior change at the top (who, old, new, effect, turn-off, owner
approval 2026-11-10) and states the data dependence (metadata only). No row in
docs/data-dependence.md changes. - No tests were run. Live tests are not approved, and Go is not on this machine.
- The adapt replay gives an OpenAI row the general floor only, as the keeper does. rowFacts carries the provider. New test and mutation. - RELEASING.md, dash comments, panel copy and the budget how-to state the two floors. - Comments name the known gaps: tool stops that ask a person, old rows with no cause, and the calculator at idle 300 s or more. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
|
Reply to Reviewer 1, round 2. Head is now
|
|
Reply to Reviewer 2, round 2. Head is now
|
The owner decided: a main thread that waits for background work or a teammate uses the 20k floor, like a tool wait. Only a main thread that waits for a person, or for an unknown cause, keeps the 80k floor. Subagents keep 20k for every cause. OpenAI keeps the general floor. - Policy.WaitMinPrefix and its tests (keeper gate and dashboard replay). - Adapt replay: a row has only a stop reason, so a non-tool stop reads as a person (80k). The comment says the replay under-counts. - Docs, Desc texts, panel copy and RELEASING.md state the new rule. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
amiddavid
left a comment
There was a problem hiding this comment.
| 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 | 3 of 3 | d01128ed3ded |
blocking |
Verdict: blocking
Findings
- pi-package/README.md:121 — the floor sentence was updated for the round-2 rule and missed by the round-3 rule
- What fails: the README says the proxy "pings only a session with a prefix of 80,000 tokens or
more (20,000 while a tool runs, and on a subagent)". Commitd01128edmoved a main thread's
waits for background work and for a teammate to the 20k floor, so the sentence now names only
two of the four 20k causes. A Pi user whose main thread waits for background work at a 30k
prefix is told the proxy never pings it, and it does — on the user's own credential. Every
other copy states the new rule: the config comments, the strategy Desc (Go and
settings.py),docs/how-to/cache-keepalive.md,RELEASING.md, and the three dash panel
texts. This file was updated for the earlier rule inee1e01dcand not re-read byd01128ed
(no pi-package file is in its diff). - Proof:
pi-package/README.md:121(read afterd01128ed);WaitMinPrefix
(keepalive/waitplan.go:86-96) gives 20k to own_tool, background, teammate and every subagent
wait;d01128ed's file list has no pi-package entry. - Fix: one clause: "(20,000 while a tool runs, for background work or a teammate, and on a
subagent)".
- What fails: the README says the proxy "pings only a session with a prefix of 80,000 tokens or
Non-blocking
- Several copies say "20k except for a main thread that waits for a person" and omit the unknown
cause, which also keeps 80k:dash/keepalive.go:612,dash/ui/app.js:9664and:9722,
docs/components/advanced-offload.md:203,kvcache/strategy.go:506. The unknown cause is the
rare classifier fallback, so this is precision only. proxy/adaptcache.go:171-176— therowFloorcomment says an ask-a-person tool stop "reads as
a tool wait here, as dash's storedWait reads it". Dash'sstoredWaitkeeps a tool stop with a
stored human cause as human; only a row with no stored cause reads as a tool wait. The adapt
behavior is right and the PR body states it; the comparison with dash is imprecise.- The PR body's "How it was tested" list still names the round-2 test set and omits
TestRowFloorFollowsTheWaitAndTheProvider(the reply comment does name it, with mutation).
Earlier findings
Mine, round 2:
- Adapt replay gave OpenAI rows the 20k floor — fixed.
rowFactscarriesopenai
(r.Provider == "openai", campaignauto.go:141),rowFloorreturns the general floor for an
OpenAI row, andTestRowFloorFollowsTheWaitAndTheProvidercovers the main tool stop, end_turn,
subagent, OpenAI tool stop and OpenAI subagent cases. I checked each againstWaitMinPrefix. - RELEASING.md:225 — fixed. The trap line now states both floors and both keys, including
which waits use which. - dash/keepalive.go:591 and 611 — fixed. Both comments state the two-floor rule; the
prefix-edges comment names both edges.
- Non-blocking then: the budget-doc example now shows both keys with the default values; the
ask-a-person exception is stated in therowFloorcomment.
Reviewer 2, round 2 (read in full; posted just before my round-2 review):
- Finding 1 (dash panel copy still said 20k) — fixed. I read all three spots (
app.js:9474,
:9664,:9722); they now state both floors. - Finding 2 (RELEASING.md) — same as my round-2 finding 2, fixed as above.
- Non-blocking (keeper keeps the per-cause floor at Idle >= 300 s while the calculator turns the
plan off;SpanPrefixOKgives an old no-cause subagent row the general floor) — the author
documented both as known gaps in comments (dash/keepalive.go:1665-1668, waitplan.go:106-109)
rather than fixing, and said the calculator fix "is not one line". I accept: both gaps
under-count, the safe direction, the calculator's idle band is outside the config's allowed
range (under 300 s), and old rows are the only case for the second.
What I checked
- Last review: round 2, c0a99f8, 2026-11-10T14:23:56Z.
- New commits read: 2 —
1ce76d25(fix(keepalive): fix round-2 review findings on the floor by
wait cause),d01128ed(fix(keepalive): main background and teammate waits use the 20k floor). - Read in full: 4 reviews, 5 comments, 0 inline comments (from the three files;
.review-in-inline.txtis empty). - New items since my last review: the two commits above; reviewer 2's round-2 review; the
author's two replies at 14:43 (to reviewer 1 and reviewer 2); the rewritten PR body. Each reply
claim was checked against the code, including the new test and the OpenAI branch. - The round-3 rule change end to end:
WaitMinPrefix's switch (own_tool, background, teammate,
subagent → 20k; human, unknown, done, retry and "" → the general floor — I checked every
waitcauseconstant against the switch), the keeper'spingable, the dashSpanPrefixOKand
its new test cases (background, teammate, unknown), the adaptrowFloor, and the label string. - Consistency of every user-facing copy of the rule: config comments,
DefaultKeepAliveMinPrefix
comment, the strategy Desc in Go andsettings.py(identical strings, pinned by the drift
test),cache-keepalive.md, the budget how-to,RELEASING.md,app.js(three spots),
extract_sweep_ping.go,kvcache/strategy.go,advanced-offload.md, and the Pi README — the
README is the one straggler (finding 1). - The two commits' other changes:
rowFloor's extraction and test; the known-gap comments; the
openaiflag has one producer (autoRowsX) and the test; nothing else reads it. - The PR body states the newest owner decision with its date, the turn-off switches, the adapt
under-count honestly, and the data dependence (metadata only). No row in
docs/data-dependence.md changes. - No tests were run. Live tests are not approved, and Go is not on this machine.
amiddavid
left a comment
There was a problem hiding this comment.
| 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 | 3 of 3 | d01128ed3ded |
blocking |
Verdict: blocking
Findings
- pi-package/README.md:122 — the README states the rule that
d01128edsuperseded- What fails: "The proxy pings only a session with a prefix of 80,000 tokens or more (20,000
while a tool runs, and on a subagent)". The owner's decision ind01128edalso gives a MAIN
thread's wait for background work or a teammate the 20k floor (WaitMinPrefix,
keepalive/waitplan.go:90-95). The sentence's "only" enumeration is now false: a main thread
waiting on background work at a 30k prefix gets a ping, and the README says it does not. This
is the paragraph that warns the user about their own quota, so the understated spend rule is
the wrong half to get wrong. The PR updated this very sentence for the earlier rule
(ee1e01dc) and missed it when the rule changed again. A second spot has the same staleness:
docs/how-to/kv-cache-keepalive-budget.md:33-34 still glosses the keys as "a tool wait and for
a subagent" / "a main thread that waits for a person" (written in1ce76d25, not updated by
d01128ed). - Proof:
WaitMinPrefixreturns the tool-wait floor forWaitingBackgroundand
WaitingTeammateon a main thread (waitplan.go:91-93); the tests pin it
(keepalive/waitminprefix_test.go:21-22, dash/keepaliveplan_test.go:417-418). Neither file is
ind01128ed's change list; both are inee1e01dc's and1ce76d25's. - Fix: one line each. Pi README: "(20,000 while a tool runs, for background work or a teammate,
and on a subagent)". Budget how-to: name background work and a teammate in the two comments.
- What fails: "The proxy pings only a session with a prefix of 80,000 tokens or more (20,000
Earlier findings
- Mine, round 2, finding 1 (dash panel copy and comments said 20k): fixed. The three app.js
spots (9474, 9664, 9722) and both dash/keepalive.go comments (591, 611) now state the two floors
by cause. Verified in the diff of1ce76d25andd01128ed. - Mine, round 2, finding 2 (RELEASING.md wrong default): fixed. The trap line now states both
keys and both floors, and it was updated again byd01128edfor the background/teammate change. - Mine, round 2, non-blocking (Idle >= 300 s replay gap): addressed, accepted. The author added
a "Known gap" comment at dash/keepalive.go:1665-1667 and did not change the calculator ("the fix
is not one line"). The reason is right: the band is off-spec (docs say idle must be under 300 s)
and the replay under-counts. - Mine, round 2, non-blocking (old subagent rows get the general floor): addressed. The
SpanPrefixOKcomment now states the old-row rule and calls the under-count the safe direction
(waitplan.go:106-108). - Reviewer 1, round 2, finding 1 (adapt replay gave OpenAI rows the 20k floor): fixed, and I
checked it myself.rowFactscarriesopenai(campaignauto.go:140),rowFloorreturns the
general floor for an OpenAI row (adaptcache.go:172-174), matching the keeper (guardexcludes
OpenAI, keeper.go:914) andSpanPrefixOK(s.OpenAI).TestRowFloorFollowsTheWaitAndTheProvider
covers it, including the two OpenAI cases. - Reviewer 1, round 2, findings 2 and 3: same as my round-2 findings — fixed (see above).
- Reviewer 1, round 2, non-blocking (budget doc example, ask-a-person comment): addressed. The
budget doc was fixed in1ce76d25(and is stale again only in the way my finding above says);
therowFloorcomment states the ask-a-person exception in both directions.
Non-blocking
- Several simplified statements name only "a main thread that waits for a person" for the 80k floor
and omit the unknown cause (dash/keepalive.go:612, app.js:9475, RELEASING.md:225). The full rule —
person or unknown cause — is in docs/how-to/cache-keepalive.md, theWaitMinPrefixdoc comment
and the PR body. The unknown cause is a fallback classification, so I leave this here.
What I checked
- Last review: round 2, c0a99f8, 2026-11-10T14:23:24Z.
- New commits read: 2 —
1ce76d25(fix round-2 review findings on the floor by wait cause),
d01128ed(main background and teammate waits use the 20k floor). Both diffs read in full, plus
the code around each change. - Read in full: 4 reviews, 6 comments, 0 inline comments (the three files were saved again this
round and read in full;.review-in-inline.txtis empty). - New items since my last review: the 2 commits above and the author's 2 comments at 14:43 (replies
to both round-2 reviews). Each reply claim was checked against the code:rowFloorand the
OpenAI flag (read), RELEASING.md (read), the dash comments (read), the app.js copy (read), the
budget doc (read), the known-gap and old-row comments (read). - The rule change in
d01128edend to end:WaitMinPrefix's switch gives the tool-wait floor to
a tool wait, background work, a teammate and any subagent wait, and the general floor to a
person, an unknown cause, done and retry (waitplan.go:86-97). The keeper gate, the dash replay
(SpanPrefixOK) and the adapt replay (rowFloor) all read the same function. The three test
files were extended for the new causes (waitminprefix_test.go, keepaliveplan_test.go,
adaptcache_test.go). - Every text that states the rule: config.go, strategy.go and settings.py Descs (Go and Python
match), dash comments and app.js copy, cache-keepalive.md, advanced-offload.md,
extract_sweep_ping.go, kvcache/strategy.go, RELEASING.md, kv-cache-keepalive-budget.md,
pi-package/README.md — all read. All state the new rule except the two spots in the finding.
Greps for the old wordings ("tool wait or a subagent", "while a tool runs") find nothing else. - The
waitcauseconstants ("background", "teammate", "unknown") match the literals the new tests
use, so the dash replay reads stored causes correctly. - The PR body names the behavior change at the top and states the owner's decision of 2026-11-10
cause by cause, with two turn-off switches. Data dependence: metadata only, unchanged. Agree. - No tests were run. Live tests are not approved, and Go is not on this machine.
Round 3 found copy that named only a tool wait and a subagent, or that left out an unknown cause from the 80k floor. Fix the README, the how-tos, the panel copy and the comments. The adapt replay comment now says a row has no stored cause, so every tool stop reads as a tool wait. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
|
Reply to Reviewer 1, round 3. Head is now
|
|
Reply to Reviewer 2, round 3. Head is now
|
amiddavid
left a comment
There was a problem hiding this comment.
| 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 | 4 of 4 | 07f448cb919e |
approve |
Verdict: approve
Findings
None. My round-3 finding is fixed, and the new commit introduces no defect.
Earlier findings
- Mine, round 3, finding 1 (pi README and budget how-to stated the superseded rule): fixed.
pi-package/README.md:122now reads "(20,000 while a tool runs, for background work or a
teammate, and on a subagent)" — the exact fix I proposed. The budget how-to's two comments
(kv-cache-keepalive-budget.md:33-34) now name background work and a teammate. Verified in the
diff of07f448cb. - Mine, round 3, non-blocking (person-only 80k copy): mostly fixed, remainder stays
non-blocking. The commit adds "or for an unknown cause" to the dash comments, the three app.js
texts, advanced-offload.md, kvcache/strategy.go and the config/keepalive/form comments. Three
spots still name only a person — see Non-blocking. - Reviewer 1, round 3, finding 1: same as mine — fixed (checked myself, above).
- Reviewer 1, round 3, non-blocking (unknown-cause copy, adaptcache comment, PR body test list):
all three addressed, and I checked each: the copy spots listed are fixed; therowFloor
comment now states the no-stored-cause rule and the dash difference; the PR body's test list now
namesTestRowFloorFollowsTheWaitAndTheProviderwith the round-3 mutation.
Non-blocking
- Three copies still give the 80k floor as "a main thread that waits for a person" without the
unknown cause: RELEASING.md:225, the adapt report label (proxy/adaptcache.go:159), and the
autostrategy Desc (config/strategy.go:74, mirrored in settings.py). The unknown cause also
gets 80k. The full rule is in docs/how-to/cache-keepalive.md, theWaitMinPrefixdoc comment
and the PR body. The unknown cause is a fallback classification, so precision only.
What I checked
- Last review: round 3, d01128e, 2026-11-10T15:15:44Z.
- New commits read: 1 —
07f448cb(docs: state the 20k and 80k floors the same way everywhere).
Full diff read, plus the code around each change. - Read in full: 6 reviews, 7 comments, 0 inline comments (the three files were saved again this
round and read in full;.review-in-inline.txtis empty). - New items since my last review: the commit above, the author's two replies at 15:23 (to both
round-3 reviews), and the updated PR body. Each reply claim was checked against the code. - The commit changes comments and copy strings only. No code path changed:
rowFloor's body, the
config constants and the dash gates are byte-identical tod01128ed. So no new behavior to
test, and the existing test set still covers the rule. - Every edited sentence checked against
WaitMinPrefix's switch (waitplan.go:86-97): 20k for a
tool wait, background work, a teammate and any subagent wait; 80k for a person or an unknown
cause. All eleven edited spots state it correctly. - The
rowFloorcomment's new claim, checked myself:storedWaitpassesnoNames = falsefor a
stored human cause (waitplan.go:191-193), sotoolStopWaitkeeps a tool stop stored as "human"
as human. Dash's replay and the adapt replay do differ exactly as the comment says. - The author's "still inside the 4000-character test window" claim, checked with the real offsets:
inloadKARecommend's window (uikeepalive_test.go:124), the pinned range regex matches, and
rec.refused(offset 729) and "factor of two" (offset 2890) stay inside the 4000 characters.
The other window (line 92,renderKADownside) is an unchanged function. - The PR body: the test list now names the adapt-replay test and the round-3 mutation; the
behavior-change section still states the owner decision of 2026-11-10 cause by cause, with two
turn-off switches. Data dependence: metadata only, unchanged. Agree. - Final greps: the old enumeration ("while a tool runs, and on a subagent") is gone everywhere;
the only remaining person-only wordings are the three non-blocking spots above. - No tests were run. Live tests are not approved, and Go is not on this machine.
amiddavid
left a comment
There was a problem hiding this comment.
| 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 | 4 of 4 | 07f448cb919e |
approve |
Verdict: approve
Findings
None. The new commit is docs and comments only. I read every changed line and checked each
new sentence against Policy.WaitMinPrefix (keepalive/waitplan.go:86-97). All state the
shipped rule: 20k for a tool wait, background work, a teammate and any subagent wait; 80k
for a main thread that waits for a person or for an unknown cause. No code, test or
behavior changed.
Non-blocking
- Four copies still name only "a person" for the 80k floor and omit the unknown cause, the
same rare-fallback class I rated non-blocking in round 3:
config/strategy.go:74andsettings.py:3699(the strategy Desc, identical on both
sides, so the drift test still passes),RELEASING.md:225(a small-session example, not
a rule statement),proxy/adaptcache.go:159(the label says "(%d otherwise)", which
reads an unknown cause as the lower floor), and the 80k half of the Pi README sentence. - The commit message says "the same way everywhere". The four spots above are not
everywhere. The author's reply lists exactly what was fixed, so this is wording, not a
hidden claim.
Earlier findings
Mine, round 3:
- pi-package/README.md:121 named only two of the four 20k causes — fixed. The
sentence now reads "(20,000 while a tool runs, for background work or a teammate, and
on a subagent)" — the clause I asked for. Verified againstWaitMinPrefix. - Non-blocking: five copies omitted the unknown cause — fixed.
dash/keepalive.go
(three spots), the three panel texts inapp.js,advanced-offload.md,
kvcache/strategy.goandkv-cache-keepalive-budget.mdnow all say "or for an
unknown cause". The remaining four spots of the same class are in this round's
non-blocking list. - Non-blocking: the
rowFloorcomment compared dash imprecisely — fixed. It now
says a row carries no stored cause, so every tool stop reads as a tool wait, and that
dash'sstoredWaitkeeps a tool stop with a stored human cause as human. That matches
what I verified in round 3. - Non-blocking: the PR body's test list — fixed. It now names
TestRowFloorFollowsTheWaitAndTheProviderand the round-3 mutation (checked in the
body itself).
Reviewer 2, round 3 (read in full; posted just after my round-3 review):
- Finding 1 (Pi README, plus the budget how-to's two glosses) — fixed. Both files are
in07f448cb; I read the diffs. The budget how-to now names background work and a
teammate in both key comments. - Non-blocking (unknown-cause omissions) — two of the three spots fixed;
RELEASING.md:225
remains, as noted above. I accept it: the sentence is an example of a small session, not
a statement of the rule.
What I checked
- Last review: round 3, d01128e, 2026-11-10T15:14:17Z.
- New commits read: 1 —
07f448cb(docs: state the 20k and 80k floors the same way
everywhere). Full diff read: 11 files, +21/−19. Every change is a comment, a doc line or
a panel string; no Go statement changed. - Read in full: 5 reviews, 7 comments, 0 inline comments (from the three files;
.review-in-inline.txtis empty). - New items since my last review: the commit above, reviewer 2's round-3 review, and the
author's two replies at 15:23. Each reply claim was checked against the code: the fixed
copy (read), the app.js parse safety (the edits extend existing string literals in
concatenations;dash/api_test.go:427parses app.js and stays green), and the PR body
(fetched and read). - The accuracy of every new sentence, against the switch in
waitplan.go:config.go,
form.go,types.go,waitplan.go(comments),dash/keepalive.go(three comments),
the threeapp.jspanel texts,advanced-offload.md, the budget how-to,
kvcache/strategy.go, the Pi README, and the rewrittenrowFloorcomment. - Greps for the stale wordings ("a tool wait and a subagent", "while a tool runs" outside
the fixed sentence, "is the shipped floor") find nothing else that misstates the rule. - No Go test pins the changed panel copy; the only copy-adjacent tests are the app.js
parse test and the strategy-table drift tests, and the Desc is unchanged on both sides. - No tests were run. Live tests are not approved, and Go is not on this machine.
Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
|
Merged origin/main into this branch (head c899242).
|
…0.2.12, Pi 0.1.1) Claude Code plugin 0.6.7 -> 0.7.2: - #981, #989, #1018, #1035: subscription band and savings show saved tokens. - #1038: insights drop the finding that credits a user's own removal. - #1039, #1040: dash and keep-alive fixes that touch the plugin files. Codex plugin 0.2.11 -> 0.2.12: - #1051: read the cache strategies and presets from the proxy. - The vendored cg.py gets the same plugin changes. Pi package 0.1.0 -> 0.1.1: - #1010: chain the proxy in front of an existing base URL. - #1011: check the proxy at session start and restart it once. - #1049, #1058: write the cache strategy by name; review fixes. OpenCode plugin (#483): new in v0.7.2, no version file, not changed. Bob plugin 0.1.0: no change since v0.7.1, not changed. Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Add K9 (pings per long wait), K10 (no-ping misses by prefix band) and X6 (savings share by thread type), each compared with the week before and split by main or subagent thread. Add the #1040 case with a laptop baseline, and gap G10 (the keep-alive settings in effect are not recorded). Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
A new test covers the sweep question at the keep-alive ping under the per-cause prefix floors from #1040: 20k tokens for a subagent wait, 80k for a person or an unknown cause. Test only. Mutation checks: the test fails when the 20k subagent floor is removed, when the general floor is set to 120k, and when the unknown cause gets the 20k floor. Behavior change: none. Data dependence: none. Reviews: 2 offload reviews (GLM), round 3 (granted by the owner), both approve at 77909f3, which is the PR head. Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
Bump the plugin versions for v0.7.2. - Claude Code plugin 0.6.7 -> 0.7.2: #981, #989, #1018, #1035 (savings in tokens on a subscription), #1038, #1039, #1040, #1055 (cache strategies read from the proxy). - Codex plugin 0.2.11 -> 0.2.12: #1051 (cache strategies and presets read from the proxy), plus the vendored cg.py changes. - Pi package 0.1.0 -> 0.1.1: #1010, #1011, #1049, #1058, and the #1040 README line. - OpenCode plugin: new in v0.7.2 (#483), no version file. Its first start now downloads proxy v0.7.2 (was v0.7.1). Nothing compares against PINNED_VERSION; the floor stays "v0.7.1 or later". The README lines, the install guide and 3 tests follow. - Bob plugin: 0.1.0, no change since v0.7.1. Behavior change: the OpenCode plugin's first download is proxy v0.7.2, not v0.7.1. Owner's yes, 2026-11-11, in the integrator session: "option1 it is"; the version bumps: "I approve the version bumps for the plugins". Data dependence: none. Reviews: 3 offload review rounds (GLM; round 3 pre-approved by the owner). Both reviewers approve at 3cf6176, which is the PR head. Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
Behavior change
auto,1-pingand2-ping(Claude Code plugin and Pi plugin), and users who set no strategy.keepalive_tool_wait_min_prefix_tokens: 80000(one floor), or setkeepalive_wait_plan: false(one floor,keepalive_min_prefix_tokens, for every wait).Summary
keepalive_min_prefix_tokens(default 80000) is the general floor. Newkeepalive_tool_wait_min_prefix_tokens(default 20000) is the lower floor.What changed
config: new keykeepalive_tool_wait_min_prefix_tokens. Default 20000. Wired into the form andmain.go.DefaultKeepAliveMinPrefixis 80000 again.keepalive:Policy.WaitMinPrefix(cause, subagent)sits next toWaitPings.pingable()reads it. Withkeepalive_wait_plan: false, one floor applies.dash/keepalive.go) uses the same floors.Policy.SpanPrefixOKis the replay form of the keeper gate. A drift test still runs the keeper and the replay on the same cases.proxy/adaptcache.go) uses the same floors. A row has a stop reason, not a cause: a tool stop is a tool wait, any other stop is read as a wait for a person (80k). So it under-counts rows that waited for background work or a teammate. An OpenAI row gets the general floor.autoDesc text states the split.docs/how-to/cache-keepalive.md,pi-package/README.md,docs/components/advanced-offload.md,extract_sweep_ping.go,kvcache/strategy.go.proxy/campaign.go. The main session tracks it in its own issue.Existing user files
strategy sync). The file stateskeepalive_min_prefix_tokens: 80000. That is the right general floor. The file does not state the new key, so the proxy default (20000) applies at the next proxy start.strategy syncalso runs before every start and re-renders the file from the table.How it was tested
On the shared box, with
-race:./config/... ./keepalive/... ./cmd/... ./context-guru-plugin/... ./pi-package/...: pass../dash/...: pass (own call)../proxy/...: pass (own call, 599 s).TestWaitMinPrefixByCause,TestPingableUsesTheFloorOfTheWait,TestSpanPrefixOKFollowsTheWaitCause,TestStrategiesPinTheGeneralFloorToTheDefault,TestToolWaitMinPrefixDefaultAndOverride,TestStrategyFileHasNoToolWaitFloor.TestRowFloorFollowsTheWaitAndTheProvider(adapt replay floor by wait and provider). Round 3 mutation: with the background case removed fromWaitMinPrefix, the keeper, replay and floor tests fail.WaitMinPrefix,pingableandSpanPrefixOKtests fail. With the table at 20000, the table test fails.Data dependence
Metadata only. The wait cause is already computed from tool names and the stop reason. The floor reads token counts. No row in
docs/data-dependence.mdchanges.🤖 Generated with Claude Code