Skip to content

fix(pi): write the cache strategy by name and re-render the config before each start - #1049

Merged
amiddavid merged 3 commits into
mainfrom
fix/pi-config-rerender
Nov 10, 2026
Merged

amiddavid merged 3 commits into
mainfrom
fix/pi-config-rerender

Conversation

@amiddavid

@amiddavid amiddavid commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

No behavior change for users: the Pi package has no users yet (decided by the developer, David Amid, 2026-11-10).

Fixes #1044

Summary

  • The Pi package now writes the cache strategy by name for a proxy of v0.7.1 or later. The proxy fills the keys from its own table at each start, so a new release brings new values.
  • An older proxy still gets the literal keys, from Pi's table.
  • restart and update now re-render proxy.yaml from the install record before each start. This is the same rule as the Claude Code plugin's strategy sync.

What we found

What changed

  • render_config(..., by_name): with by_name, it writes cache: / strategy: <name> and no literal keys. Without it, it writes the literal keys as before.
  • How the package detects support: it runs context-guru-proxy --version with a 5-second limit and needs 0.7.1 or later. feat(config): named cache strategies in the proxy config #987 is in v0.7.1 and not in v0.7.0.
    • --version exits before the proxy opens a port. A binary without the flag exits on the unknown flag. So the check never starts a proxy.
    • The package does not run context-guru-proxy strategies. An older binary reads that word as an argument and starts serving.
    • A version it cannot read (a dev build, an error) counts as old. The file then gets the literal keys, which every binary accepts.
  • none writes no cache: block, on any binary. This is the same as today. feat(config): named cache strategies in the proxy config #987 says none sets no keys, so the effect is the same as strategy: none.
  • rerender_config(record, binary): re-renders from the install record (preset, cache strategy, upstreams). It writes only a file with the package marker. It never raises. It reports config=rendered|unchanged|missing|not_owned|invalid_record|failed.
  • restart re-renders inside the restart lock, before the health check. It does this also when the proxy already answers: it does not restart that proxy, but its next start (launchd, systemd, a login) reads the right file. A missing file is not created by restart.
  • update re-renders after it installs the new binary, so the new binary decides the format.
  • setup now resolves the binary before it writes the config. It still refuses a hand-written config before any download.
  • update --check uses the same --version helper, now with a time limit.
  • configure writes the config and the record under the restart lock, so a session-start restart cannot re-render the old record over the new file.
  • docs/data-dependence.md: the Pi session-start row lists what restart now reads and writes. The level stays none.
  • README.md: a new section, "The proxy config". It says that a hand edit inside a file with the marker does not stay.

How it was tested

  • python3 -I -W ignore -m unittest discover -s scripts: 81 tests pass (63 before, 18 new).
    • By name for a new binary, literal keys for an old one, none the same on both, upstream comment lines kept.
    • Version detection with fake binaries: 0.7.1, v0.8.0, 0.7.2-rc1 give by name; 0.7.1-rc1 (a pre-release counts as older than its release), 0.7.0, dev, usage text, a failing binary and a missing binary give literal keys.
    • restart converts an old literal file to the name, keeps literal keys for an old binary, reports unchanged the second time, re-renders when the proxy already answers (no restart), leaves a hand-written file alone, does not create a missing file, and goes on after a failed write.
    • update re-renders with the new binary before the service start.
    • setup and configure write by name for a new binary. configure holds the restart lock while it writes.
    • The invalid_record path, restart falling back to find_binary(), and update --check with the version helper.
    • test_strategies_match_the_claude_code_plugin still passes.
  • node --test tests/*.test.ts: 26 tests pass.
  • Live check with the v0.7.1 binary: rendered files for auto, 1-ping, 2-ping, none (by name, with an upstream comment) and auto (literal). Each ran on a free loopback port in a sandbox HOME. Each answered /healthz and /stats (preset: medium). The start log showed the strategy values:
    • auto: keepalive=true, idle 240 s, max pings 2
    • 1-ping: keepalive=true, idle 240 s, max pings 1
    • 2-ping: keepalive=true, idle 240 s, max pings 2
    • none: keepalive=false
    • auto literal: the same as auto by name
    • Each process was stopped by its pid.
  • Not tested: a real launchd or systemd service, and a real binary older than v0.7.1 (the fallback is unit tested only).

Data dependence

None. The change is only how the package writes its own config file.

Open questions

The two questions from #1044:

  1. Does the file record enough to re-render it? Yes. The install record has the preset, the cache strategy and the upstreams. The file also names the strategy in its comment line. So no separate migration is needed: the first re-render converts an old literal file.
  2. The Go table or Pi's copy? On a binary that has feat(config): named cache strategies in the proxy config #987, the re-render follows the proxy's own table, by name. Pi's copy is used only for an older binary, and for the names, the consent text and validation.

Still open:

  • The extension calls restart only when /healthz fails. A user with a proxy that always answers gets the new file at update, preset, cache-strategy or the next restart. With the by-name format, a new binary applies new values by itself, so this matters only for an old binary.

🤖 Generated with Claude Code

…fore each start

The Pi package wrote the proxy config only in setup and configure, with each
strategy key as a literal. A fix to a strategy's values in a new release never
reached an existing Pi install.

- For a binary of v0.7.1 or later (#987), the config names the strategy
  (cache.strategy) and the proxy fills the keys from its own table. The
  package reads the version from `--version`, which never starts a proxy.
  A version it cannot read counts as old.
- For an older binary, the config keeps the literal keys from Pi's table.
- `none` writes no cache block, as before, on any binary.
- `restart` and `update` (with the new binary) re-render the config from the
  install record before the start. Only a file with the package marker is
  written. A hand-written file is reported as config=not_owned and left alone.
- setup resolves the binary before it writes the config, and still refuses a
  hand-written config before any download.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 74253dd52ce9 approve

Verdict: approve

Findings

None. I found no wrong behavior on a path a user can reach.

Non-blocking

  • pi-package/scripts/pi_plugin.py:298 — a pre-release version counts as the release. release_version("0.7.1-rc1") strips -rc1 and returns (0, 7, 1), so an rc binary gets the by-name config. An rc cut before #987 merged refuses the strategy key, exits, and crash-loops. rerender_config cannot heal this: it re-makes the same decision and writes the same file. Today this is unreachable — the repo has never cut an rc tag, and releases/latest never resolves to a pre-release. Only a manual CONTEXT_GURU_VERSION=v0.7.1-rc1 install can hit it. The test at test_pi_plugin.py:603 asserts the rc case on purpose. If rcs ever become practice, compare pre-releases as older than their release.
  • pi-package/scripts/pi_plugin.py:385 — a hand edit to a marked config is reverted at the next session start. restart re-renders from the record even when the proxy already answers. Before this PR, a hand-tuned cache key inside a marked file persisted. Now it is silently replaced. The proxy's own rules advertise hand-tuning ("a key the file sets itself always wins", config/strategy.go:20). The README covers the marker rule and the escape hatch (remove the marker, or delete the strategy line and set the keys by hand — the file then differs from the render, so restart rewrites it; only the marker removal survives). Consider one README line that says it in those words.
  • pi-package/scripts/pi_plugin.py:863-869 — configure writes the config before the record, with no restart lock. A session-start restart that reads the record in between re-renders the old strategy over the new file. The window is two consecutive statements, and the next restart heals it. Not worth a lock; noting it so the shape is known.
  • pi-package/scripts/pi_plugin.py:398 — the invalid_record path has no test. Every other rerender_config return value has one. Also untested: restart falling back to find_binary() when the record has no binary key.

What I checked

  • The full diff (3 files, +262/−17) and the code around each change in pi-plugin.py, test_pi_plugin.py, and the README.
  • The proxy side of every claim the plugin makes:
    • --version prints context-guru-proxy <version> (commit <sha>) and returns before any port, config or log sink opens (cmd/context-guru-proxy/main.go:284-286). Release builds stamp buildinfo.Version from the tag without the v (.goreleaser.yaml), so out[1] is the version the parser expects.
    • The config loader is strict (KnownFields, config/config.go:408) and accepts cache: strategy: <name> (config/strategy_test.go:81). auto, 1-ping, 2-ping and none all exist in the proxy table (config/strategy.go:61-133).
    • config/strategy.go with #987 is inside the v0.7.1 tag, so NAMED_STRATEGY_RELEASE = (0, 7, 1) is the right line. v0.7.1 is the newest tag, so fresh installs use by-name now.
    • none writes no cache: block; every CacheConfig field defaults off or zero (config/config.go:99-101), so no block means no pings.
  • The failure direction: a version the plugin cannot read (no --version flag, usage text, non-zero exit, hang, missing file, None) yields literal keys, which every binary from MINIMUM_RELEASE on accepts. binary_version_text catches OSError and SubprocessError (including TimeoutExpired), and requires out[0] == "context-guru-proxy".
  • The by-name decision always matches the binary that will read the file: setup, configure, restart and update each pass the same executable to names_strategies/rerender_config that they pass to start_service. update re-renders with the NEW binary before the start, and its test proves start_service saw the new file.
  • Ownership: rerender_config writes only a file that starts with the marker; missing and not_owned never create or change one; setup refuses a hand-written config before any download (test asserts download.assert_not_called). rerender_config never raises (the write sits inside try/except), and a failed re-render does not stop the restart (tested).
  • Ordering: update writes the record, then re-renders, then starts. restart re-renders inside restart_lock, before the health check, so an already-up proxy gets the new file without a restart.
  • The extension (pi-package/extensions/context-guru.ts) ignores the new config= fact; downReason reads only result, service and reset_hatch. The restart budget is 60 s, so the 5 s --version timeout fits.
  • The strategy tables: the Pi copy is pinned to context-guru-plugin/scripts/settings.py (test_pi_plugin.py:324), which the Go table is pinned to (config/strategy_test.go:29). The keys and values of auto, 1-ping and 2-ping match across all three copies today.
  • Every record the plugin can write carries preset and cache_strategy since the first Pi release (c550c7c), so rerender_config's defaults cannot overwrite a choice a real install made.

Live tests were not approved, so I read the code only and ran nothing.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 74253dd52ce9 approve

Verdict: approve

Findings

None. I found no wrong behavior, no data loss, no broken fail-open path and no security problem.

Non-blocking

  • docs/data-dependence.md:241 — the row for the Pi session-start check says restart "reads only the install record (port and proxy URLs)". After this PR, restart also reads the preset, the cache strategy, the upstreams and the binary path from the record, runs the binary's --version, and writes proxy.yaml. The data level stays "none", and the PR body states "Data dependence: None". But the row's list is now short. Update the row's text.
  • pi-package/scripts/pi_plugin.py:899 — update --check now parses the installed version through binary_version_text, which also requires the first word to be context-guru-proxy. The parsing itself is tested (the fake-binary cases), but no test runs update --check with the new helper. The old code had no update test either.
  • pi-package/scripts/pi_plugin.py:832-836 — restart (inside the restart lock) can now write proxy.yaml while configure, setup or update write it with no lock. All writers use the same proxy.tmp path. A collision fails safe: one render wins, or a writer reports failed / refused. Rare and self-healing, so I do not block on it.
  • A setup that fails at the health check leaves the new strategy in the file, while the record keeps the old one. The next restart re-renders from the record and reverts the file. This follows the stated rule ("It comes from the install record") and the setup reported failure, so the user was told. Worth knowing, not a defect.

What I checked

  • The version gate. NAMED_STRATEGY_RELEASE = (0, 7, 1) is right: b49cbeb6 (#987, config/strategy.go) is an ancestor of tag v0.7.1 and not of v0.7.0.
  • The strict-YAML claim. config/config.go:408 sets KnownFields(true), so a binary without the Strategy field (config/config.go:94) refuses cache: strategy:. The gate is needed and correct.
  • The --version claim. cmd/context-guru-proxy/main.go:284-287 prints context-guru-proxy <version> (commit <sha>) and returns before the config load, the log sink and the listener. The parse in binary_version_text matches this output. Dev builds print dev, release_version raises, and names_strategies returns False.
  • The strategy names. Pi writes none, auto, 1-ping, 2-ping. All four exist in the proxy table (config/strategy.go:61-133). Pi's copy of the table is pinned to the Claude Code plugin by test_strategies_match_the_claude_code_plugin, and the Go test pins that plugin to the Go table, so the three tables cannot drift.
  • none. render_config writes no cache: block for it on any binary. CacheConfig.KeepAlive is off by default (config/config.go:98-103), so no block and strategy: none give the same behavior.
  • The fail-open paths. rerender_config returns missing, not_owned, invalid_record or failed and never raises; restart and update continue with the file as it is. names_strategies cannot raise: binary_version_text catches OSError and SubprocessError (the timeout), and release_version's RuntimeError is caught. An unreadable version gives literal keys, which every binary accepts (a file with no strategy key changes nothing, config/strategy.go:23).
  • The re-render is byte-stable for old installs: the literal-keys branch of render_config is unchanged from the base, so a restart on an old binary reports unchanged and writes nothing.
  • Ownership. restart and update write only a file that starts with the marker; a hand-written file is reported not_owned and left alone. setup refuses before any download. configure refuses through write_proxy_config.
  • The setup order change. The not-owned refusal still happens before the binary download; the config is now written after the binary is known, so the format matches the binary that will run. A failed binary install now leaves no config behind (an improvement).
  • The extension. It reads restart facts as a string map, so the new config= fact is additive and harmless.
  • The tests. I read all 14 new tests and the helpers they use. They cover the by-name render, the literal render, none on both, the version detection cases, and every rerender_config outcome (rendered, unchanged, not_owned, missing, failed, and already_up with no restart). The Python suite runs under go test ./... (pi-package/pi_test.go).
  • The README section matches the code: who writes the config, when, what not_owned means, and that a healthy proxy is not restarted for a config change.
  • I did not run the tests. Live tests are not approved for this review, so the "77 tests pass" claim is the PR's, not mine.

- data-dependence: the Pi session-start row lists what restart now reads
  from the install record, the `--version` call and the proxy.yaml write.
  The level stays none.
- A pre-release (0.7.1-rc1) counts as older than its release, so it gets
  the literal keys. 0.7.2-rc1 still gets the name.
- configure writes the config and the record under the restart lock, so a
  session-start restart cannot re-render the old record over the new file.
- README: a hand edit inside a file with the marker does not stay; remove
  the marker line to keep it.
- Tests: the invalid_record path, restart falling back to find_binary,
  update --check with the version helper, and the configure lock.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Round 1 replies. Both reviewers approved with no findings. I fixed the non-blocking notes in 1705cf83, except two that fail safe.

Reviewer 1

  • docs/data-dependence.md row too short: fixed. It now lists what restart reads from the install record (port, proxy URLs, preset, cache strategy, chained upstreams, binary path), the binary's --version, and the proxy.yaml write (only a file with the marker). The level stays none.
  • No test of update --check with the new helper: fixed. Fake binaries print 0.7.0, 0.7.1 and usage text. The release lookup is mocked.
  • restart and the other writers share proxy.tmp with no lock: not changed. A collision fails safe: one render wins, or a writer reports failed or refused. The configure part is now under the lock, see below.
  • A failed setup leaves the new strategy in the file: not changed. Setup reports the failure, and the next restart writes the file again from the record.

Reviewer 2

  • A pre-release counts as its release: fixed. A pre-release is now older than its release: 0.7.1-rc1 gets the literal keys, and 0.7.2-rc1 gets the name. The test is updated.
  • A hand edit in a marked file is replaced: documented. The README says the next restart, update, preset or cache-strategy writes the file again, and that removing the marker line keeps hand edits.
  • configure writes the config before the record, with no lock: fixed. configure writes the config and the record together while it holds the restart lock. A new test checks that the lock is held. I did not write the record first, because a refused config write would then leave the new strategy in the record.
  • No test of invalid_record or of the find_binary() fallback: fixed. Both have a test now.

Tests: Python 81 pass, Node 26 pass.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 1705cf8388a8 approve

Verdict: approve

Findings

None. The fix commit is correct, and it introduces no new defect I can show.

Earlier findings, and their status

Mine (all round-1 non-blocking):

  1. A pre-release counts as its release — fixed. names_strategies now returns False for 0.7.1-rc1 (same version, pre-release) and True for 0.7.2-rc1 (a later release). I traced all cases: 0.7.1→True, 0.7.0→False, v0.7.1-rc1→False, 0.7.2-rc1→True, dev→False. The later-release-rc case is the right call: any release after 0.7.1 contains #987. Better than my suggestion, which lost that case.
  2. A hand edit in a marked file is replaced — documented. The README now says it in the words I asked for, and the escape hatch (remove the marker) matches the code: owned() fails, restart and update report not_owned, and only setup/configure refuse.
  3. configure writes config and record with no lock — fixed. Both writes now sit inside restart_lock(). The lock releases on every exit path, including the return 2 refusal (with closes the handle). names_strategies runs before the lock, so the binary run does not extend the hold. No nesting, so no deadlock. The order (config first, record second) is right for the reason given: a refused write leaves the record unchanged.
  4. Missing tests (invalid_record, find_binary fallback) — fixed. Both tests exist and assert the right things. test_an_invalid_record_leaves_the_file_alone also proves names_strategies is never called on that path.

Reviewer 1's (round-1 non-blocking), checked by me:

  1. data-dependence row too short — fixed. The row now lists what restart reads and writes. One residual, see Non-blocking.
  2. No update --check test with the new helper — fixed. test_update_check_reads_the_version_the_binary_prints covers 0.7.0, 0.7.1 and usage text.
  3. Shared proxy.tmp with no lock — declined, and I accept the reason. Both writers do write_text then os.replace on the same tmp path. A collision leaves one complete render, or a failed/refused report. Never a mixed file. The configure half of the race is now under the lock anyway.
  4. A failed setup leaves the new strategy in the file — declined, and I accept the reason. Setup reported the failure, and the next restart re-renders from the record. The rule is stated in the README.

Non-blocking

  • pi-package/extensions/context-guru.ts:439 — configure now waits on the restart lock, but the extension still gives it 30 s. The extension gives restart 60 s precisely because of that lock (comment at line 289). A session-start restart can hold the lock about 45 s: 5 s --version, 5 s health check, up to 30 s systemctl restart, 5 s wait_healthy. A configure that collides is killed at 30 s while still waiting. It fails safe: nothing was written, and a retry works. Give configure the same 60 s budget, here or in a follow-up.
  • docs/data-dependence.md:241 — the row says restart reads "proxy URLs" from the record. It does not. restart() reads the port, the binary path, the preset, the cache strategy and the upstreams. The phrase is carried over from the old row text. Trim it.

What I checked

  • Last review: round 1, 74253dd, 2026-11-10T13:11:00Z.
  • New commits read: 1 — 1705cf83 "fix(pi): round 1 review notes for the config re-render".
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files: .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 (13:11:28Z) — read in full; checked each of its 4 notes against the fix commit (statuses above).
    • The author's round-1 reply (13:14:03Z) — read in full; verified every "fixed" claim in the code and every "not changed" reason (both accepted).
    • Commit 1705cf83 — reviewed as a first review, below.
  • The new names_strategies: traced every input class — release versions, v-prefixed, pre-releases of the same and later releases, dev, usage text, non-zero exit, missing file, None. No path raises; the safe direction (literal keys) holds everywhere.
  • The configure lock: restart_lock() returns an open handle, with closes it on all exits, flock releases. The new test proves the lock is held during the config write (a second non-blocking flock on the same file must fail), and that the record and the file both carry the new strategy after.
  • The new tests read in full: the find-binary fallback, the invalid-record path, the update-check versions, the lock test, and the updated pre-release cases.
  • The README line and the data-dependence row against the code they describe.
  • The extension timeouts (restart 60 s, configure 30 s, update --install 300 s) against the new lock wait — the one real tension, in Non-blocking.

Live tests were not approved, so I read the code only and ran nothing.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 1705cf8388a8 approve

Verdict: approve

Findings

None. The fixes are correct and I found no new defect in them.

Earlier findings and notes

My round-1 review had no findings, only non-blocking notes. The author's reply 1705cf83 addresses all of them:

  1. data-dependence row too short — fixed. The row (docs/data-dependence.md:241) now lists what restart reads from the install record (port, proxy URLs, preset, cache strategy, chained upstreams, binary path), the --version run and the proxy.yaml write. The level stays "none", which is still true.
  2. no update --check test — fixed. test_update_check_reads_the_version_the_binary_prints covers 0.7.0, 0.7.1 and usage text, with the release lookup mocked.
  3. shared proxy.tmp, no lock — not changed, reason accepted. A collision fails safe: one render wins, or a writer reports failed / refused. The reason is right. The configure part is now under the lock anyway (see below).
  4. a failed setup leaves the new strategy in the file — not changed, reason accepted. Setup reports the failure, and the next restart writes the file again from the record. This matched my own round-1 assessment.

Reviewer 2's round-1 notes (I checked each fix myself, not only the reply):

  • pre-release counts as its release — fixed, correct. names_strategies (pi-package/scripts/pi_plugin.py:293-305) now returns True only for version > (0, 7, 1), or == (0, 7, 1) without a - in the version text. I traced every test case: 0.7.1 → True, 0.7.1-rc1 and v0.7.1-rc1 → False, 0.7.2-rc1 → True, 0.7.0 → False, dev → False (RuntimeError path). release_version strips the -rc1 for the numbers and the raw text supplies the pre-release flag, so the two cannot disagree.
  • hand edit in a marked file is replaced — documented. The README bullet is accurate: I verified in round 1 that owned() tests the marker line, so a file without it returns not_owned from rerender_config and is never written, while setup and configure refuse it (the next bullet says so).
  • configure writes config and record with no lock — fixed. Both writes now sit inside restart_lock() (pi_plugin.py:871-878), and test_configure_writes_the_config_and_the_record_under_the_restart_lock proves the lock is held during the config write, by trying a non-blocking flock from a second file descriptor. The author's reason for writing the record second is right: a refused config write must not leave the new strategy in the record.
  • missing invalid_record and find_binary tests — fixed. Both paths have a test, and test_an_invalid_record_leaves_the_file_alone also proves names_strategies is not called before the validation.

Non-blocking

  • pi-package/scripts/pi_plugin.py:828 — restart still reads the record before it takes the lock (the lock is at line 837). A restart that reads the record just before a configure runs, then waits for the lock, re-renders the stale record over the new file when it gets the lock. The window is now the gap between read_record() and flock (microseconds), and the file heals at the next proxy restart. To close it fully, read the record again inside the lock.
  • setup and update still write the config and the record with no restart lock (setup: config → start → record; update: record → render → start). The same shape the commit fixed for configure. Both are interactive commands with narrow windows, and a lost race reverts the file only until the next restart. Note only.

What I checked

  • Last review: round 1, 74253dd52ce92d4de46ec7b8d5db865a558a28d2, 2026-11-10T13:11:28Z.
  • New commits read: 1 (1705cf83 "fix(pi): round 1 review notes for the config re-render", 4 files, +83/−11).
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt; the inline file is empty).
  • New items since my last review: the commit 1705cf83 and the author's round-1 reply comment (2026-11-10T13:14:03Z). I read both in full and checked every claim in them against the code.
  • The new names_strategies logic, traced on all seven version strings the tests use plus v0.7.1 and 0.8.0.
  • The configure lock: the locked section, the early return 2 inside the with (the lock is released), no re-entry into restart_lock from inside, and the lock test's mechanism (a second flock on the same file from another descriptor in the same process does conflict).
  • The four new tests, read against the code paths they claim to cover.
  • The data-dependence.md row and the README bullet for factual accuracy.
  • I did not run the tests. Live tests are not approved, so the "81 pass" claim is the author's, not mine.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Merged origin/main into this branch (head 8120560).

@amiddavid
amiddavid merged commit 8a5065e into main Nov 10, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 10, 2026
amiddavid added a commit that referenced this pull request Nov 10, 2026
- restart reads the install record again after it takes the lock.
- setup and update write the config and the record under the restart lock.
- The lock wait has a 40 s limit. restart reports result=busy; configure,
  setup and update refuse with reason=busy and write nothing.
- With no fcntl (a state directory copied to Windows) there is no lock,
  and restart reports service=unsupported, not a traceback.
- The extension gives configure 60 s, as restart has. A restart stopped
  at the 60 s limit says so, not "the restart did not run".
- The headers warning says "set" for two providers, and the chained quota
  wording names the chained providers.
- conflictWords joins with "; ", because a URL can hold a comma.
- data-dependence: restart does not read the proxy URLs.

Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
amiddavid added a commit that referenced this pull request Nov 11, 2026
The review notes left on #1010, #1011 and #1049, for the Pi package:
configure reads the install record again, conflictWords joins with
"; " (a URL can hold a comma), and the data-dependence row says
restart does not read the proxy URLs. Tests for the configure and
update busy paths, and for each finding.

Behavior change: none for users: the Pi package has no users yet
(owner decision on #1049).
Owner's yes, 2026-11-11, in the integrator session: "btw in the meantime 1058 is ready".

Data dependence: no change. Metadata only; the docs row states it
more exactly.

Reviews: 2 offload reviews (GLM), round 2, both approve at 4da5bb4.
The branch was then rewritten only to change the sign-off e-mail; the
patch is identical (patch-id 563da3ea9c58 before and after).

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
amiddavid added a commit that referenced this pull request Nov 11, 2026
…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]>
amiddavid added a commit that referenced this pull request Nov 11, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(pi): re-render the proxy config before each start, like strategy sync

1 participant