Repository navigation
feat(config): named cache strategies in the proxy config - #987
Merged
Merged
Conversation
Add cache.strategy (none, auto, 1-ping, 2-ping, 1-hour-head) with one table in config/strategy.go. A key set in the file wins over the strategy. Add `context-guru-proxy strategies` to print the table as JSON. A drift test pins the table to settings.py. Closes #980 Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Add 30-min-ping (openai), a providers field on each row, and the preset list in `strategies` output. Add a drift test for the Codex plugin. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
amiddavid
commented
Nov 9, 2026
amiddavid
left a comment
Collaborator
Author
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.319 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 2 | b57d4c9b2fe0 |
blocking |
Verdict: blocking
Findings
- docs/data-dependence.md:136 — the PR adds named cache strategies but does not update the data-dependence table
- What fails: the doc tells a user "Find your preset and your cache strategy below". The cache-strategy table lists only
none,5-min-pingand1-hour-head. After this PR the proxy accepts 6 names.auto(the plugin default),1-ping,2-pingand30-min-pinghave no row.5-min-pingis now only an alias, and no picker shows it. The ping strategies and30-min-pingspend the caller's credential and need the stored request bytes, the same class as the5-min-pingrow, so a row is meaningful for each. - Proof:
git diff 569c609b..HEADtouches 5 files; docs/data-dependence.md is not one of them. The table is at docs/data-dependence.md:138-142. CLAUDE.md, "Metadata first": every PR that adds or changes a feature states its data dependence and updates docs/data-dependence.md. - Fix: add rows for
auto,1-ping,2-pingand30-min-ping(or one row for the ping family), rename the5-min-pingrow toautoand note the alias, and name a "Decided by" person for each new row. State the feature's data dependence at the top of the PR.
- What fails: the doc tells a user "Find your preset and your cache strategy below". The cache-strategy table lists only
Non-blocking
- config/strategy_test.go:20 —
TestStrategyTableMatchesPluginfails, not skips, when python3 is missing. Sogo test ./config/...fails on a machine without python3. The comment says a skip would prove nothing. Fine as a choice; worth a line in CONTRIBUTING.md. - cmd/context-guru-proxy/main.go:78 — the comment says "
--jsonis accepted and changes nothing". The branch ignores every argument, not only--json. - docs/how-to/cache-keepalive.md:75 and config/config.go:92 — the lists of strategy names omit
30-min-ping, which the table and thestrategiescommand now return. - config/strategy.go:164 — a key set to null counts as "set". Example:
strategy: 1-pingpluskeepalive_max_pings:(no value) skips the fill, andResolved()then gives K=2, not 1. Arguable; document it or treat null as unset. - cmd/context-guru-proxy/main.go:76 — before this PR,
context-guru-proxy strategiesstarted the proxy (flag parsing stops at a positional arg). Now it prints the table and exits. Same shape asimport-history; name it in the PR per the behavior-change rule.
What I checked
- The full diff 569c609..HEAD, both commits, and the code around each change (config/config.go, cmd/context-guru-proxy/main.go, docs).
- Every strategy key exists as a
cache:field inCacheConfig, so theKnownFields(true)decode of the filled keys cannot reject a table row. LoadBytesorder: the strategy fills run beforeCache.validate(), so a filled value is validated.2-pingsetskeepalive_max_pings_1h: 2, under the cap of 3 (internal/modelinfo/cachefrac.go:30). Idle values 240 and 3540 pass the lifetime checks.1-hour-headsets the deprecatedhead_ttl_min_tokens: 50000.Resolved()turns that into 200,000 bytes, the same as the default gate, so the row behaves as its desc says.- Preset interplay: a preset document cannot declare
cache:(theKnownFieldsguard inapplyPreset), so a strategy and a preset cannot fight over the same keys. - tenant/configmigrate.go rewrites raw YAML nodes, not the decoded
Config, so strategy-filled keys are not frozen into stored tenant configs. - I ran the
pyDumpscript from strategy_test.go against context-guru-plugin/scripts/settings.py (python3, read-only). Default, alias and all 5 rows match the Go table in name, order, spends, desc and key values. The Go table adds only30-min-ping, soTestStrategyTableMatchesPluginshould pass. I did not run the Go test itself. - I checked every string
TestStrategyTableMatchesCodexPluginpins in codex-marketplace/plugins/context-guru/scripts/codex_plugin.py and skills/cache-strategy-picker/SKILL.md: all present. - Fail-open: config errors refuse to load at startup, the existing strict-loader contract. No request-path change is in this PR.
- No Go builds or tests were run; live tests are not approved.
amiddavid
commented
Nov 9, 2026
amiddavid
left a comment
Collaborator
Author
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.319 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 2 | b57d4c9b2fe0 |
approve |
Verdict: approve
Findings
None.
Non-blocking
- config/config.go:92, config/strategy.go:12, docs/how-to/cache-keepalive.md:75 — all three name lists say the table holds
none, auto, 1-ping, 2-ping, 1-hour-head. Commit 2 added30-min-pingas a sixth row but updated no list. An operator who reads only the doc cannot learn thatstrategy: 30-min-pingexists. Fix: add the name to the three lists. - config/strategy.go:147 (
30-min-ping) — the row sets onlykeepalive: true. On a proxy that also serves Anthropic sessions, that turns the Anthropic keep-alive on too (240 s idle, 2 pings, 20k prefix floor), not just the OpenAI one.Providers: ["openai"]is documented as advisory, and this is the exact file the Codex plugin writes today, so the strategy adds no new behavior. Worth a sentence in the row'sDesc. - config/strategy.go:117 (
1-hour-head) — the row sets the deprecatedhead_ttl_min_tokens: 50000, nothead_ttl_min_bytes: 200000. It resolves to the same 200000-byte gate (CacheConfig.Resolved), so behavior is right. The deprecated key is kept for byte parity with the plugin table, which must run on older proxies. Fine, but the proxy's own table could use the current key. - Settings-form interaction (config/form.go) —
CacheFormdoes not modelstrategy, so the key survives a settings save (unknown keys are preserved), but the save also writes the strategy's current values as explicit keys, becausecacheFormrenders the strategy-filled config. A later hand-edit of the strategy name then keeps those frozen keys, since an explicit key wins. This follows the documented rule ("a key the file sets itself always wins"), and the plugin manages its strategy files by marker, not through the form. No change asked; noted so the behavior is known. - config/strategy_test.go:30 — the drift test hard-fails when
python3is missing (no skip, by stated design). This is an established pattern in this repo (context-guru-plugin/*_test.go,deploy/harbor/*_drift_test.goalready exec python3), and CI's ubuntu runners carry it. No change asked.
What I checked
- Read the full diff (
git diff 569c609b..HEAD, both commits) andCLAUDE.md,docs/design.md. applyStrategylogic: early-out on empty name, alias resolution, unknown-name error, the "explicit key wins" rule via a second non-strict unmarshal intomap[string]yaml.Node, the marshal/re-decode fill withKnownFields(true). Checked that yaml.v3 leaves untouched struct fields alone on partial decode, that every key in the table exists onCacheConfig, and that all filled values passCacheConfig.validate(idle 240 < 300, idle 1h 3540 < 3600, pings 1h 2 ≤ cap 3, head gate 50000 within bound).- Order of operations in
LoadBytes: preset, mode, strategy, validate. Rich presets cannot declarecache:(theKnownFieldsscratch-struct guard), so preset + strategy cannot fight. - Callers of
LoadBytes/Load(proxy main, adaptctl, cg-transcript-replay, form, Validate): all get the strategy applied consistently; no path parsescache:outside it. - Settings-form round trip (
config/form.go):ApplyFormpreserves unknown keys, sostrategy:survives a save;cacheFormrenders resolved values;formbugs_test.goreflects overCacheForm(notCacheConfig), so the new field breaks nothing. - Tenant config migration (
tenant/configmigrate.go): rewrites onlyextract_llm/extract_llm_sweep, nevercache:. - Drift tests: read
context-guru-plugin/scripts/settings.py(STRATEGIES, DEFAULT_STRATEGY, STRATEGY_ALIASES) and compared every row, key, value and desc against the Go table — they match, count checkpy 5 + 1 = go 6holds, and the positional comparison is valid because the Codex row is last. Verified theast-based pyDump execs only the three assignments, in file order, soSTRATEGIES's reference toDEFAULT_STRATEGYresolves. - Codex drift test: verified the pinned strings exist in
codex_plugin.py(choices=("none", "30-min-ping"), the 8-space-indented"cache:\n"/" keepalive: true\n"pair) and that the 30-min-ping desc appears in the pickerSKILL.mdafter whitespace normalization. StrategiesJSON: deterministic (sorted maps),SetEscapeHTML(false)keeps>=/<=readable, presets come fromPresetNames().- The
strategiessubcommand incmd/context-guru-proxy/main.go: dispatches before flag parsing, read-only, exit 0/1; mirrors theimport-historypattern above it. - Behavior-change rule: no
strategykey means nothing runs (tested byTestNoStrategyChangesNothing); the feature is opt-in, so no existing config changes behavior. - Live tests were not run (not approved); this review is read-only.
Document the strategies in data-dependence.md. Add 30-min-ping to the name lists. Say in its desc that keepalive: true also turns on the Anthropic keep-alive. Document null keys. Fix the subcommand comment. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
Collaborator
Author
|
Round 1 reply. New head Reviewer 1
Reviewer 2
Tests on the box: |
amiddavid
commented
Nov 9, 2026
amiddavid
left a comment
Collaborator
Author
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.319 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 2 | df2c4b7cc5ee |
approve |
Verdict: approve
Findings
None.
Earlier findings
- Reviewer 1, round 1, finding 1 (data-dependence table): fixed in df2c4b7. docs/data-dependence.md:138-146 now has a row for
auto(with the5-min-pingalias noted), one row for1-ping/2-ping/30-min-ping, and1-hour-head, plus a "Decided by" column. The PR body states the data dependence at the top, as the rule asks. I checked the attribution: issue #569 is the issue that created that doc, opened by amiddavid, so "David Amid, #569" is accurate. - Reviewer 1, round 1, non-blocking: name lists fixed (config.go, strategy.go, how-to); subcommand comment fixed; null-key rule documented in strategy.go and the how-to, with no behavior change, which is what I asked for; the old
strategiesinvocation behavior is named at the top of the PR body; the python3 hard-fail is kept with a reason — I verified the reason:context-guru-pluginhas 8+ test files that exec python3, so the pattern is established. Accepted. - Reviewer 2, round 1 (approve, 5 non-blocking notes): name lists and the
30-min-pingdesc fixed. Thehead_ttl_min_tokenskey is kept for byte parity with the plugin table; I verified in round 1 that it resolves to the same 200,000-byte gate, so the reason stands. The settings-form freeze is kept under the documented "a key in the file wins" rule; reviewer 2 asked for no change. Accepted.
Non-blocking
- docs/data-dependence.md:143 — the combined row says
1-ping,2-ping,30-min-ping"differ only in how many pings and when".30-min-pingalso targets OpenAI and leaves the Anthropic keys at proxy defaults rather than theautovalues. The storage-level claim in the row is right, so this is wording only. - docs/data-dependence.md:146 — the note under the table cites
config/strategy.go. The rows themselves keep their plain-word reasons, so the rule ("the reason in plain words, not a code reference") holds; the citation is a pointer, not the reason. - The reply says the "Decided by" owner must confirm before merge. David Amid is the PR author, but the confirmation is the merge gate's to enforce, not this review's.
What I checked
- Last review: round 1, b57d4c9, 2026-11-09T16:36:37Z.
- New commits read: 1 — df2c4b7 "fix(config): address round 1 of the strategy review". Full diff read (
git diff b57d4c9b..HEAD, 6 files), plus the final state of each changed region. - Read in full: 2 reviews, 1 comment, 0 inline comments (the inline list is empty), from the three saved files; also the PR body, to verify the author's two claims about it.
- New items since my last review: reviewer 2's round-1 review (checked each of its 5 notes myself), the author's round-1 reply (mapped every item to a fix or a reason), commit df2c4b7, and the PR body.
- The
30-min-pingdesc change cannot breakTestStrategyTableMatchesPlugin: that test compares only the 5 settings.py rows (indices 0-4), and30-min-pingis row 6 in the Go table. - The updated Codex test splits the desc at the first ". ". I checked the desc: the first ". " falls after "quota", the picker part is the old desc, and the normalized SKILL.md contains it (verified in round 1).
strings.Cutneeds Go 1.18+; the repo is Go 1.26. - The data-dependence table renders as a 5-column table with 5 columns in every row.
- The null-key and name-list doc changes match the code behavior (
applyStrategychecks key presence in the raw document; the fill skips a present key). - No Go builds or tests were run; live tests are not approved.
amiddavid
commented
Nov 9, 2026
amiddavid
left a comment
Collaborator
Author
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.319 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 2 | df2c4b7cc5ee |
approve |
Verdict: approve
Findings
None.
Round-1 findings, re-checked
Mine (all non-blocking in round 1):
- Name lists missed
30-min-ping— fixed.config/config.go:92,config/strategy.go:16anddocs/how-to/cache-keepalive.md:77now name it. 30-min-pingdesc said nothing about the Anthropic keep-alive — fixed. The desc adds the sentence aboutkeepalive: trueturning on the Anthropic keep-alive with the proxy defaults. The Codex drift test was updated correctly: it cuts the desc at the first". "and compares only the picker part withSKILL.md. I verified there is no earlier". "in the desc, and that the picker part is present in the whitespace-normalizedSKILL.md(the text wraps across lines 8-9 there, which is why the test normalizes).1-hour-headuses the deprecatedhead_ttl_min_tokens— author kept it, reason accepted. The reason is right and stronger than stated: the drift test compares the Go row againstsettings.pykey by key, and the plugin's row uses the deprecated key, so the Go table cannot switch tohead_ttl_min_byteswithout breaking the pin. Behavior is identical (Resolved()maps 50000 tokens to the 200000-byte gate).- Settings-form freeze of strategy values — author kept it, reason accepted. It follows the documented rule that a key in the file wins.
- Drift test hard-fails without python3 — author kept it, reason accepted. I verified the precedent myself in round 1 (
context-guru-plugin/*_test.go,deploy/harbor/*_drift_test.go).
Reviewer 1's:
- Blocking: data-dependence rows missing — fixed.
docs/data-dependence.md:137-143now hasnone,auto(with the5-min-pingalias noted), one family row for1-ping/2-ping/30-min-ping, and1-hour-head, each with a "Decided by" entry (David Amid, #569, the author of the original rows). The storage claims are accurate: every ping strategy needs the stored request bytes,1-hour-headkeeps nothing. The PR body states the data dependence at the top and says the PR changes none — I read the body and the claim matches the diff (the strategy only fills existing config keys; nothing new is stored). - Name lists — fixed, same as mine.
- Subcommand comment — fixed (
cmd/context-guru-proxy/main.go:78now says all further arguments are ignored). - Null key counts as set — fixed by documentation, no behavior change. The RULES comment in
config/strategy.goand the how-to line are accurate: a null value decodes to the zero value, the row does not fill it, andResolved()applies the library default. - Old
strategiessubcommand behavior named in the PR — verified present at the top of the PR body. - python3 hard-fail — kept, reason accepted (same as my item 5).
Non-blocking
- docs/data-dependence.md:141 — the family row says
1-ping,2-ping,30-min-ping"differ only in how many pings and when".30-min-pingalso differs in the prefix floor: it sets onlykeepalive: true, sokeepalive_min_prefix_tokensstays at the 20000 default, whileauto/1-ping/2-pingset 80000. The storage claim of the row is unaffected. Optional: drop "only" or name the floor difference.
What I checked
- Last review: round 1, b57d4c9, 2026-11-09T16:38:03Z.
- New commits read: 1 —
df2c4b7cfix(config): address round 1 of the strategy review. - Read in full: 2 reviews, 1 comment, 0 inline comments (from
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt). - New items since my last review, and what I did about each:
- Reviewer 1's round-1 review (posted 16:36:37Z, before mine; read now in full for the first time). Its blocking finding is the data-dependence table; checked the fix against it, see above. Its non-blocking items overlap mine plus the null-key and subcommand-behavior points; all addressed or kept with a reason I verified.
- The author's round-1 reply (16:41:42Z). Every claim in it checked against the diff and the PR body: name lists, desc change, data-dependence rows with the Decided by column, null-key documentation, subcommand comment, and the two PR-body statements (behavior-change note, data-dependence line) — all present and accurate.
- The fix commit
df2c4b7c(6 files). Read the full diff and each changed file around the change:docs/data-dependence.mdsection in place, the updatedTestStrategyTableMatchesCodexPlugin(thestrings.Cutsplit point, theSKILL.mdnormalization, the added-sentence assertion), the RULES comment, theapplyStrategypresence comment, and the two name lists.
- The fix commit adds no code-path change: only comments, doc text, one desc string, and a test adjustment. The Go table still has 6 rows, so the drift-test count check (
py 5 + 1 = 6) still holds, and the first 5 rows are untouched, soTestStrategyTableMatchesPluginis unaffected by the desc change (row 6 is not compared againstsettings.py). - Live tests were not run (not approved); this review is read-only.
Collaborator
Author
|
Owner confirmation (David Amid), in the opencode-review session, 2026-11-09:
|
amiddavid
added a commit
to AIMikav/context-guru
that referenced
this pull request
Nov 9, 2026
- Remove the plugin's own copy of the strategy table. Read it with "context-guru-proxy strategies" (from rossoctl#987). There is no fallback for an older binary: the plugin logs an error that says to update. - Run the command with a loopback port 0 and a 5 s limit. An older proxy treats the word as an argument and starts serving. - Offer only strategies whose providers match a routed provider. The default is the proxy default. An unfit default runs none. - Write "cache.strategy: <name>" to proxy.yaml. The proxy fills the keys. - Pin the download to v0.7.1, the first release with "strategies". - Tests: fake table, provider filter, old-binary error, kill at the limit. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
This was referenced Nov 10, 2026
amiddavid
pushed a commit
that referenced
this pull request
Nov 10, 2026
Adds an OpenCode plugin (opencode-plugin/). It installs the proxy, routes OpenCode's Anthropic and OpenAI providers through it, and adds status, install, update, uninstall, preset and cache-strategy commands, with native pickers in the terminal app. It reads the cache strategies from the proxy (context-guru-proxy strategies, #987), so it needs proxy v0.7.1 or later. It started as Anamika's work in this PR; the takeover commits are on top of hers. Status: experimental. The README lists OpenCode (experimental) and says why: the plugin is new, and a real OpenCode ran it once. Behavior change: the plugin always starts the proxy with content capture off (--dashboard-content=false and DASHBOARD_CONTENT=0), even when DASHBOARD_CONTENT is set in the environment. It affects OpenCode plugin users who set DASHBOARD_CONTENT. Before, the proxy followed the environment. The owner approved this on 2026-11-10. Data dependence: the plugin keeps only its own metadata (ports, pids, paths, a hash of the project path). It stores no message text. Real test: OpenCode 1.19.5 in a throwaway HOME, proxy v0.7.1, the plain gateway as upstream. A request through the proxy returned 200, with the real OpenCode session id in the dashboard DB, and content_capture=false with DASHBOARD_CONTENT=1 set. Preset and strategy switches, uninstall and fail-open worked. The native pickers open from the ctrl+p palette ("Context Guru"). /context-guru-preset and /context-guru-strategy are the chat commands only, so each slash name shows once (owner decision, option A, 2026-11-10; checked in the real TUI at 6244d0c). Owner's yes, 2026-11-10, in the integrator session: reviewer 2's round-4 finding rejected ("no one used opencode before. it is still in development and testing"). DCO: commit d21ea6d (Anamika) has no Signed-off-by; the owner accepted the risk, 2026-11-10, in the integrator session ("483 c"). Reviews: offload round 4 at f2bc703: reviewer 1 (GLM) approve; reviewer 2 (GLM) blocking, rejected by the owner. Reviews: offload round 5 at 6244d0c (the option A delta only, 1 reviewer at the owner's request): reviewer 1 (GLM) approve, no findings. Owner's yes, 2026-11-10, in the integrator session, to round 5 with one reviewer: "yes". Signed-off-by: AIMikav <[email protected]> Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5
This was referenced Nov 10, 2026
amiddavid
added a commit
that referenced
this pull request
Nov 11, 2026
) The Codex plugin now reads the cache strategies and presets from the proxy (context-guru-proxy strategies, #987) and drops its own copy. The choices none and 30-min-ping, the texts, the default and the effective proxy config are the same; a Go test compares the whole config. The config file now says strategy: <name>; old keepalive: files are still read. The strategies probe runs the binary with a 5-second limit, with DASHBOARD=0, without every DASHBOARD_*, SESSION_STATE*, CG_RECORD_*, ARCHIVE_*, CONTROL_DB, UPSTREAMS, STORE and IDLE_EXIT variable, and in a fresh temp dir, so an older binary that starts serving cannot open the user's databases. Refs #980. Behavior change: Codex users on a proxy older than v0.7.1 (v0.7.0 included). setup, configure and configure --show now refuse with "update the proxy to v0.7.1 or later"; before, they worked. There is no fallback table. /context-guru:update works on an old proxy. Owner's yes, 2026-11-11, in the integrator session: "u have my yes on both" (the old-proxy error for Claude Code and Codex users, and keeping the old preset behavior). Data dependence: none. Reviews: offload rounds 1-2 with 2 GLM reviewers (findings fixed); rounds 3 and 4 with 1 GLM reviewer, at the owner's request ("this is correct", 2026-11-11, in the integrator session). Round 4 approves at e1177f9 with no findings: it checked the probe scrub against v0.7.0's environment variables and the merge of main. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No behavior change for any
proxy.yamlwithoutcache.strategy: it loads to the same config as before. The new code returns at once whenstrategyis empty. A test pins this.One change to name:
context-guru-proxy strategiesused to start the proxy, because flag parsing stopped at the first positional argument. It now prints the table and exits. This is the same shape asimport-history. Nobody uses it to start the proxy. Who it affects: no one known. To turn it off: not possible, the subcommand is fixed.Data dependence: this PR documents existing strategies. It does not change any feature's data dependence. The rows are in
docs/data-dependence.md.none: works at all three levels. Keeps nothing.auto(alias5-min-ping),1-ping,2-ping,30-min-ping: need stored request bytes (a ping sends the last request again). Off and metadata only: cannot work. Everything: works.1-hour-head: works at all levels. Sends no request of its own and keeps nothing.cache.strategyitself only fills config keys. It stores nothing.Summary
none,auto(default in the plugin),1-ping,2-ping,1-hour-head, and the Codex name30-min-ping. Alias5-min-pingmeansauto.providers:anthropic,openaiorany. The proxy does not enforce it. A picker uses it.What changed
config/strategy.go: the table (keys,spends,desc, copied word for word fromsettings.py), the alias, lookup, andStrategiesJSON.cache.strategy: <name>inproxy.yaml. The proxy fills thecache:keys the file does not set.false. The proxy checks presence in the YAML, not the value.context-guru-proxy strategiesprints the table as JSON.--jsonis accepted too.import-history), and the plugins already run the binary. A new HTTP route needs a running proxy.nonesets no keys. The proxy applies no default strategy itself.30-min-ping(openai) sets onlykeepalive: true, as the Codex plugin writes today. Itsdescis the Codex picker wording.strategiesalso printspresets: every preset the proxy registers (config.PresetNames()). The proxy has no list of the short picker ladder (off ... ultrahigh), so none is added.TestStrategyTableMatchesCodexPlugin) checks the Codex plugin source text: the strategy choices, the config it writes, the picker wording, and that each preset it lists is registered.TestStrategyTableMatchesPlugin) readssettings.pywith python3 and compares every name, alias, default,spends,descand key. It stays until the Claude Code plugin reads the proxy.docs/data-dependence.mdrows,30-min-pingin the name lists, null-key note, comment fix.docs/how-to/cache-keepalive.md.How it was tested
-race,go vet, gofmt clean:./config/...ok (72 s)./cmd/context-guru-proxy/...ok (37 s)./proxy/...ok (518 s)auto: 3 tests faildesc, changedkeepalivevalue) both fail the test.Follow-ups
strategies, with a fallback for an old proxy binary.Open questions
Closes #980
🤖 Generated with Claude Code