Repository navigation
feat(plugin): read the cache strategies from the proxy - #1055
Conversation
The Claude Code plugin no longer keeps its own copy of the cache strategy table. It runs `context-guru-proxy strategies` and offers the strategies whose providers include anthropic or any. - settings.py reads the table from the binary (short time limit, loopback port 0, cached per binary path and mtime). A binary without the `strategies` command gives a clear error: update the proxy to v0.7.1 or later. There is no fallback table. - `strategy set` writes `cache: strategy: <name>`. The proxy fills the keys. Files written earlier keep their explicit keys and keep working. - `strategy sync` leaves an old-form file's keys alone and moves only its `preset:` line. It moves a legacy-marked file to the new form once the recorded proxy is v0.7.1 or later. - The plugin checks each preset in its picker list against the proxy's `presets` list. - config: replace the Python drift test with a test that the effective config of each old-form file equals the `strategy: <name>` form. Refs #980 Assisted-By: Claude Opus 5.5 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 | 1c6c18f621c8 |
blocking |
Verdict: blocking
Findings
-
context-guru-plugin/scripts/settings.py:3705 —
load_strategy_tablecrashes with an uncaughtAttributeErrorwhen the proxy binary exits 0 with output that is not a JSON object.- What fails: a binary that prints non-JSON (or a JSON list or string) to stdout and exits 0 makes
tableNone(or a non-dict). Theok =expression then callstable.get("default")on it. Python raisesAttributeError, which nothing catches.strategy list,strategy set,strategy show,preset list/set/restartand insights.py (viadefault_strategy) all crash with a traceback and exit 1. The cleanresult=error reason=proxy_too_oldwith the update advice never prints. install.sh then reads noresult=line at all, so route_main misclassifies the crash asstrategy_list_unavailablewith an empty cause. - Proof: reproduced on this machine with a stub binary that echoes one line and exits 0:
CONTEXT_GURU_BIN=<stub> python3 -I .../settings.py strategy listexits 1 with
AttributeError: 'NoneType' object has no attribute 'get'at settings.py:3705.
The short-circuit saves only the timeout case (code == -1); exit 0 is the unprotected side. Non-UTF-8 stdout raisesUnicodeDecodeErrorin the same function (text=True), same family. - Fix: add
isinstance(table, dict)to theokchain before any.get, so every bad output becomesStrategyTableError. Add a test with a stub that exits 0 printing garbage.
- What fails: a binary that prints non-JSON (or a JSON list or string) to stdout and exits 0 makes
-
context-guru-plugin/scripts/install.sh:1053 — with no local proxy binary,
--cache-strategyis never validated in attach mode (and not before a--plan).- What fails: route_main defers the name check to the post-install block (line 1053), which runs only under
if [ "$R_MODE" = local ]. In attach mode nothing installs a binary, so the check never runs.--planalso exits at line 935, before step 1. A typo'd or stale--cache-strategyname (or a bad savedoption_cache_strategy) then reaches the plan and the consent question as fact (cache_strategy=<name>, "SPEND STATUS UNKNOWN"), and the attach install finishes withresult=routed. Onlystrategy_warning=no_proxy_binaryhints at it, and the warning names the binary, not the unknown name. The base refused this input asunknown_strategybefore anything was written — the exact "dropped decision that reports success" shape this script's own comments call a defect. - Proof: route_main (install.sh:742-753) sets
R_STRATLIST_DEFERRED=1onno_proxy_binaryand skipsroute_check_strategy. The deferred check at 1053 sits inside theR_MODE = localblock at 1034. Attach mode has no other call toroute_check_strategyorroute_check_strategy_late. Step 4bstrategy setfails withno_proxy_binaryand its result lands instrategy_warning=only. - Fix: when the list is deferred and the mode is attach (or the run is
--plan), refuse with a named reason, or validate the name wherever a binary is first askable. At minimum, say in the plan and the consent question that the strategy name is unchecked.
- What fails: route_main defers the name check to the post-install block (line 1053), which runs only under
Non-blocking
- Stale comments name removed code: install.sh:507 cites the deleted
STRATEGIESdict; start-proxy.sh:1090-1094 citessettings.py ONE_HOUR_DEFAULTSand "only a non-default value is ever written" — the plugin now writes no_1hkey at all._render_strategy's docstring (settings.py:3826) says "strategy sync re-renders them to this form", but the sync MIGRATION comment says the opposite, and the code follows the MIGRATION comment. strategy syncno longer rewrites an oldstrategy=5-min-pingmarker toauto. The startup note and statusline will show the old alias name indefinitely. It works: the proxy resolves the alias. Cosmetic.- The picker SKILL.md documents only
reason=proxy_too_old.no_proxy_binaryandproxy_unrunnableare undocumented outcomes for the model that reads it. preset list/set/restartnow exit 3 when the proxy cannot be asked (no binary, or one older than v0.7.1). Before,preset setsucceeded and start-proxy.sh fell back to presetoffat launch with a note. This is a user-visible behavior change (CLAUDE.md / RELEASING.md rule); confirm the owner named and approved it on the PR.load_strategy_tablevalidates the row shape but notaliases/presets. A dict answer withaliasesas a list crashes.items()later. Same trust boundary as finding 1; narrower.
What I checked
- Read the full diff base..HEAD and the code around every change: config/strategy.go and its tests, the four old-form fixtures, settings.py (table loading,
strategy list/show/set/clear/sync,presetgating,--bin), install.sh (route_main, both check functions, step 1 and 4b), start-proxy.sh recovery paths, insights.py, SKILL.md, plugin_test.go, and the two new test files. - Verified the version claim:
strategiessubcommand andcache.strategyconfig support landed together in b49cbeb, first released in the v0.7.1 tag, soSTRATEGY_MIN_PROXY = "v0.7.1"is correct for both the subcommand and thestrategy:key the stale-marker migration writes. - Traced the sync paths: new-form re-render, old-form preset-line-only edit,
--legacy-binary_1hstripping, and the stale-marker move to the new form at a recorded v0.7.1+. Each matches its test. - Confirmed the old fixtures match what the base plugin rendered (keys, omitted default
_1hvalues), soTestEveryStrategyHasTheSameEffectiveConfigAsItsOldKeyscompares the right things. - Confirmed sync never runs the proxy binary, so SessionStart stays fast with any binary — the design goal.
- Confirmed
noneneeds no table, and30-min-pingis refused for this plugin (not_offered). - Reproduced finding 1 live with python3 (no Go was built or run; live Go tests are not approved).
- Did not read the other reviewer's folder or any PR comments before posting this.
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 | 1c6c18f621c8 |
blocking |
Verdict: blocking
Findings
- context-guru-plugin/scripts/install.sh:1053 — in attach mode with no proxy binary, an unknown
--cache-strategyname is never checked, and the install reports success- What fails:
install.sh --mode attach --base-url <url> --cache-strategy 5-minute-pingon a machine with nocontext-guru-proxybinary.strategy listfails withno_proxy_binary, so line 745 setsR_STRATLIST_DEFERRED=1and skips the name check. The only re-check (line 1053) sits insideif [ "$R_MODE" = local ](line 1034), so attach mode never runs it. Step 4b'sstrategy setthen fails withno_proxy_binary, and the catch-all at line 1083 turns that intostrategy_warning=. The install finishes withresult=routedandcache_strategy=5-minute-pingas a fact, while no strategy file exists and the name is not a strategy. This is the exact "dropped decision that reports success" shape the comment above line 729 says this check exists to prevent. Before this PR, the plugin's own table answered the list in every mode, so the name was refused in attach mode too. Also, even a valid name is no longer armed in this mode; before, the file was written. - Proof: line 745 sets the deferred flag for
no_proxy_binary; lines 1034/1053 runroute_check_strategy_lateonly whenR_MODE = local; line 1083 maps thestrategy setfailure tostrategy_warning;route_report(line 633) emitscache_strategy=$R_STRATEGY. - Fix: when
R_STRATLIST_DEFERRED=1andR_MODE = attachandR_STRATEGY != none, either refuse before routing is written (same shape asroute_check_strategy_late), or state in the report that the strategy was neither checked nor armed, and stop emittingcache_strategy=as a fact.
- What fails:
Non-blocking
- install.sh consent question (line 516): on a first install there is no binary yet, so
R_SPENDSis unset and the question says "SPEND STATUS UNKNOWN - treat it as spending" for every non-nonestrategy, including the defaultauto. Before, it said what the strategy spends. The direction is safe and the code comment says it is deliberate, but every fresh install now consents to a vaguer sentence. - settings.py
_render_strategydocstring: it says "strategy syncre-renders them to this form". Sync keeps old-form files and moves only thepreset:line; only the stale-marker path re-renders. The comment insidecmd_strategysays this correctly. - A new-form file plus a binary older than v0.7.1 has no recovery. The binary rejects the
strategy:key itself, and start-proxy.sh's recovery grep matches only the_1hkey names, so the session is left with no proxy. Thestrategy sethard stop makes this reachable only by downgrading the binary after a new-form file was written. Worth a note in the docs, not a code change. - settings.py
strategy showwith no readable table: the recorded name is reported raw, so an oldstrategy=5-min-pingmarker shows5-min-ping, notauto. Display only;setandsyncare unaffected. - settings.py
find_proxy_binary: an explicit--binorCONTEXT_GURU_BINpath that exists but is not executable is silently skipped, and a different binary on PATH can answer in its place. Edge case; install.sh always passes a binary it just ran.
What I checked
- The full diff (15 files) and the code around every hunk:
config/strategy.go,config/strategy_test.go, the four YAML fixtures,settings.py(table load,find_proxy_binary,cmd_strategylist/show/sync/set/clear,cmd_preset,_presets_known_to_proxy, argparse),install.sh(route_main,route_check_strategy,route_check_strategy_late, step 1 and step 4b, consent gate order),insights.py,start-proxy.sh(sync call, 1h-key and preset recoveries),SKILL.md,plugin.json, and all new and changed tests. - That the proxy side already exists at the base commit:
config.StrategiesJSON,LookupStrategy, theProvidersfield, and thestrategiessubcommand incmd/context-guru-proxy/main.go. The JSON shape matches whatload_strategy_tablevalidates (default,aliases,strategies[].name/providers/spends/desc,presets). - That no leftover reference to the removed names (
DEFAULT_STRATEGY,STRATEGIES,STRATEGY_ALIASES,ONE_HOUR_DEFAULTS) remains in the plugin scripts. - The sync state machine by hand for every file shape: old-form with and without the legacy marker, new form,
--legacy-binary, stale marker with version below and at or above v0.7.1, and the missing version file. TheTestTheLegacyMarkerEndsWhenTheProxyIsUpdatedsequence (v0.4.2 → v0.5.0 → v0.7.1) traces correctly: synced, unchanged, moved to the new form. - That
strategy sync(the SessionStart path) never runs the proxy binary, and that the statusline,cmd_show,cmd_config, and start-proxy.sh read the strategy name from the file, so no hook spawns the binary per render. - That the new fixtures match what the old plugin wrote (the
_1hdefaults omitted, onlykeepalive_max_pings_1h: 2for2-ping), and thatResolved()fills the omitted_1hvalues from defaults equal to the table, soTestEveryStrategyHasTheSameEffectiveConfigAsItsOldKeyscompares like with like. - That every test helper that runs
strategyorpresetops now provides a binary (settingsIn,settingsInDir,presetIn,routeEnv,fakeProxyDir, the twopreset setcall sites,preset_restart_test), and thatrouteEnvcallers with an emptyextraPathare plan, refuse, or attach paths only. - The old-binary path (#483): an ignored
strategiesargument makes the binary serve; the run usesLISTEN_ADDR=127.0.0.1:0,stdin=DEVNULL, a time limit, andsubprocess.runkills the child on timeout.noneneeds no table, so turning pings off works with any binary. - The PR description: the v0.7.1 hard stop is named at the top as a behavior change, and the data-dependence statement (none) matches the code.
- I did not run the Go tests (live tests not approved; Go is not on this machine). The PR reports
go test -race ./config/...and./context-guru-plugin/...as passing; I verified the test code and helpers by reading only.
- install.sh: an unchecked --cache-strategy name (attach mode, or --plan with no binary) is refused with reason=strategy_unchecked, or marked unchecked in the plan. It is no longer reported as a fact. - settings.py: every bad answer from the proxy (garbage, JSON that is not an object, bad aliases or presets, bytes that are not UTF-8) becomes the proxy_too_old advice. - The strategies probe runs in a scrubbed env (no dashboard, record, store or hosted-mode settings) and in a fresh empty directory. - Presets keep the old behavior: saved and warned when no proxy can list presets. The check runs when a proxy answers. - sync renames an old 5-min-ping marker to auto; show maps it locally. - A named binary that is not executable is an error. - Comments, picker skill and docs match the code. Refs #980 Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
|
Round 1 is fixed at Blocking
Non-blocking
Tests (box dir
The PR body now has the exact behavior change, the probe scrub and the release-note line. |
A proxy older than v0.7.1 reads ARCHIVE_REMOTE and six other ARCHIVE_* settings. ARCHIVE_REMOTE uploads data. The probe now drops them, and the test sets ARCHIVE_REMOTE in the parent env and checks the probe does not see it. Refs #980 Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Also: the earlier "wip: test url" commit (strategies_round1_test.go, 2 lines) changed the test base URL to http://127.0.0.1:9/anthropic. It was a fix to my own test, not to the product: install.sh refuses an attach URL whose path is not /anthropic, so the first version of the test hit invalid_base_url before it reached the strategy check. This commit adds a comment that says so. Refs #980 Assisted-By: Claude Opus 5.5 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 | 2 of 2 | b30b7bd2c98e |
approve |
Verdict: approve
Findings
None. Every round-1 finding is fixed, and the fix commits introduce no new defect I can show.
Earlier findings, and their status
- Mine, install.sh attach mode never checks
--cache-strategywith no binary — fixed. install.sh:753 now refuses a non-nonename in attach mode withreason=strategy_uncheckedand the advice to install proxy v0.7.1+ or pass--cache-strategy none.route_needsrefuses before the consent gate and before step 0, so nothing is written (exit 2,result=refused), and under--planit isneeds_decisionat exit 0. A local--planwith no binary printsstrategy_unchecked=truewith a note that matches what the post-install check does. Verified the placement: theeliffires only forno_proxy_binary(the only deferred reason), andnoneis exempt. Tests:TestAttachModeRefusesAnUncheckedStrategyName,TestPlanWithNoBinarySaysTheStrategyIsUnchecked. - Reviewer 2, finding 1:
load_strategy_tablecrashes on non-dict JSON — fixed. Theokchain now starts withisinstance(table, dict), andaliases/presetsare type-checked before.items()iterates them (theandchain short-circuits, so a listaliasesnever reaches.items()). Stdout is decoded witherrors="replace", so non-UTF-8 bytes become aValueErrorinjson.loads, not a traceback. Every bad answer raisesStrategyTableErrorwith the update advice. Test:TestBadProxyOutputIsTheCleanAdviceNotACrash(garbage, list, string, non-UTF-8, bad aliases, bad presets), run for bothlistandset. - Reviewer 2, finding 2: same attach/plan gap as mine — fixed, see item 1.
- Integrator, the probe must not write state — fixed.
_PROBE_DROPremovesDASHBOARD*,SESSION_STATE*,CONTROL_DB,UPSTREAMS,CG_RECORD*,ARCHIVE_*,STORE,IDLE_EXIT; the probe setsDASHBOARD=0, keepsLISTEN_ADDR=127.0.0.1:0andCONFIG=, and runs in a freshcg-strategies-*directory. I checked every dropped name against the Go tree: all are real proxy settings (ARCHIVE_REMOTE,CG_RECORD_DIR,CONTROL_DB,DASHBOARD_DB,SESSION_STATE,STORE,IDLE_EXIT,UPSTREAMSall appear as read env vars). Test:TestTheProbeRunsInAScrubbedEnvAndAFreshDirectory. - Owner decision, presets keep the old behavior — done.
_presets_known_to_proxywarns (warning=preset_unchecked) and returns 0 when no proxy can answer; a proxy that answers and lacks a preset still errors with exit 3.preset setsaves again with no binary, as before this PR. Test:TestPresetSetSavesAndWarnsWhenNoProxyCanListPresets. This resolves reviewer 2's non-blocking behavior-change question: the owner named it in the fix comment. - My non-blocking items — all fixed or accepted.
_render_strategydocstring now matches the sync code. The docs say a new-form file needs v0.7.1+ and not to downgrade.find_proxy_binaryraisesproxy_unrunnablefor a named, existing, non-executable binary, with no PATH fall-through.strategy showmaps5-min-ping→autowithout a table, andsyncrenames the marker (testTestSyncRenamesAnOldAliasMarker). The vaguer consent sentence is kept by owner decision: no binary means the spend status is unknown, and the sentence says to treat it as spending. I accept that; a table copy is what this PR removes. - Reviewer 2's non-blocking items — all fixed. Stale comments in install.sh and start-proxy.sh rewritten. SKILL.md documents
no_proxy_binaryandproxy_unrunnable. The aliases/presets validation is part of fix 2.
Non-blocking
- settings.py
_presets_known_to_proxy: theproxy_too_oldmessage ends with "nothing was changed" (from_update_hint), butpreset setthen saves the preset. The warning sentence is false in that one output. Use a hint without that clause for the warning. - install.sh:753: attach mode with no local binary now refuses every non-
nonestrategy, including the defaultauto. A user who never asked about strategies must pass--cache-strategy none. Honest, and the advice is actionable, but it is a change to the plain attach flow. - install.sh:753: the attach strategy check runs before the
--base-urlvalidation, so a typo'd URL plus an unchecked strategy reports the strategy reason first. Diagnostic order only; both refuse. - settings.py
LEGACY_NAME_ALIASES: a one-entry copy of the proxy's alias map, for display only. If the proxy adds an alias,strategy showwithout a table reports the raw name again. The comment says the proxy stays the authority; accepted. - The
wip: test urlcommit title is not a conventional-commit type. History noise only.
What I checked
- Last review: round 1, 1c6c18f, 2026-11-10T15:50:03Z
- New commits read: 4 —
4ca63870fix(plugin): review round 1 of the strategies change;15c177f8wip: test url;a285034afix(plugin): drop ARCHIVE_* from the strategies probe env;b30b7bd2docs(plugin): say why the attach test URLs end in /anthropic - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files in my folder)
- New items since my last review: reviewer 2's round-1 review (2 findings, 5 non-blocking — checked each, statuses above); the author's fix comment at 2026-11-10T22:37:56Z (checked every claim it makes against the code); the 4 fix commits (read the full diff and the code around each hunk).
- The attach fix: traced
route_needs/route_refuseexit codes (2 refused, 0 needs_decision under--plan), theelifguard conditions, and that the refusal lands before the consent gate and step 0. Confirmed--no-health-checkand every test helper used by the new tests exists (statsPresetStub,routedProject,runRoute,settingsWithBin,oldProxyBin,strategyCfg). - The crash fix: checked the
andchain order so no.get/.items()runs on a non-dict, and thatrun.stdoutis bytes (thetext=Trueflag is gone) witherrors="replace"decoding. - The probe scrub: matched every
_PROBE_DROPname against env vars the Go proxy reads, and read the scrub test's env assertions (dropped vars absent,DASHBOARD=0,KEEP_ME=yes, freshcg-strategies-cwd). - The sync alias rename: traced
name = LEGACY_NAME_ALIASES.get(recorded, recorded)through all three branches (new form, stale marker, old form). The marker rename uses a plain string replace on line 1 only, and_is_new_formstill compares against the recorded name so a new-form file is not misdetected. - The preset warn path: confirmed
preset listfalls back to the plugin's short list,preset setsaves with the warning, and a proxy that answers with a missing preset still errors (the round-1 testTestEveryPickerPresetIsKnownToTheProxystill covers that side). - Confirmed
noBinaryEnv's appendedPATHandCONTEXT_GURU_BIN=win overrouteEnv's values: Go'sos/execkeeps the last duplicate key inCmd.Env. - I did not run the Go tests (live tests not approved; Go is not on this machine). The author reports
go vetclean, both-raceruns ok, and 10 of 10 mutations caught; I verified the fixes by reading only.
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 | b30b7bd2c98e |
approve |
Verdict: approve
Findings
None. Both round-1 blocking findings are fixed and verified. No new defect in the four new commits.
Earlier findings
- R2-1 / R1-1, attach mode and
--plannever check--cache-strategywith no binary: fixed. install.sh:753-759 refuses attach mode with a non-nonename and no binary,reason=strategy_unchecked, before anything is written. A local--planemitsstrategy_unchecked=truewith a note (install.sh:943-945). Verified live: attach plan returnsresult=needs_decision reason=strategy_uncheckedand nocache_strategy=line; local plan returnsplannedwithstrategy_unchecked=true.nonestill installs. Tests:TestAttachModeRefusesAnUncheckedStrategyName,TestPlanWithNoBinarySaysTheStrategyIsUnchecked. - R2-2,
load_strategy_tablecrash on bad output: fixed. settings.py:3718-3726 now requiresisinstance(table, dict)before any.get, validatesaliasesandpresetstypes, and decodes stdout as bytes witherrors="replace". Verified live with stub binaries: garbage, a JSON list and non-UTF-8 output all giveresult=error reason=proxy_too_oldwith the update advice, exit 3. No traceback. Test:TestBadProxyOutputIsTheCleanAdviceNotACrash(six cases, bothlistandset). - Integrator, the probe must not write state: fixed.
_PROBE_DROP(settings.py:3669) dropsDASHBOARD*,SESSION_STATE*,CONTROL_DB,UPSTREAMS,CG_RECORD*,ARCHIVE_*,STORE,IDLE_EXIT; the probe setsDASHBOARD=0and runs in a fresh temp cwd. I checked the drop list against every env var the proxy reads (envOr/Getenvincmd/,proxy/): every startup write path needs one of the dropped vars, or lands on a relative default path (the dashboard DB default is./...), which the fresh cwd absorbs.parseBool("0")is false, soDASHBOARD=0keeps the dashboard off. HOME-derived paths in the proxy are reads only. Test:TestTheProbeRunsInAScrubbedEnvAndAFreshDirectory. - My non-blocking items: all fixed. Stale comments in install.sh, start-proxy.sh and the
_render_strategydocstring are corrected.strategy syncrenames a5-min-pingmarker toautoviaLEGACY_NAME_ALIASES(marker only, keys untouched), andstrategy showmaps it without a table. SKILL.md documentsno_proxy_binaryandproxy_unrunnable.aliases/presetstypes are validated. - My preset-gating concern: resolved by owner decision.
preset list/set/restartwarn (warning=preset_unchecked) and proceed when no proxy can answer, and still error when an answering proxy lacks a preset. That restores the base behavior, which was my ask. Test:TestPresetSetSavesAndWarnsWhenNoProxyCanListPresets. - R1 non-blocking, vaguer consent sentence: kept, and I accept the reason. With no binary the spend status is unknown; the sentence says to treat it as spending. The safe direction, and a table copy is what the owner ruled out.
- R1 non-blocking, new-form file plus an older binary: docs note added (install-plugin.md: "Do not downgrade the proxy after you switch strategy"). As the reviewer asked.
Non-blocking
- A local
--planwith no binary still emitscache_strategy=<name>(route_report), next tostrategy_unchecked=true. The pair is honest and the confirming run refuses an unknown name before routing. But the fix note's claim "the name is never reported as a fact" holds only for the attach path, not the local plan. strategies_round1_test.go:117—TestTheProbeRunsInAScrubbedEnvAndAFreshDirectorycompareslines[0] == herewherehereis a temp dir nothing passed to the probe. That clause can never fire; the real assertion is thecg-strategies-prefix. Dead check, slightly misleading to a reader.- Commit
15c177f8is titledwip: test url, which breaks the repo's conventional-commit rule. It is inside the PR history; harmless if the merge squashes.
What I checked
- Last review: round 1, 1c6c18f, 2026-11-10T15:46:01Z
- New commits read: 4 (
4ca63870fix(plugin): review round 1 of the strategies change;15c177f8wip: test url;a285034afix(plugin): drop ARCHIVE_* from the strategies probe env;b30b7bd2docs(plugin): say why the attach test URLs end in /anthropic) - 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 (their finding matches my finding 2, now fixed; their non-blocking items each addressed above); the author's fix-summary comment (every claim checked against the code); the four commits (full diff read, plus the changed files around each hunk).
- Verified the fix code paths by hand: the new
okchain inload_strategy_table,find_proxy_binary's exists-but-not-executable error, the probe env scrub and temp cwd,_presets_known_to_proxy's warn-and-continue, the sync alias rename (_is_new_formon the recorded name,strategy=<old>replaced once in the marker), androute_needs' plan/refuse split behindstrategy_unchecked. - Verified the new tests trace to real behavior:
noBinaryEnvreally removes every binary source (sandboxEnv dropsCONTEXT_GURU_BIN, PATH and DEST overridden), the attach test's refusal and thenoneexception, the six bad-output stubs against the validation chain, and the probe-scrub assertions against the env the stub records. - Reproduced both round-1 defects' fixes live with python3 and bash (no Go built or run; live Go tests are not approved): garbage/list/non-UTF-8 binaries give the clean advice,
preset listwarns and succeeds, attach plan refuses withstrategy_unchecked, local plan emits the unchecked flag. - Confirmed the probe drop list against every env var the proxy reads, that
DASHBOARD=0parses false, and that no HOME-derived startup write path exists.
Conflicts: config/strategy.go (kept the main text on the floors, plus this branch's sentence that the plugin reads the table) and settings.py (kept the removal of the Python table, which main still held). Also two small fixes: the preset warning no longer says nothing was changed, and a dead clause is gone from a probe test. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
The preset warning used a nested double quote inside an f-string, which is a syntax error before Python 3.12. Use a plain variable. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
…able The plugin now writes the strategy name, so the file pins no floor. The test checks that, and that the proxy resolves 80000 and 20000. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Owner decision. Attach mode installs no binary, so a strategy name cannot be checked. `auto` is the plugin's own default and the remote proxy checks the name when it loads the setting, so `auto` and `none` pass unchecked. Any other name is refused with reason=strategy_unchecked. The same rule applies to --plan: `auto` and `none` are not reported as unchecked. Refs #980 Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Conflict in config/strategy_test.go, resolved by keeping both removals: main removed the Codex drift test and the os import, and edited a comment inside the Claude Code drift test; this branch removes that test and its Python parser. The result keeps this branch's side of both conflict blocks (the os import and the effective-config test) and every other test from main. Assisted-By: Claude Opus 5.5 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 | resumed | 2 of 2 | 3 of 3 | 65d5651406c4 |
approve |
Verdict: approve
Findings
None. The round-3 commits fix the open non-blocking items and the two merges, and they introduce no defect I can show.
This round's changes, checked one by one
32e47671fix(plugin): keep settings.py parseable on Python 3.9 — correct. The round-2 fix for the false "nothing was changed" warning used a nested double quote inside an f-string, which Python before 3.12 cannot parse. The commit rewrites it to strip the suffix with a plain variable:why = why[: -len("; nothing was changed")]. The old construct was a Python 3.12+ parse (PEP 701);str.endswithplus slicing is valid on every Python 3, andfrom __future__ import annotations(line 31) keeps thedict | Noneannotations safe too. I also parsedsettings.pywith python3-Ion this machine: no syntax error. The strip runs only when the suffix is present, so other messages pass through unchanged.335894c4fix(plugin): allow auto in attach mode with no local binary — correct, owner decision. install.sh now exemptsautoandnonefrom the attach-modestrategy_uncheckedrefusal, in both the refusal (elif [ "$R_MODE" = attach ] && [ "$R_STRATEGY" != none ] && [ "$R_STRATEGY" != auto ]) and the--planemit.autois the plugin's own default, so a user who never named a strategy is not stopped. A named strategy other thannoneandautois still refused. The install still reportsstrategy_warning, so the name stays marked unchecked. New testTestAttachModeWithNoBinaryAllowsAutoAndRefusesOtherNamescovers both sides:autoandnoneroute,2-pingexits 2 withstrategy_uncheckedand writes no settings file.5d3a7b3atest(plugin): re-anchor the tool-wait floor test — correct. The branch deleted main'sTestStrategyFileHasNoToolWaitFloorwhen it removed the local table. The commit re-adds it, adapted: the strategy file must contain notool_wait_min_prefixorkeepalive_min_prefix_tokenskey, must end withcache:\n strategy: auto\n, andconfig.LoadBytes→Resolved()must still give the same floors (80000 / 20000). So the floors stay asserted, now against the proxy's own config code instead of a table copy. That is the right anchor for this PR.- Merge
82aa98fcand merge65d56514— resolutions verified. The PR was merged with origin/main twice; the base moved from87b29dbto9d34f00. I read both merge diffs and the conflicts they resolved. Inconfig/strategy_test.go,65d56514keeps this branch's removal ofTestStrategyTableMatchesPluginwhile taking main's move of the Codex drift test toconfig/strategy_codex_test.go. Instrategies_round1_test.go,82aa98fcremoves the deadlines[0] == hereclause I flagged in round 2. I diffed the PR against the new base9d34f00: the 18 changed files are the previously reviewed content plus the three commits above. The only other change in a PR-touched file isinsights.py, and it comes from main (e842294a), not from this branch.
Reviewer 1's round-2 review, checked
- Their non-blocking item on the false "nothing was changed" warning is the same as the fix in item 1. Fixed.
- Their non-blocking item on attach mode refusing the default
autois item 2. Fixed by owner decision. - Their remaining notes (diagnostic order, the one-entry
LEGACY_NAME_ALIASEScopy, thewip: test urltitle) are accepted as-is by both of us. I agree; none is a defect.
Non-blocking
- A local
--planwith no binary still emitscache_strategy=<name>next tostrategy_unchecked=true. The pair is honest and the confirming run refuses an unknown name. Unchanged from round 2; accepted. - Commit
15c177f8(wip: test url) still breaks the conventional-commit rule. History noise only, as in round 2.
What I checked
- Last review: round 2, b30b7bd, 2026-11-10T22:46:48Z
- New commits read: 3 on the branch (
32e47671fix(plugin): keep settings.py parseable on Python 3.9;5d3a7b3atest(plugin): re-anchor the tool-wait floor test on the proxy-owned table;335894c4fix(plugin): allow auto in attach mode with no local binary) plus the merges82aa98fcand65d56514and the main history they pulled in - Read in full: 4 reviews, 1 comment, 0 inline comments (from the three files in my folder)
- New items since my last review: reviewer 1's round-2 review (checked every claim and every non-blocking item against the code); no new author comment; no inline comments.
- The Python 3.9 fix: read the rewritten block in
_presets_known_to_proxy, compared it with the removed nested-quote form, and parsed the file with python3-I(syntax check only; no Go was built or run, live Go tests are not approved). - The attach-mode
autoexemption: traced theelifguard and the--planemit in install.sh, and readTestAttachModeWithNoBinaryAllowsAutoAndRefusesOtherNamesagainst thenoBinaryEnvhelper (PATH andCONTEXT_GURU_DESToverridden,CONTEXT_GURU_BIN=empty). - The re-anchored floor test: checked the file assertions and that
config.LoadBytes/Resolved()are the proxy's own code path, so the test fails if the proxy changes the floors. - The merges: listed every commit between my last reviewed head and the new head, read both merge diffs, and diffed the PR against the new base to confirm no unreviewed content rides in.
- I did not run the Go tests (live tests not approved; Go is not on this machine). The author's round-1 report covers the box runs; this round's commits are small and I verified them by reading and a Python syntax check.
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 | 65d5651406c4 |
approve |
Verdict: approve
Findings
None. The three new commits fix my round-2 notes, and the two merges bring main in without breaking this PR's code. I found no new defect.
New commits, and what they do
32e47671fix(plugin): keep settings.py parseable on Python 3.9 — good, and it fixes my round-2 note. The old warning line used a double quote inside an f-string, which is a syntax error before Python 3.12. The new code uses a plain variable. It also strips the false "; nothing was changed" clause from thepreset_uncheckedwarning, which was my round-2 note. I checked the final code at HEAD: the strip runs before the message is built, andremovesuffix(Python 3.9+) is gone from all plugin scripts. I scannedsettings.py,insights.py,statusline.pyandcg.pyfor the same nested-quote shape: none left.5d3a7b3atest(plugin): re-anchor the tool-wait floor test — good. The plugin now writescache: strategy: auto, so the old test's "the file states 80000" was wrong. The new test checks the file names the strategy and pins no floor, then loads it withconfig.LoadBytesand asserts 80000 / 20000. I traced it:_render_strategyends the file withcache:\n strategy: auto\n(theHasSuffixcheck matches),applyStrategyfills 80000 from the table, and the tool-wait floor comes from the default. Newconfigtests pin both floors to their defaults.335894c4fix(plugin): allow auto in attach mode with no local binary — good, and it fixes my round-2 note. This is an owner decision, named in the commit and in the PR body. Attach mode installs no binary, so a name cannot be checked.auto(the plugin's own default) andnonenow pass unchecked; any other name is still refused withreason=strategy_unchecked.--planfollows the same rule. I read the guard at HEAD: theelifadds only theautoexception, the refusal text and exit codes are unchanged, and the local-mode late check still validates every name (includingauto) once the binary is installed. The new test traces correctly, and its helpers and flags exist.82aa98fcand65d56514, merges of main — resolutions verified. Main brought the tool-wait floor work, theself_removedremoval (#584) and the Codex strategies PR (#1051, the new base9d34f00f). I checked the merged files at HEAD:config/strategy.go: the rows are unchanged; only comment andautodesc text moved. The JSON contract the plugin reads (name,providers,spends,desc,cache,presets) is unchanged.config/strategy_test.go: both sides removed the Codex drift test; the merge kept that. Theosimport is still used by the old-form test, and the new floor-pinning tests from main are present.settings.py: keeps this branch's removal of the Python table; main never re-added it.- Provider filtering still works:
_offeredkeeps rows foranthropicorany, so the Codex30-min-pingrow does not appear for this plugin.
Earlier findings and notes, and their status
- Round 1 and 2 blocking findings: still fixed. No commit this round touched the fix code paths except to add the
autoexception, which I verified above. - My round-2 notes: 2 fixed, 3 accepted as-is. The false "nothing was changed" clause: fixed (
32e47671). Attach mode refusing the defaultauto: fixed by owner decision (335894c4). The attach check still runs before--base-urlvalidation: unchanged, diagnostic order only.LEGACY_NAME_ALIASESdrift: unchanged, accepted in round 2. Thewip: test urlcommit title: still in the history. - Reviewer 2's round-2 notes: 1 fixed, 2 as they were. The dead
lines[0] == hereclause in the probe test: gone at HEAD; the assertion now checks thecg-strategies-prefix. A local--planstill emitscache_strategy=<name>next tostrategy_unchecked=true: still true, and the pair is honest. Thewipcommit title: as above.
Non-blocking
- A local
--planwith no binary and--cache-strategy autonow emitscache_strategy=autowith no unchecked flag. The confirming run checks the name after step 1, so the plan claim is true. Note only. - In attach mode with
autoand no local binary, the report emitscache_strategy=autoas a fact while no local file was written (strategy_warning=no_proxy_binary). The remote proxy checks the name when it loads the setting — the owner's recorded reason. I accept it.
What I checked
- Last review: round 2,
b30b7bd2c98ec84e67d6a1bea82f7b3c14d1730d, 2026-11-10T22:45:54Z - New commits read: 5 —
82aa98fcmerge origin/main;32e47671fix(plugin): keep settings.py parseable on Python 3.9;5d3a7b3atest(plugin): re-anchor the tool-wait floor test on the proxy-owned table;335894c4fix(plugin): allow auto in attach mode with no local binary;65d56514merge origin/main (new base9d34f00f, the merged Codex PR #1051) - Read in full: 4 reviews, 1 comment, 0 inline comments (from the three files in my folder)
- New items since my last review and what I did:
- Reviewer 2's round-2 review (2026-11-10T22:46:48Z, approve, 3 non-blocking) — checked each note against the code at HEAD; statuses above.
- The 5 new commits — read every full diff and the merged files around each hunk.
- The PR body's new attach-mode rule — matched it against the code.
- Verified
335894c4at HEAD: the attachelifadds only theautoexception; the plan emit excludesautofromstrategy_unchecked; the local-mode late check at line 1064 still checks every name once a binary exists; the new test's helpers (runRoute,noBinaryEnv) and flags (--no-health-check,--i-consent-to-traffic-interception) all exist. - Verified
32e47671at HEAD: the warning strip runs before the emit, and a scan of all four plugin scripts found no pre-3.12-illegal nested-quote f-string.ast.parseis clean on the local Python. - Verified
5d3a7b3aat HEAD:_render_strategyoutput matches the test'sHasSuffix;config.LoadByteson that file resolves 80000 / 20000, pinned byTestStrategiesPinTheGeneralFloorToTheDefaultandTestToolWaitMinPrefixDefaultAndOverride. - Verified the merge resolutions:
config/strategy_test.go(both drift tests removed,osimport used, main's new tests kept),config/strategy.go(rows unchanged, JSON contract unchanged),settings.py(table removal kept), provider filtering (_offered,not_offered). - Checked that no PR doc or skill text still says attach mode refuses
auto. - I did not run the Go tests (live tests not approved; Go is not on this machine). I ran only local Python syntax and text scans.
The Pi drift guard read STRATEGIES from the Claude Code plugin's settings.py. This PR removes that table, so the guard failed with a KeyError in CI (TestPiControllerPythonTests). Move the guard to a Go test in pi-package. It dumps pi_plugin.STRATEGIES with python3 and compares each name's spends flag and cache keys with config.Strategies, which is the table the proxy owns. The Python test that read settings.py is removed. No product code changes. Three stale comments and one test message that named the removed Python table now name the proxy table. Refs #980 Assisted-By: Claude Opus 5.5 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 | 4 of 4 | d1ff1e5618b6 |
approve |
Verdict: approve
Findings
None. The one new commit is a test move, and I found no defect in it.
The new commit, checked
d1ff1e56 test(pi): check the Pi strategy table against the proxy table — correct.
- What it does: this PR removed
STRATEGIESfromsettings.py, so the old Pi drift guard (a Python test that ransettings.pyand readm['STRATEGIES']) fails in CI with aKeyError. The commit deletes that Python test and addspi-package/strategies_test.go, a Go test that dumpspi_plugin.STRATEGIESwithpython3and compares each name'sspendsflag and cache keys withconfig.Strategies. No product code changes. - The CI-failure claim is right:
settings.pyno longer definesSTRATEGIES, sorunpy.run_path(...)['STRATEGIES']raisesKeyError. - I verified the guard passes: I ran the test's dump snippet with the local python3. The Pi table (
none,auto,1-ping,2-ping) matches the proxy table on every key and value, includingspends.nonecompares two empty key sets. - The test is wired like its neighbours: package
pipackagematchespi_test.go, the dump's relativescriptspath matches howTestPiControllerPythonTestsalready runs python3 from the package directory, and a missing python3 is a fatal, not a skip (the comment says a skip would prove nothing). - The comparison is sound: same key count plus a per-key marshal compare catches a changed value, a missing key and an extra key on either side (
json.Marshal(nil)isnull, never a proxy value). - The three comment fixes and the one test-message fix name the proxy table where they named the removed Python table. I grepped the repo for other references to a plugin-local
STRATEGIES: none left (thebob-pluginconstant is that plugin's own, unrelated).
Earlier findings and notes, and their status
- All blocking findings from rounds 1 and 2: still fixed. The new commit touches no product code path.
- My round-3 non-blocking notes: unchanged, still accepted (the local-plan
cache_strategy=pair;LEGACY_NAME_ALIASESdrift; thewip: test urlcommit title). - Reviewer 2's round-3 review (approve, no findings): I checked its four per-commit claims myself in my round-3 review of the same commits. I agree with its verdict and add nothing.
Non-blocking
- The new guard checks one direction only: every Pi strategy must exist in the proxy table. A strategy the proxy adds and Pi lacks is not caught. The old Python test had the same direction, so this is no loss. Note only.
- The dump runs
python3 -cwithout-I. It imports only repo files frompi-package/scripts, andTestPiControllerPythonTestsalready runs python3 the same way. No change asked.
What I checked
- Last review: round 3,
65d5651406c44b9cd830e14fdfa56b7428e3b7c0, 2026-11-11T05:51:15Z - New commits read: 1 —
d1ff1e56test(pi): check the Pi strategy table against the proxy table - Read in full: 6 reviews, 1 comment, 0 inline comments (from the three files in my folder)
- New items since my last review and what I did:
- Commit
d1ff1e56— read the full diff and every changed file around the changes. - Reviewer 2's round-3 review (2026-11-11T05:49:27Z, approve) — new to me this round; its claims cover the same three commits and two merges I verified myself in round 3, so nothing new to check beyond the confirmation above.
- No new author comment and no inline comments.
- Commit
- Ran the new test's python3 dump snippet locally and compared its output with
config/strategy.goby hand (Python only; no Go was built or run, live Go tests are not approved). - Checked the package name, the relative
scriptspath and the python3 requirement against the existingpi-package/pi_test.go. - Grepped the repo for leftover references to the removed
STRATEGIEStable insettings.py. - Confirmed the PR-wide diff against the base
9d34f00fis the round-3 state plus this one commit (22 files; the only new file ispi-package/strategies_test.go).
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 | d1ff1e5618b6 |
approve |
Verdict: approve
Findings
None. The one new commit is a test move with comment fixes, and it is correct.
The new commit, checked
d1ff1e56 test(pi): check the Pi strategy table against the proxy table — correct.
- The CI-failure claim is right. The old guard (
test_strategies_match_the_claude_code_plugininpi-package/scripts/test_pi_plugin.py) ranrunpy.run_pathonsettings.pyand readm['STRATEGIES']. This PR removed that table, so the test raisesKeyError.TestPiControllerPythonTests(pi-package/pi_test.go:12) runs the Python tests in CI, so the branch was red. The commit deletes the test and moves the guard. - The new guard is sound.
pi-package/strategies_test.godumpspi_plugin.STRATEGIESwithpython3 -cand compares each name withconfig.LookupStrategy. I verified the comparison shape:LookupStrategyexists in config/strategy.go:147 and returns the row withSpendsandCache []StrategyKey. The test checksspends, the key count, then every key's marshalled value. A missing pi key givesjson.Marshal(nil)=null, which never equals a proxy value, so a changed value, a missing key and an extra key are all caught. - The guard passes today. I ran the test's dump snippet with the local python3 from
pi-package/: the Pi table (none,auto,1-ping,2-ping) matches the proxy table on every key and value, includingspends.nonecompares two empty key sets. The numbers marshal equal on both sides (0.5,240,80000,3540). - The wiring matches its neighbours. Package
pipackage, the relativescriptspath, and thepython3requirement all matchpi_test.go.jsonandsubprocessare still used elsewhere intest_pi_plugin.py, so the removed test leaves no dead imports. - No product code changes. The
pi_plugin.pyandsavings.jshunks are comments only. I grepped the repo for references to the removed plugin table (settings.py STRATEGIES,m['STRATEGIES'], the old test name): none left. - The PR diff against the base
9d34f00is the round-3 state plus this one commit (22 files; the only new file ispi-package/strategies_test.go). Nothing unreviewed rides in.
Reviewer 1's round-3 and round-4 reviews, checked
- Round 3 (approve): their per-commit claims match what I verified myself in my round-3 review of the same commits. I agree and add nothing.
- Round 4 (approve): their check of
d1ff1e56matches mine above. Their two non-blocking notes (one-direction guard,python3without-I) are right; I agree with both. The one-direction note is no loss: the old Python test iterated Pi's table only, same direction.
Earlier findings and notes, and their status
- All blocking findings from rounds 1 and 2: still fixed. This commit touches no product code path.
- My round-3 non-blocking notes: unchanged and still accepted (the local-plan
cache_strategy=pair; thewip: test urlcommit title).
Non-blocking
- The new test makes a missing
python3a fatal failure, while its neighbourTestPiControllerPythonTestsskips. The comment in the test says a skip would prove nothing, so this is deliberate. Note only. - The guard checks one direction: every Pi strategy must exist in the proxy table. A proxy strategy Pi lacks is not caught. The old test had the same direction. Note only.
What I checked
- Last review: round 3, 65d5651, 2026-11-11T05:49:27Z
- New commits read: 1 —
d1ff1e56test(pi): check the Pi strategy table against the proxy table - Read in full: 6 reviews, 1 comment, 0 inline comments (from the three files in my folder)
- New items since my last review and what I did:
- Commit
d1ff1e56— read the full diff and every changed file around the changes. - Reviewer 1's round-3 review (2026-11-11T05:51:15Z, approve) — their claims cover the commits I verified myself in round 3; nothing new to check.
- Reviewer 1's round-4 review (2026-11-11T06:29:48Z, approve) — same commit as mine; I verified each of its claims myself above.
- No new author comment and no inline comments.
- Commit
- Verified
LookupStrategy, theStrategy/StrategyKeytypes and the table rows inconfig/strategy.goagainst the test's field use. - Ran the test's python3 dump snippet from
pi-package/on this machine and compared its output with the proxy table by hand (Python only; no Go was built or run, live Go tests are not approved). - Checked the removed Python test's imports against the rest of
test_pi_plugin.py, and grepped the repo for leftover references to the removedSTRATEGIEStable. - Confirmed the PR-wide diff against the base
9d34f00fis the round-3 state plus this one commit.
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]>
…py of the table (#1113) The Pi package reads the cache strategies from the proxy's table (`context-guru-proxy strategies`) and keeps no copy, like the Claude Code (#1055), Codex (#1051), OpenCode and Bob (#1093) plugins. - STRATEGIES is removed from pi_plugin.py; the TypeScript extension gets its list from `configure --list`. The consent question uses the proxy's text. - The probe follows #1055/#1051: a 5-second limit, the scrubbed environment, DASHBOARD=0, LISTEN_ADDR=127.0.0.1:0, an empty CONFIG, closed stdin and a fresh temp cwd. Bad output gives a clean error. - Pi offers a strategy only when it serves both providers it routes (tagged any, or anthropic and openai). A proxy older than v0.7.1 gets the update hint; none always works. - pi-package/strategies_test.go is gone: Pi has no table to pin. Behavior change: Pi users. Old: the package used its own table. New: it reads the proxy's table. With the tag fix (#1115), Pi offers none, auto, 1-ping and 2-ping on a v0.7.4 proxy. Owner's decisions, 2026-11-11 (issue #1062: no fallback, provider tags, generic texts) and 2026-11-12, in the integrator session: "since Pi is new and there is no user base, u can just do a, u dont even need to require it. just assume that this is the defacto" (no version gate; ships with #1115). Data dependence: none. Row: docs/data-dependence/features/pi-proxy-check.md. Fixes #1062. Reviews: 3 offload review rounds (GLM). Round 3: both approve at cc6e1bc, which is the PR head. It covers the merge of main (only the generated docs/data-dependence.md, rebuilt with cmd/gen-datadep) and the fix for a CI-only failure: the consent question printed an empty "What it does, from the proxy:" when no proxy binary was found. Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
Behavior change: the strategy commands need a proxy of v0.7.1 or later.
strategy list,strategy set(exceptnone) andstrategy showof a name now ask the proxy (context-guru-proxy strategies). An older binary gets this message: "update the proxy to v0.7.1 or later (/context-guru:update)". There is no fallback table. This is the owner's decision.preset setstill saves the choice when no proxy can list presets (no binary, or one older than v0.7.1). It printswarning=preset_unchecked. The check against the proxy'spresetslist runs when a proxy can answer.preset listfalls back to the plugin's short list with the same warning. This is the owner's choice.strategy set --name noneworks with any binary.auto(the plugin's own default) andnoneinstall unchecked, because the remote proxy checks the name when it loads the setting. Any other name is refused withreason=strategy_unchecked.--planfollows the same rule./context-guru:update.docs/data-dependence.mdstays as it is.Release note: The Claude Code plugin now reads the cache strategies from the proxy. Update the proxy to v0.7.1 or later to list or change a strategy.
Refs #980. Follow-up 1 (Claude Code plugin). The Codex plugin is a separate PR.
Summary
anthropicorany.30-min-pingdoes not appear.cache: strategy: <name>. The proxy fills in the keys.spendsflags, the defaultautoand the alias5-min-pingstay the same.What changed
settings.pycontext-guru-proxy strategieswith a 5 s time limit andLISTEN_ADDR=127.0.0.1:0(feat(opencode): OpenCode plugin for context-guru #483: a v0.7.0 binary ignores the word and serves). "No valid JSON" means an old binary. Every bad answer (garbage, not an object, wrong types, bytes that are not UTF-8) gives the same advice.DASHBOARD_*,SESSION_STATE*,CONTROL_DB,UPSTREAMS,CG_RECORD_*,ARCHIVE_*(ARCHIVE_REMOTEuploads data),STOREandIDLE_EXIT, and setsDASHBOARD=0. It runs in a fresh empty temp dir.--bin,CONTEXT_GURU_BIN, PATH, then~/.local/bin. A named path that exists but is not executable is an error. It does not fall through to PATH.CONTEXT_GURU_STRATEGIES_TIMEOUT(seconds) sets the limit. It is a test and debug setting.strategy listprints only the offered strategies.strategy setrefuses others (reason=not_offered).preset list/set/restart: a proxy that answers and lacks a picker preset givesreason=preset_unknown_to_proxy. With no proxy that can answer, they warn and go on as before.install.shreads names, aliases andspendsfromstrategy list.noneorautois refused withreason=strategy_uncheckedand the advice to install proxy v0.7.1+ or use--cache-strategy none.--planwith no binary reportsstrategy_unchecked=true.strategy syncrenames an oldstrategy=5-min-pingmarker toauto(the marker name only).strategy showmaps it locally.cache-strategy-pickerskill: no table. It runsstrategy list. It documentsproxy_too_old,no_proxy_binaryandproxy_unrunnable.config/strategy_test.go(Claude Code part only): removedTestStrategyTableMatchesPlugin, addedTestEveryStrategyHasTheSameEffectiveConfigAsItsOldKeys. The Codex test is untouched.docs/how-to/install-plugin.md: the proxy owns the strategies. A new-form file needs proxy v0.7.1+, so do not downgrade the proxy after you switch strategy.Same effective config
config/testdata/cc-old-strategy-files/holds the files the old plugin wrote forauto,1-ping,2-ping,1-hour-head.Resolved()of the old file equalsResolved()ofcache: strategy: <name>. Mutating the Go table makes it fail.strategy: 2-pingfile:keepalive=true keepalive_idle_seconds=240 keepalive_max_pings=2.Existing strategy files
strategy syncmoves only theirpreset:line (and an old alias name in the marker). It does not call the binary.strategy setwrites the new form.How it was tested
go vetandgo test -racefor./config/...and./context-guru-plugin/....--plan; bad proxy output (garbage, list, string, non-UTF-8, bad aliases, bad presets); the probe env and cwd;presetwith no proxy; non-executable named binary; alias marker rename. Each has a mutation that fails it.Open questions
config/strategy_test.go. This PR changes only the Claude Code part. Expect a small merge conflict in that file.🤖 Generated with Claude Code