Repository navigation
feat(opencode): one-command installer for OpenCode and context-guru - #1296
Conversation
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | fresh | 2 of 2 | 1 of 2 | fa1dd3608643 |
blocking |
Verdict: blocking
Findings
-
opencode-plugin/scripts/install_opencode.py:214-221 — after
npm install, the installer does not check which OpenCode now runs- What fails: a user has OpenCode 1.17 from the official curl installer (
~/.opencode/bin, first onPATH) or from Homebrew. The installer asks "Update OpenCode 1.17.0 to 1.19.5?", the user says yes, and npm puts 1.19.5 in npm's global bin. The oldopencodestill comes first onPATH. The same happens on a fresh install when npm's global bin is not onPATH. The installer prints "✓ OpenCode 1.19.5 updated", writes both config files, and says "start OpenCode with: opencode". Thatopencodecannot load the plugin (README: older 1.x is not supported). The test prompt then fails with a misleading "run: opencode auth login" hint. - Proof: lines 214-221 check only
out.returncodeof npm. Nothing callsopencode --versionagain.FakeShell.run(test line 69) changes its ownself.opencodeonnpm install, so the tests assume the new version is the one onPATH. - Fix: after npm succeeds, run
which opencodeandopencode --versionagain. If it is missing or older than 1.18.29, stop before the consent step, and name the path that shadows it (or npm's global bin to add toPATH). Add a test where the fake shell keeps the old version afternpm install.
- What fails: a user has OpenCode 1.17 from the official curl installer (
-
opencode-plugin/scripts/test_install_opencode.py:290 — the assertion can never fail, and the "exit 0 with
Error:" rule has no test- What fails:
assertNotIn("OpenCode goes through it", text)checks a string that no branch offinish()prints. The success text is "OpenCode answered through it" (install_opencode.py:274). Ifansweredwere wrong and the success branch ran, this test still passes. The spec (step 6) and the code comment at line 271 name a second case:opencode runprints a provider error and exits 0. No test covers it;run_failsreturns exit 1, so the"Error:" not in ...part of line 272 is never driven. - Proof: grep of install_opencode.py for "goes through it" finds nothing.
FakeShell.run(test line 79-81) has only an exit-1 failure. - Fix: assert
assertNotIn("✓ The proxy started, and OpenCode answered", text). Add a test whereopencode runexits 0 withError: ...in stdout, and assert the "could not answer" text.
- What fails:
-
docs/data-dependence/features/opencode-installer.md:10 — the row says the record lists the entries the installer removed; the code does not record them
- What fails: the row says "It records which config files it created and which entries it removed". The design (step 5) says the same.
install_pluginstores onlypluginand, per file,createdandhad_plugin(lines 239-244). The removed entries (for example a hand-made clone entry with{"preset": "medium"}) go nowhere, and uninstall cannot put them back. CLAUDE.md asks for a correct data-dependence row; this one states a stored item that does not exist. - Proof: install_opencode.py:239-256 —
oursis used foroptionsand a log line, never written toself.record. - Fix: either record the removed entries (and say what uninstall does with them), or change the row,
docs/data-dependence.md(viago run ./cmd/gen-datadep) and the design to "which config files it created and whether each had apluginlist".
- What fails: the row says "It records which config files it created and which entries it removed". The design (step 5) says the same.
Non-blocking
- install_opencode.py:287 — uninstall calls
read_configs()first. With anopencode.jsonc, or a comment added toopencode.jsonafter install, uninstall stops before it stops any proxy or removes the plugin copy. The message then prints "To install it by hand…", which is the wrong advice for uninstall. Consider stopping proxies and removing the copy anyway, and printing the entries to remove by hand. - install_opencode.py:110-118, 328 —
is_oursneeds the file to exist. If the stable copy is gone (the user deleted~/.local/share), uninstall leaves the stable-path entry in both configs. Matchingrecord["plugin"]paths too would remove it. - install_opencode.py:229 — the consent text says "The preset is off", but line 252 carries old options such as
{"preset": "medium"}onto the new entry. The text is then wrong for that user. - install_opencode.py:197-199 — when
opencode --versionfails or prints a pre-release (1.19.5-beta),version_tuplegivesNone. The installer then says OpenCode "is not installed", installs it with npm, and setsopencode_installed, so uninstall offers to remove it. - install_opencode.py:245-247 — a second install overwrites
installer-backup/with the already-changed file. Nothing reads the backup today, so this has no effect yet.
What I checked
- The full diff, all 13 files, one commit (
fa1dd360). install_opencode.pyline by line: install flow, the record, entry match (is_ours, tuple options), atomic writes, uninstall flow, the test-prompt check.index.jsstateRoot/stateDirectory(lines 76-82): the installer'sstate_rootandproject_statehash match the plugin's.index.jsandtui.jscarry the markeropencode-context-guru(index.js:1424, tui.js:147). The plugin copy needs onlyindex.js,tui.js,README.md; leaving outscripts/is safe.install-opencode.shagainstpi-package/release/install-pi.sh: the same logic, other names. Name check, SHA-256 check,/dev/ttyopen check, trap cleanup.package.sh: tarball content and sums format.test_release.pycovers them.release.yaml(build before GoReleaser, upload on tags, snapshot artifacts) andopencode-plugin.yaml(path filteropencode-plugin/**covers the new files).- Python 3.9 compatibility (
removeprefix,missing_ok) for the macOS systempython3. - No behavior change for the plugin or the proxy. No live tests were run (not approved).
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | fresh | 1 of 2 | 1 of 2 | fa1dd3608643 |
blocking |
Verdict: blocking
Findings
-
opencode-plugin/scripts/install_opencode.py:264-280 — the test prompt leaves a proxy running for a deleted temp project, for up to 24 hours
- What fails: the user says yes to the test prompt.
opencode runin the temp folder loads the plugin. The plugin starts a detached proxy for that folder (index.js:1162,spawn(..., { detached: true }),child.unref()), with--idle-exit 24h(index.js:1160). Thewith tempfile.TemporaryDirectory()block then deletes the folder. Nothing stops the proxy or removes<state root>/<hash>/. - Result: one orphan proxy process per test run stays up to 24 h. With the default
5-min-pingstrategy it can also send keep-alive pings (default max 2,config/config.go:290) with the user's credential, for a conversation that nobody will continue. The consent text describes keep-alive "while you are away", not for the installer's own test. - Proof:
finish()runs onlycontext-guru-status(line 270). It never runscontext-guru-reset. Each run uses a new random temp folder, so each run makes a new state folder and a new proxy. - Fix: after the status read, run
sh <project_state(folder)>/context-guru-resetwhen it exists, and remove that state folder. Add a test that asserts the reset call for the temp project.
- What fails: the user says yes to the test prompt.
-
docs/data-dependence/features/opencode-installer.md:10 and the design spec step 5 — "records ... which entries it removed" is false
- What fails: the data-dependence row and the spec say the record lists the entries the installer removed.
install_plugin()(lines 239-244) records onlyplugin,createdandhad_pluginper file. The removed entries (for example a git-clone path with its options) are printed (line 259) and then lost. The only copy is ininstaller-backup/, and line 247 overwrites that backup on each install, so after a second install the backup holds the installer's own output. - Proof: grep for a key such as
removedininstall_opencode.pyfinds nothing.test_install_replaces_a_cloned_copy_and_keeps_its_optionsdoes not check the record. - Fix: either record the removed entries (and keep the first backup only, for example do not overwrite an existing backup file), or correct the row and the spec. The data-dependence row is the statement the owner confirms, so it must match the code. Then rerun
go run ./cmd/gen-datadep.
- What fails: the data-dependence row and the spec say the record lists the entries the installer removed.
-
opencode-plugin/scripts/test_install_opencode.py:290 — the assertion cannot fail, and the
Error:rule has no test- What fails:
assertNotIn("OpenCode goes through it", text)checks a string the installer never prints. The success line is "✓ The proxy started, and OpenCode answered through it." (line 274). So the test does not prove that a failed prompt is not reported as working. - Line 272 adds a new rule: exit code 0 with
Error:in the output counts as no answer. No test covers it.FakeShellreturns exit 1 forrun_fails, so theError:branch is never the deciding one. - Fix: assert
assertNotIn("✓ The proxy started, and OpenCode answered", text)and assert the "could not answer" line. Add a case whereopencode runexits 0 and printsError: ....
- What fails:
-
opencode-plugin/scripts/install_opencode.py:287 — uninstall stops on a JSONC file and prints install steps
- What fails:
uninstall()callsread_configs()first. Whenopencode.jsoncexists, oropencode.json/tui.jsonhas a comment, it raisesStopwithmanual_steps(): "To install it by hand, add these entries ...". The user wants to remove the plugin. Uninstall does nothing: no proxy stops, the plugin copy stays, the record stays. - Proof: lines 190-194 and 72-79;
uninstall()line 287 is before the proxy stop at line 290. A user can add a comment or aopencode.jsoncafter the install, so this state is reachable. - Fix: in uninstall, stop the proxies first. For a file it cannot parse, print the entry to remove by hand (not the install steps), and go on with the other steps.
- What fails:
Non-blocking
write_json(line 88):mkstempmakes the temp file with mode 0600, soos.replacechanges the user'sopencode.jsonfrom 0644 to 0600. Copy the old mode when the file exists.ensure_opencode(lines 198-221): whenopencode --versionprints no parsable version,installedis None. The installer then installs with npm and recordsopencode_installed: True, so uninstall offers to remove an OpenCode the user had before.- After an npm update (line 214), the installer does not run
opencode --versionagain. If an older OpenCode from another source (Homebrew,~/.opencode/bin) is first onPATH, the plugin still does not load and the installer says "✓ updated". remove_entriesfinds our entries only by reading the file at the path. If the plugin copy is already gone, the stale stable-path entry stays in both config files. Matchingrecord["plugin"]too would remove it.- Uninstall also removes git-clone entries the user added by hand (
test_uninstall_removes_a_cloned_copy_entry_too). That conflicts with "uninstall removes only what install added" in the spec and in the how-to. Say it in the docs, or limit it. - The data-dependence row says the installer "reads only the proxy's up or down answer". It also prints the last 200 characters of the model's answer or error (line 268). It stores nothing, but the row could say so.
.github/workflows/opencode-plugin.yamlline 3 is now longer than the other comment lines (style only).
What I checked
CLAUDE.mdrules: data-dependence row added and generated page updated; no Go change; no proxy behavior change (the release gets 3 new files).- Every changed line of all 13 files in
eeefd62a..fa1dd360. install_opencode.pyagainstindex.js:stateRoot()andstateDirectory()hashing (sha256, first 16 hex), thecontext-guru-statusandcontext-guru-resetscripts, the markeropencode-context-guru,startProxy()detach and--idle-exit 24h.install-opencode.sh: the SHA-256 check, the file-name checks,set -u, the tty check, the EXIT trap, the exit code pass-through.package.sh: what goes into the tarball; the installer's copy skipsscripts,testandrelease.release.yaml: build before GoReleaser, upload only onv*tags, snapshot artifacts;/opencode-dist/is in.gitignore.- Both Python test files, for what each test can and cannot prove. I did not run them (live tests not approved).
- Python 3.9 compatibility (
str.removeprefix,unlink(missing_ok=True)), for the macOS systempython3.
- The test prompt stops its own proxy and deletes its state folder. OpenCode reads PWD too, so the check sets PWD to its folder; else a second proxy started for the installer's own folder. - After npm, the installer runs opencode --version again. When an older OpenCode comes first on PATH, or none is on PATH, it stops before the consent step and names it. - A version it cannot read no longer counts as "not installed". - Uninstall stops the proxies first. A file with comments or a JSONC file stays unchanged; the installer names the entry to remove by hand, does the other steps, and exits 1. - Uninstall also removes the recorded entry when the copy is gone. - The consent text names a preset that an old entry carries over. - Config writes keep the file mode. - The tests: a failed prompt (exit 1, and exit 0 with Error:) is never reported as working. - The data-dependence row, the design and the how-to say what the record holds, and that uninstall also removes a hand-made entry. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
Replies to round 1 (fixed in d0c52f7)Reviewer 1
Non-blocking:
Reviewer 2
Non-blocking:
|
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 2 of 2 | 2 of 2 | d0c52f7610bd |
approve |
Verdict: approve
Findings
None.
Earlier findings
Reviewer 2 (mine):
- No check after
npm install: fixed.ensure_opencodecallsopencode_version()again after npm (lines 235-243). It stops before consent whenopencodeis missing fromPATHor older than 1.18.29, and names the path.test_an_opencode_first_on_path_that_is_still_old_stops_before_consentdrives it: the fake keeps 1.17.0 after npm, and the test asserts exit 1, the path, and no config. - The assertion that could not fail: fixed. The test now asserts that the success line is absent and the "could not answer" line is present. It runs for exit 1 and for exit 0 with
Error:in stdout. The second case makes line 272's"Error:" not in ...the deciding check. - The data-dependence row: fixed in the docs. The row file and the generated page have the same new text. The text matches the code: the record holds
plugin,files.<name>.created,files.<name>.had_plugin,opencode_installed. The design and the how-to agree.
Reviewer 1:
- Orphan proxy after the test prompt: fixed.
finish()runscontext-guru-resetfor the check's state folder, then removes the folder.Shell.runsetsPWDtocwd, so OpenCode uses the temp folder as its project. The fake shell does not checkPWD; the author reports a real macOS run for that part. I did not run it. - Row text: fixed (see my item 3).
- Weak test: fixed (see my item 2).
- JSONC stops uninstall: fixed. Uninstall stops the proxies first, then handles each file on its own. A file it cannot parse goes to
by_hand, the other steps run, and it exits 1.test_uninstall_with_a_jsonc_file_still_stops_proxies_and_removes_the_copycovers it.
Non-blocking items from round 1 (both reviewers): file mode, unknown version, stale stable-path entry and the consent preset are all fixed, and each has a test. The author left two items as they are: the backup overwrite (nothing reads the backup, and the design now says so) and the comment line length. I accept both.
Non-blocking
- install_opencode.py:252 — for a file it cannot parse, the hand-removal message always names the stable path (
plugin_dir() / file). The file may instead hold a clone entry, or no context-guru entry at all. The message could say "any context-guru entry, for example …". - install_opencode.py:253-255 — any
opencode.jsoncmakes every uninstall exit 1, also when that file never had a context-guru entry. A user who runs uninstall again gets exit 1 each time. - install_opencode.py:154-176 — when
opencode --versiongives text the installer cannot read (for example a dev or pre-release build), the user cannot install. The update question gets a yes, npm runs, and the second version check stops the install because it still cannot read the version. This fails closed, so it is safe. It could offer to go on when the version is unknown. - install_opencode.py:182-184 — the consent text takes the preset from the old entry's options. The plugin lets a per-project saved preset win over options (
index.js:1105), and it treats a name it does not know asoff. The text is right for the common case.
What I checked
- Last review: round 1, fa1dd36, 2026-11-23T10:46:10Z
- New commits read: 1 (
d0c52f76fix(opencode): the review findings on #1296) - Read in full: 3 reviews (2 entries with an empty body, and reviewer 1's round 1; my own round 1 is in this session), 1 comment, 0 inline comments
- New items since my last review: the author's reply comment (2026-11-23T10:52:45Z). It answers each finding of both reviewers. I checked each claimed fix against the code and the tests (see "Earlier findings"). Reviewer 1's round-1 review (10:46:18Z) I read for the first time; I checked each of its findings in this round.
- The full diff
fa1dd360..d0c52f76: 6 files. I readinstall_opencode.pyaround every change (write_json,is_ours,Shell.run,ensure_opencode,carried_options,consent,install_plugin,finish,uninstall,remove_entries). index.jseffectiveSettings(option namepreset),stateDirectory, and the reset script, against the new check cleanup.- The generated
docs/data-dependence.mdrow is the same as the row file. - No behavior change in the plugin or the proxy. No live tests were run (not approved).
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 1 of 2 | 2 of 2 | d0c52f7610bd |
blocking |
Verdict: blocking
Findings
- opencode-plugin/scripts/install_opencode.py:204-215 — a pre-release OpenCode is taken as too old, and the default answer replaces it with 1.19.5
- What fails: the user has a newer pre-release or dev build, for example
opencode --versionprints1.20.0-beta.1or1.19.5-beta.version_tuplereturns None:"1.20.0-beta.1".split(".")has 4 parts, and"5-beta".isdigit()is false. The newopencode_version()returns "of an unknown version".ensure_opencodethen asks "The plugin needs OpenCode 1.18.29 or later. Update OpenCode of an unknown version to 1.19.5? [Y/n]". The default is yes. When that OpenCode came from npm,npm install -g [email protected]downgrades it. A "no" stops the install with "context-guru needs OpenCode 1.18.29 or later", which is false for this user. With no npm, the user sees "OpenCode is too old". - Proof: lines 63-69 (
version_tuple), 204-215 (newopencode_version/ensure_opencode),yes(question, default=True).test_an_opencode_whose_version_cannot_be_read_is_not_taken_as_missingcovers only the record. It answers "y" to the update and expects exit 1. No test covers a pre-release string. - Fix: parse the leading
X.Y.Zand ignore a-suffix(for example a regex^v?(\d+)\.(\d+)\.(\d+)), so1.20.0-beta.1counts as 1.20.0. For a version that is still unreadable, do not offer npm. Keep it, say the plugin needs 1.18.29 or later, and ask to go on. Or at least make the default "no" and do not say "needs" or "too old". Add a test with1.20.0-beta.1.
- What fails: the user has a newer pre-release or dev build, for example
Status of round-1 findings
- Reviewer 1, finding 1 (test-prompt proxy left for 24 h): fixed.
finish()runs the project'scontext-guru-reset, then deletes its state folder (lines 301-307).Shell.runnow setsPWDtocwd, so OpenCode uses the temp folder as the project. The new test checks the reset call and that the folder is gone. - Reviewer 1, finding 2 (the row claims removed entries are recorded): fixed in the docs. The row, the generated page and the design now list what the record holds and say the replaced entries are not recorded. The two copies of the row text are the same.
- Reviewer 1, finding 3 (vacuous assertion, no
Error:exit-0 test): fixed. The test now asserts that the success line is absent and the "could not answer" line is present, for exit 1 and for exit 0 withError:. - Reviewer 1, finding 4 (JSONC blocks uninstall): fixed. Uninstall stops the proxies first, catches
Stopper file, names the entry to remove, does the other steps, and returns 1. The new test covers it. - Reviewer 2, finding 1 (no version check after npm): fixed. Lines 236-244 check
whichand--versionagain and stop before consent. The new test withnpm_shadowedcovers it. I agree with this fix. - Reviewer 2, findings 2 and 3: the same as my 3 and 2. Fixed.
- Non-blocking items: file mode kept (line 88-92, tested); the recorded stable path also matches in uninstall (tested); the consent text names a carried preset (tested); the docs say uninstall removes entries added by hand. The backup overwrite is left as is. The author's reason (nothing reads the backup, the design says so) is right. The pre-release part of reviewer 2's non-blocking point is only half fixed: see finding 1.
Non-blocking
finish()and the shared binary: on a fresh machine the test prompt downloads the proxy. The check'scontext-guru-resetthen runsrelease_shared(index.js:281-292). No other project uses the copy, so the reset deletes it. The first real OpenCode session downloads it again. This is only a second download, not a defect. Say it, or skip the release for this one reset.write_jsonusesos.replace. Whenopencode.jsonis a symlink into a dotfiles repo, the rename replaces the link with a regular file. The dotfiles copy does not get the entry, and later edits there do not reach OpenCode. This was in round 1 code too. Consider writing to the resolved path (path.resolve()).- The uninstall message for an unparsable file always names the stable path. When the entry there is a git-clone path, the message names the wrong path. Naming "the entry with
opencode-context-guru" would be more exact.
What I checked
- Last review: round 1, fa1dd36, 2026-11-23T10:46:18Z
- New commits read: 1 (
d0c52f76fix(opencode): the review findings on #1296) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review: 1 comment by vz-ibm at 2026-11-23T10:52:45Z, the replies to both round-1 reviews. I checked each reply against the code and the tests (see "Status of round-1 findings"). Reviewer 2's round-1 review (10:46:10Z) was posted before mine; I read it in full in this round.
- The whole diff
fa1dd3608643..d0c52f76(6 files) and the code around each change ininstall_opencode.py. index.jsresetScript(lines 294-321) andRELEASE_SHARED(281-292), to check what the new reset call infinish()does.version_tupletraced by hand on1.19.5,opencode 1.19.5,1.20.0-beta.1,1.19.5-beta,opencode dev build.- The new tests, for what each one can and cannot prove. The
subTestloop runs two installs in one HOME; the second install starts from the first one's record, and its assertions still hold. - I did not run the tests (live tests not approved).
One curl command installs context-guru for OpenCode, on macOS and Linux. It uses the pattern of the Pi installer (#1294). - install-opencode.sh downloads the plugin tarball from the release, checks its SHA-256, and runs install_opencode.py. - The installer installs OpenCode 1.19.5 (the tested version) with npm when OpenCode is missing or older than 1.18.29, after a yes. It never uses sudo. - It shows what turns on (routing, keep-alive on the user's own login) and asks once. - It adds the plugin to the global opencode.json and tui.json, and removes another copy of the plugin. A JSONC file stops it, with the entries to add by hand. - It asks for no key. The plugin uses OpenCode's own login. - uninstall removes only what install added, and OpenCode only when the installer installed it. - The release workflow builds and attaches the tarball, its SHA-256 list and install-opencode.sh. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
- The test prompt stops its own proxy and deletes its state folder. OpenCode reads PWD too, so the check sets PWD to its folder; else a second proxy started for the installer's own folder. - After npm, the installer runs opencode --version again. When an older OpenCode comes first on PATH, or none is on PATH, it stops before the consent step and names it. - A version it cannot read no longer counts as "not installed". - Uninstall stops the proxies first. A file with comments or a JSONC file stays unchanged; the installer names the entry to remove by hand, does the other steps, and exits 1. - Uninstall also removes the recorded entry when the copy is gone. - The consent text names a preset that an old entry carries over. - Config writes keep the file mode. - The tests: a failed prompt (exit 1, and exit 0 with Error:) is never reported as working. - The data-dependence row, the design and the how-to say what the record holds, and that uninstall also removes a hand-made entry. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
The owner wants the same concept as the Pi installer: install the latest release, and offer an update when the installed one is older. - The latest version comes from npm view. A no to the update keeps an OpenCode of 1.18.29 or later. - A pre-release counts as its release (1.20.0-beta.1 is 1.20.0), so it is never downgraded (review round 2, reviewer 1). - A version that cannot be read never gets an npm offer. The installer asks to go on with it. - No npm: a supported OpenCode stays. - CG_OC_OPENCODE_VERSION is gone. 1.19.5 stays only in the "tested on" note. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
d0c52f7 to
b393bda
Compare
Replies to round 2 (b393bda)The branch is now on Reviewer 1, finding 1 (a pre-release taken as too old and downgraded): fixed.
A change of concept, by the owner's decision: the installer now installs the latest OpenCode, as the Pi installer does for Pi. It asks to update an older one. A "no" keeps an OpenCode of 1.18.29 or later. 1.19.5 stays only in the "tested on" note. Non-blocking items:
|
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 1 of 2 | 3 of 3 | b393bda6654f |
blocking |
Verdict: blocking
Findings
- opencode-plugin/scripts/install_opencode.py:217-222, 241 — a broken npm registry now stops the install, also when a supported OpenCode is already there
- What fails: the user has OpenCode 1.19.5 (from npm, Homebrew or the curl installer) and npm on
PATH.npm view opencode-ai versionfails: a corporate.npmrcwith an expired token (E401), a blocked registry, or no network to npm.ensure_opencodecallslatest_opencode()(line 241) before it looks at the installed version. That raisesStop, so the install ends with exit 1. The user cannot turn context-guru on, even though nothing needs npm. - The same user without npm gets "OpenCode 1.19.5 is installed" and goes on (lines 235-239). A broken npm is now worse than no npm.
- This is new in
b393bda6. Atd0c52f76, a supported OpenCode returned before any npm call. - Proof:
test_npm_that_cannot_read_the_latest_version_names_the_registry_settingpins it.FakeShellstarts withopencode = "1.19.6"(a supported, installed OpenCode), and the test expects exit 1 and no config. - Fix: when
npm viewfails and the installed version is 1.18.29 or later, say that the installer cannot check for an update, nameCG_OC_NPM_REGISTRY, and keep that OpenCode. Stop only when OpenCode is missing or too old. Change the test to a missing OpenCode, and add one for the supported case.install_pi.py:188-199has the same pattern; the owner may want the same change there in a follow-up.
- What fails: the user has OpenCode 1.19.5 (from npm, Homebrew or the curl installer) and npm on
Status of earlier findings
- Reviewer 1, round 2, finding 1 (pre-release taken as too old and downgraded): fixed.
version_tuple(lines 64-71) reads the leadingX.Y.Zwith(?![.\d]). I traced1.20.0-beta.1→ (1, 20, 0),v1.19.5→ (1, 19, 5),1.2.3.4→ None,opencode dev build→ None. An unreadable version never gets an npm offer (lines 227-233). The new tests cover both cases. - Reviewer 1, round 1, findings 1-4, and reviewer 2, round 1, findings 1-3: still fixed.
8b2f2feais the same commit asd0c52f76(git range-diffshows=).c6775b18differs fromfa1dd360only in the rebase: the.gitignorecontext and the proxy version v0.7.6 → v0.7.7 in the how-to. - Round-2 non-blocking items that the author left as they are (the shared binary download again, the symlinked
opencode.json, the stable path in the hand-removal message, exit 1 with anyopencode.jsonc): I accept each reason. - The change to "install the latest OpenCode" is the owner's decision, as the reply comment says. I did not review whether it is right, only the code.
Non-blocking
- Lines 254-271: an older OpenCode from Homebrew or
~/.opencode/binthat is still 1.18.29 or later. The default yes runsnpm install -g, and the old one still comes first onPATH. The second check passes, because the old version is supported. The installer then says "✓ OpenCode 1.19.5 updated." That is false: npm put 1.19.6 in a second place, and 1.19.5 still runs. Whennow_shownis nottarget, say whichopencodestill runs and where npm put the new one. - Line 239 and 244: when the installed version is the tested one,
tested_noteis empty, so the line ends with a space ("… is installed. "). Style only. test_install_opencode.py:111still popsCG_OC_OPENCODE_VERSION, which no code reads now.
What I checked
- Last review: round 2, d0c52f7, 2026-11-23T10:54:43Z
- New commits read: 3 (
c6775b18feat(opencode): one-command installer for OpenCode and context-guru, the rebasedfa1dd360;8b2f2feafix(opencode): the review findings on #1296, the rebasedd0c52f76;b393bda6feat(opencode): install the latest OpenCode, as the Pi installer does). The other commits ind0c52f76..HEAD(07afd6b9,bcd35b61,23a4b03a,d0dea8bb,30a80767) come frommain.git diff --name-only 30a80767..HEADshows only the 13 PR files. - Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-2 review (2026-11-23T10:54:26Z, approve). I read it. Its non-blocking point about an unknown version is now handled by
b393bda6. Its other points match the ones the author answered. - The author's reply comment (2026-11-24T06:53:29Z): the rebase, the fix for my round-2 finding, the owner's "install the latest" decision, and answers to my non-blocking items. I checked each one against the code (see "Status of earlier findings").
- Reviewer 2's round-2 review (2026-11-23T10:54:26Z, approve). I read it. Its non-blocking point about an unknown version is now handled by
git range-diff eeefd62a..d0c52f76 30a80767..8b2f2fea, to confirm that the rebase changed nothing else.- The whole
b393bda6diff (6 files), andinstall_opencode.pyaroundensure_opencode,latest_opencode,opencode_versionandtested_note. pi-package/scripts/install_pi.py:188-210, to compare with the Pi installer that the new concept copies.- The row file and the generated
docs/data-dependence.mdrow have the same text, and both name the newnpm viewread. - I did not run the tests (live tests not approved).
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 2 of 2 | 3 of 3 | b393bda6654f |
approve |
Verdict: approve
Findings
None.
Earlier findings
- Reviewer 1, round 2, finding 1 (a pre-release is taken as too old and downgraded): fixed.
version_tuplenow matches a leadingX.Y.Z(re.match(r"v?(\d+)\.(\d+)\.(\d+)(?![.\d])", word)). I traced it by hand:1.20.0-beta.1→ (1, 20, 0),opencode v1.19.5→ (1, 19, 5),1.2.3.4→ None,opencode dev build→ None. A version the installer cannot read no longer gets an npm offer. The installer asks "Go on with this OpenCode?" instead. The new tests cover the pre-release, the yes and the no. - All round 1 findings of both reviewers stay fixed.
git range-diffshows that the rebase changed only context lines in.gitignoreand the how-to (/pi-dist/, proxy v0.7.7).d0c52f76and8b2f2feaare the same. - Round 2 non-blocking items that the author left as they are: I accept each reason.
- The reset deletes the shared binary: the cost is one more download.
- A symlinked config becomes a regular file: rare, and it is left for a follow-up.
- The hand-removal message names the stable path: a clone entry is the less common case.
- Each uninstall with a
opencode.jsoncexits 1: the installer cannot know what that file holds.
Non-blocking
- install_opencode.py:217-221, 240 — when
npm viewfails (for example an npm registry that a firewall blocks), the install stops. This also happens when the installed OpenCode is already 1.18.29 or later.test_npm_that_cannot_read_the_latest_version_names_the_registry_settingpins this, with the default OpenCode 1.19.6. When there is no npm at all, the same OpenCode stays (line 235-237). The Pi installer does the same (install_pi.py:188-199), so this follows the owner's "same concept". A supported OpenCode could stay with a note whennpm viewfails. - install_opencode.py:241 —
targetdrops a suffix from npm'slatest(for example1.21.0-rc.1becomes1.21.0). If thelatesttag ever names a pre-release,npm install [email protected]asks for a version that may not exist. npm then fails with its own message, and nothing changes. Usinglatestas npm printed it avoids this. - test_install_opencode.py:111 —
os.environ.pop("CG_OC_OPENCODE_VERSION", None)cleans up an environment variable that the installer no longer reads. It is an orphan from this commit.
What I checked
- Last review: round 2, d0c52f7, 2026-11-23T10:54:26Z
- New commits read: 3 on the PR branch after the rebase onto
30a80767.c6775b18feat(opencode): one-command installer for OpenCode and context-guru. This is the rebasedfa1dd360. I compared the two withgit range-diff.8b2f2feafix(opencode): the review findings on #1296. This is the rebasedd0c52f76;range-diffshows=.b393bda6feat(opencode): install the latest OpenCode, as the Pi installer does. I read it in full: 6 files.
- Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-2 review (2026-11-23T10:54:43Z). I checked its finding 1 and its 3 non-blocking points against
b393bda6(see "Earlier findings"). - The author's comment (2026-11-24T06:53:29Z). It replies to round 2 and names the owner's decision: install the latest OpenCode, as the Pi installer does. I checked each reply against the code and the tests. The new concept is the owner's decision, and the design, the how-to and the data-dependence row all state it.
- Reviewer 1's round-2 review (2026-11-23T10:54:43Z). I checked its finding 1 and its 3 non-blocking points against
ensure_opencodetraced for each path: missing, too old, supported but older than the latest, latest, pre-release, unreadable version, no npm,npm viewfailure, npm shadowed after install.self.targetis set before each use (lines 253-268).install_pi.pylatest_pi/ensure_pi, to compare with the "same concept".- The data-dependence row file text appears once, unchanged, in the generated
docs/data-dependence.md. - No change to the plugin or the proxy. No live tests were run (not approved).
Review round 3 on #1296. - When npm view fails (E401, a blocked registry) and OpenCode 1.18.29 or later is installed, the installer says it cannot check for a newer one and keeps it. It stops only when OpenCode is missing or too old. - npm install uses the latest version as npm prints it, so a pre-release tag keeps its suffix. - When an older but supported OpenCode still comes first on PATH after npm, the installer says so, and not "updated". - No trailing space after the "is installed." line. - The tests no longer clean up the removed CG_OC_OPENCODE_VERSION. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
Replies to round 3 (fixed in 02d0d01)Reviewer 1, finding 1 (a broken npm registry stops the install of a supported OpenCode): fixed.
Non-blocking items (both reviewers): fixed.
A real run on macOS (OpenCode 1.19.6, install and uninstall) passes again, and no process stays. |
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 2 of 2 | 4 of 4 | 02d0d01632aa |
approve |
Verdict: approve
Findings
None.
Earlier findings
- Reviewer 1, round 3, finding 1 (a broken npm registry stops the install of a supported OpenCode): fixed.
ensure_opencodecatches theStopfromlatest_opencode(). When the installed version is 1.18.29 or later, it says "The installer cannot check for a newer OpenCode", namesCG_OC_NPM_REGISTRY, and keeps it. A missing or too-old OpenCode still stops, with "Nothing was changed." The new test..._keeps_a_supported_opencodecovers the supported case...._names_the_registry_settingnow uses a missing OpenCode. This also fixes my round-3 non-blocking point 1. - My round-3 non-blocking point 2 (the suffix of
latestdropped): fixed.target = latest, as npm prints it. The comparison still usesversion_tuple(latest), so a final1.21.0againstlatest1.21.0-rc.1stays and is not downgraded.test_the_install_uses_the_latest_version_as_npm_prints_itchecks[email protected]. - My round-3 non-blocking point 3 (the orphan
CG_OC_OPENCODE_VERSIONcleanup): fixed. The line is gone. - Reviewer 1, round 3, non-blocking points:
- An older but supported OpenCode is still first on
PATH: fixed. The installer now says whichopencodestill runs, and does not print "updated". The new test covers it. - The trailing space: fixed.
tested_notenow starts with the space. The new test checks the exact line. - The orphan cleanup: fixed (see above).
- An older but supported OpenCode is still first on
- All earlier findings of both reviewers stay fixed. This commit does not touch the code of those fixes.
- The same
npm viewpattern ininstall_pi.py: the author leaves it for a follow-up PR. I accept that. It is outside this PR.
Non-blocking
- install_opencode.py:278-282 — when an older but supported OpenCode still runs after the npm install, npm has put a second OpenCode in its global folder. The record does not set
opencode_installed, so uninstall does not offer to remove that second copy. The message tells the user about it. This is acceptable.
What I checked
- Last review: round 3, b393bda, 2026-11-24T06:55:17Z
- New commits read: 1 (
02d0d016fix(opencode): a broken npm registry keeps a supported OpenCode) - Read in full: 6 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-3 review (2026-11-24T06:55:17Z, blocking). I checked its finding 1 and its 3 non-blocking points against
02d0d016(see "Earlier findings"). - The author's reply comment (2026-11-24T06:57:45Z). It answers round 3 of both reviewers. I checked each claimed fix against the code and the tests. The author reports a real macOS run; I did not repeat it.
- Reviewer 1's round-3 review (2026-11-24T06:55:17Z, blocking). I checked its finding 1 and its 3 non-blocking points against
- The full diff
b393bda6..02d0d016: 3 files (the design,install_opencode.py,test_install_opencode.py). I readensure_opencode,latest_opencodeandtested_notein full after the change. - I traced
ensure_opencodeagain for each path: missing, too old, supported but older, latest, a pre-releaselatest, an unreadable version, no npm,npm viewfailure with a missing, too-old or supported OpenCode, npm not onPATH, and an older OpenCode still first onPATH(unsupported and supported). - I checked each new test for what it can prove: the answer counts match the questions on each path, and
assertIn(..., self.terminal.shown)checks the exact line. - The design text matches the new code.
- No change to the plugin or the proxy. No live tests were run (not approved).
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 1 of 2 | 4 of 4 | 02d0d01632aa |
approve |
Verdict: approve
Findings
None.
Status of earlier findings
- Reviewer 1, round 3, finding 1 (a broken npm registry stops the install of a supported OpenCode): fixed.
ensure_opencode(lines 240-248) catches theStopfromlatest_opencode(). With OpenCode 1.18.29 or later, it says "cannot check for a newer OpenCode", shows npm's message withCG_OC_NPM_REGISTRY, and keeps that OpenCode. With a missing or too-old OpenCode, it stops with "Nothing was changed." The new testtest_npm_that_cannot_read_the_latest_version_keeps_a_supported_opencodedrives the supported case. The old test now uses a missing OpenCode. The design says the same. - Reviewer 1, round 3, non-blocking: all fixed.
- Shadowed but supported OpenCode: lines 278-282 now say which
opencodestill runs, not "updated".test_an_older_opencode_first_on_path_is_not_reported_as_updatedcovers it. - Trailing space:
tested_notenow starts with the space. The test checks the exact line interminal.shown, so it can fail. - The orphan
CG_OC_OPENCODE_VERSIONcleanup is gone.grepfinds no other use.
- Shadowed but supported OpenCode: lines 278-282 now say which
- Reviewer 2, round 3, non-blocking:
npm viewfailure (the same as my finding 1), fixed.targetnow keeps npm's suffix (line 249).test_the_install_uses_the_latest_version_as_npm_prints_itasserts[email protected]. Fixed. - All findings of rounds 1 and 2 (both reviewers) stay fixed.
02d0d016changes onlyensure_opencode,latest_opencodeandtested_note. - The follow-up for the same
npm viewpattern ininstall_pi.pyis out of scope for this PR. I accept that.
Non-blocking
- None new.
What I checked
- Last review: round 3, b393bda, 2026-11-24T06:55:17Z
- New commits read: 1 (
02d0d016fix(opencode): a broken npm registry keeps a supported OpenCode) - Read in full: 6 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-3 review (2026-11-24T06:55:17Z, approve). I read it. Its three non-blocking points are fixed in
02d0d016(see above). - The author's reply comment (2026-11-24T06:57:45Z). It answers my round-3 finding and the non-blocking items of both reviewers. I checked each claim against the code and the tests.
- Reviewer 2's round-3 review (2026-11-24T06:55:17Z, approve). I read it. Its three non-blocking points are fixed in
- The whole
02d0d016diff (3 files), and all ofensure_opencode(lines 224-283) after it. ensure_opencodetraced for each case. Missing: with npm, with no npm, and with a failednpm view. Too old, with a yes and a no. Supported, with a failednpm view. Latest. Pre-release. Unreadable version. After npm:opencodenot onPATH, shadowed and too old, shadowed and supported.self.targetis set before each use.- Each new test, for what it proves and whether it can fail.
git diff --name-only 30a80767..HEADstill shows only the 13 PR files.- I did not run the tests (live tests not approved).
fix(pi): a registry that fails keeps an installed Pi When npm view fails (E401, a blocked registry) and Pi is installed, install-pi.sh stopped. Nothing in that case needs npm. The installer now shows npm's message, keeps that Pi, and goes on. With no Pi, it still stops and changes nothing. The OpenCode installer (#1296) does the same; review round 3 there found it. Pi behavior change: the PR author (Vitaly) gave his yes on the PR; Pi changes are FYI to the owner (owner rule 2026-11-20). The owner (David Amid, 2026-11-24, integrator session) asked the integrator to merge the Pi set "as you see fit". Integrator check on current main + #1326 + #1330: the Pi unittest suites, the release tests and go test ./pi-package/... pass. Assisted-By: Claude Opus 5.5 Signed-off-by: Vitaly Zabershinsky <[email protected]>
A config file that links into a dotfiles repo became a regular file: the atomic rename replaced the link. The write now goes to the file the link points to, so the link and the dotfiles copy both stay right. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 1 of 2 | 5 of 5 | 516276f949a9 |
approve |
Verdict: approve
Findings
None.
Status of earlier findings
- My round-2 non-blocking point (a symlinked
opencode.jsonbecomes a regular file): fixed in516276f9.write_jsonnow resolves the path withos.path.realpathbeforemkstempandos.replace. The temp file is in the target's folder, so the rename stays on one file system and the link stays. The mode is read from the target. The new testtest_install_writes_through_a_symlinked_config_and_keeps_the_linkchecks that the link stays and that the dotfiles file gets the entry. It fails on the old code, becauseos.replacewould put a regular file in place of the link. - All findings of rounds 1 to 4 (both reviewers) stay fixed. This commit changes only
write_json. - Reviewer 2's round-4 non-blocking point (npm's second copy is not in the record): I agree that this is acceptable. The message names it.
Non-blocking
- A dangling symlink (the dotfiles file is gone):
load_jsonsees no file, so the record sayscreated: true.write_jsonthen creates the target file, and its folder, in the dotfiles location. On uninstall,remove_entriescallspath.unlink()on the config path. That removes the link, and the new dotfiles file stays. This is a rare case and loses no user data.
What I checked
- Last review: round 4, 02d0d01, 2026-11-24T07:02:06Z
- New commits read: 1 (
516276f9fix(opencode): keep a symlinked opencode.json a link) - Read in full: 8 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review: none in the conversation. Reviewer 2's round-4 review (07:02:02Z) was posted 4 seconds before mine. I read it in full in this round (see above). The newest author comment is from 06:57:45Z, and I read it in round 4. The new commit has no reply comment; its message names the fix.
- The whole
516276f9diff (2 files). I checked every caller ofwrite_json: the two config files ininstall_plugin,remove_entries, andsave_record. Each one works with a resolved path.shutil.copy2for the backup follows the link, so the backup holds the content. remove_entrieswith a symlinked config:write_jsonwrites through the link.path.unlink()(only for a file the installer created) removes the link, not the target.git diff --name-only 30a80767..HEADstill shows only the 13 PR files.- I did not run the tests (live tests not approved).
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.325 | offload-review skill, @vz-ibm's session | resumed | 2 of 2 | 5 of 5 | 516276f949a9 |
approve |
Verdict: approve
Findings
None.
Earlier findings
- Reviewer 1, round 2, non-blocking point (a symlinked
opencode.jsonbecomes a regular file): fixed. The author first left it for a follow-up, and now fixes it in this PR.write_jsonresolves the path withos.path.realpathbefore the write. The temp file goes into the target's folder, andos.replacereplaces the target, not the link. The mode check reads the target's mode.test_install_writes_through_a_symlinked_config_and_keeps_the_linkchecks both: the link stays a link, and the dotfiles file gets the new entry. Both assertions can fail with the old code. - All earlier findings of both reviewers (rounds 1 to 4) stay fixed.
516276f9changes onlywrite_jsonand adds one test. - My round-4 non-blocking point (a second OpenCode from npm stays after uninstall): no change. The message tells the user, so I still accept it.
Non-blocking
- install_opencode.py:244, 368-371 — a rare case with a dangling symlink (the link exists, its target does not). At install,
path.exists()is false, so the record sayscreated: true.write_jsonthen creates the target file in the dotfiles folder. At uninstall, when only$schemais left,path.unlink()removes the link, and the target file stays in the dotfiles folder with only$schema. No user data is lost. Checkingpath.is_symlink()forcreatedwould avoid it.
What I checked
- Last review: round 4, 02d0d01, 2026-11-24T07:02:02Z
- New commits read: 1 (
516276f9fix(opencode): keep a symlinked opencode.json a link) - Read in full: 8 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-4 review (2026-11-24T07:02:06Z, approve, no new findings). I read it. It agrees with my round-4 status of each finding.
- No new comment from the author after 2026-11-24T06:57:45Z. The commit message says what changed. I checked it against the code.
- The full diff
02d0d016..516276f9: 2 files. I readwrite_jsonand each caller after the change:install_plugin(both config files),save_record(the record), andremove_entries(uninstall). shutil.copy2for the backup follows the link, so the backup holds the target's content.- A symlinked config folder (
~/.config/opencodeas a link) also resolves to the right target. - No change to the plugin or the proxy. No live tests were run (not approved).
#1296 squash-merged into main as 25580ca. The conflicts are its own files; the result is main plus this PR's own change (516276f..66ec58e). Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]>
… it works (#1414) docs(opencode): design and plan for the installer's provider setup The installer will set up the model connection (direct, or a custom gateway URL), start OpenCode's own login, and pass only when the proxy counted a request. The owner approved the design on 2026-11-25. feat(opencode): ask how the user reaches the models, before any change The installer now says first that context-guru routes Anthropic and OpenAI models only. The user picks a direct connection, a custom base URL (a company gateway), or exits with no change. A gateway gets its own provider id (anthropic-gateway or openai-gateway), so a direct login's key never goes to it. CG_OC_GATEWAY_URL, CG_OC_API, CG_OC_MODEL and CG_OC_SMALL_MODEL answer the questions for a scripted install. feat(opencode): set up a gateway connection, and restore it key by key On the gateway path the installer writes the gateway provider, its 2 models, model and small_model into opencode.json. The record keeps each key's value from before the first install. Uninstall puts a key back only while it still has the installer's value, so a later edit by the user stays. A second run with the same answers changes nothing. feat(opencode): start OpenCode's login, and undo when it cannot route A new Login step reads `opencode auth list`. Without a login for the provider, it runs `opencode auth login` on the user's terminal, so OpenCode stores the key and the installer never sees it. For a gateway it says first: pick Other, then type the gateway id, because `-p` refuses custom ids. A failed login, or a login to a provider that context-guru cannot route, offers to undo the install and exits 1. Uninstall logs out only a login that the installer started. feat(opencode): pass the check only when the proxy counted the request The test prompt is now default yes, and it decides the exit code. It passes only when OpenCode answered, the proxy is up, and the proxy counted at least 1 request. Each failure names its cause: the proxy did not start (with the log path), no answer (key, URL or model), or 0 requests (the provider is not routed). The consent text names the connection: directly, or the gateway's host. The test that expected "opencode auth login" when the proxy is down is removed. That hint was wrong for gateway users (#1384); the new test for that case expects the proxy's log path. docs(opencode): the gateway setup, its data use, and a key canary test The how-to guide gets the new steps and a "company gateway" section: the questions, the gateway provider ids and why, the login's "Other" choice, and the CG_OC_* variables. The data-dependence row names the 2 new reads (provider names from `opencode auth list`, and the proxy's request count) and what the record keeps. The canary test drives a fake key through install, check and uninstall, and asserts that it is in no output, record or config file. A version of the installer that prints OpenCode's key file fails it. fix(opencode): refuse a key in the gateway base URL, and never echo it A pasted base URL such as https://user:token@gw/v1, or one with a query or fragment, went into opencode.json and the install record, and the error text repeated it. The installer now refuses a user name, password, query or fragment, and its messages never repeat the URL. docs(opencode): amend the design: the installer asks the gateway key In the owner's test, OpenCode's login menu started from the installer showed nothing, and the menu lists no provider from opencode.json, so a user had to pick Other and type the id. The owner picked "base URL, then key": the installer asks for the key, checks it with the model list, and writes it to OpenCode's own key file only. feat(opencode): ask the gateway key, check it, and list the models On the gateway path the installer asks: the base URL, the API format, then the key (hidden input), with an example for each. It checks the key with GET /v1/models, asks again when the gateway refuses it, and lets the user pick the model and the small model from the list. The key goes to OpenCode's own auth.json (mode 0600, other entries stay). It is never shown, logged or recorded, and only the gateway gets it. Also from the owner's test: the first step shows the config folder, the consent names the choice, the direct path says what to pick in OpenCode's list, and Ctrl-C stops with exit 130 and no traceback. feat(opencode): an install turns context-guru on again in every project /context-guru-uninstall leaves a marker in that project's state folder, and a re-run of the installer never looked at it, so the project stayed off. The owner decided: running the installer means "turn it on". After the consent, the installer removes each marker and names the project folders. An undo of the run puts the markers back. feat(opencode): the installer names projects that are off, keeps them so Owner decision (2026-11-25), which replaces b9279ce: a project where the user ran /context-guru-uninstall stays off after a re-run of the installer, because that was the user's choice there. The installer names those project folders (only folders that still exist) and says to run /context-guru-install in a project to turn it on again. chore(opencode): mark OpenCode 1.19.6 as tested The owner's end-to-end run on macOS passed on OpenCode 1.19.6: the gateway install with a real key, the check through the proxy, the uninstall inside OpenCode, and the way back with /context-guru-install. The Linux Docker run passed on 1.19.6 too. fix(opencode): the review findings of round 1 on #1414 - The key check does not follow a redirect: urllib copied the key headers to the redirect target, also over http. - The one-upstream check also counts agent.*.model, as the plugin does. - Uninstall and undo remove the gateway key from auth.json directly, instead of an unchecked `opencode auth logout`. A key that was there before the install stays. A symlinked auth.json stays a link. - Ctrl-C at the direct login offers the undo, instead of "nothing more was changed" with the plugin on. - A key with a control character is refused; http.client's error would have held the key. - The small-model default without a haiku model is the model. Behavior change (the installer asks how the user reaches the models; the gateway path asks for the URL and key, checks the key and lists the models; the test prompt defaults to yes) decided by the plugin owner (vz-ibm) and approved by the owner in the integrator session: "1414 and 1291 I agree on the change". Approvals at 66ec58e carried over: the merge of main after #1296 left exactly this PR's change. Assisted-By: Claude Opus 5.5 Signed-off-by: DAVID AMID <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
This PR uses the concept of the Pi installer (#1294, in v0.7.7). Its base is
main.Behavior change: none for existing users. The release gets 3 new files. The plugin and the proxy do not change.
Data dependence: none. The installer reads version numbers and the
pluginlists of OpenCode's 2 config files. It reads, asks for and stores no key. See the new row indocs/data-dependence.md.Summary
One command installs context-guru for OpenCode, on macOS and Linux:
Today a user clones the repo and edits
opencode.jsonandtui.jsonby hand. A second clone makes a second entry, and then 2 copies of the plugin load.What changed
opencode-plugin/release/install-opencode.sh: downloads the plugin tarball, checks its SHA-256, and runs the installer. It is the same asinstall-pi.sh, with other names.opencode-plugin/scripts/install_opencode.py: the installer.sudo. The plugin is tested on 1.19.5 only, and the installer says so for another version. A pre-release counts as its release, so it is never downgraded.~/.local/share/context-guru-opencode/plugin/, and the globalopencode.jsonandtui.jsonget its entries. It removes another copy of the plugin and keeps that copy's options. Other entries stay. A JSONC file stops the install, and the installer prints the entries to add by hand.opencode-plugin/release/package.sh: builds the tarball and its SHA-256 list.release.yaml: builds the tarball and attaches it with the 2 other files..gitignoregets/opencode-dist/.opencode-plugin.yaml(CI): also runs the 2 Python test files.docs/how-to/install-opencode-plugin.mdand in the plugin README.How it was tested
test_install_opencode.py: 25 tests. npm,opencodeand the plugin scripts are fakes. The config files are real, in a temp HOME.test_release.py: 11 tests. The bootstrap goes through bash against a local release server. They cover a SHA mismatch, unsafe names, and no terminal.Not tested: a real model answer through the proxy (the temp HOME had no login), Linux, and the release workflow (it runs only on a tag).
Open questions