Repository navigation
Conversation
Behavior change, approved by the owner during the v0.7.6 QA run: - Old: after /context-guru-uninstall and an OpenCode restart, all six /context-guru- commands and the two ctrl+p entries stayed. - New: a start with the project's disabled marker registers no chat command (OpenCode 1 and 2) and no ctrl+p entry. It logs one line with the way back: sh <state>/context-guru-install, then restart OpenCode. - Before the restart, /context-guru-status prints enabled=no and a note that context-guru is uninstalled; the status text tells the agent to say so. Without the marker it prints enabled=yes. - The uninstall output, the plugin README and the how-to explain the way back. Fixes #1290 Signed-off-by: Vitaly Zabershinsky <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]>
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 | 230a34f27341 |
approve |
Verdict: approve
Findings
None.
Non-blocking
opencode-plugin/index.js:576and:830— two texts still name/context-guru-installas the undo, with no restart limit.- The uninstall script prints
undo=/context-guru-install. The uninstall outro tells the agent to say "/context-guru-install undoes this". The plan-phase note at:544says the same. - These are true only until the next OpenCode restart. After it, the command does not exist.
- The new note at
:575gives the correct way back, so the agent has the correct fact. But the agent can repeat the old text. Consider: "/context-guru-installin this session, orsh <state>/context-guru-installafter a restart".
- The uninstall script prints
opencode-plugin/index.js:332— the path in the way-back line has no quotes.sh /Users/First Last/.local/state/...breaks when the home path has a space.- The
apply=sh $STATE/...line at:543has the same form, so this follows the current style. A rare case.
opencode-plugin/index.js:1295-1302— no test drives thecatchpath ofdisabledStart.- When the write fails, the code only logs the line. This is fail-open and safe. A test with a read-only state directory would pin it. Small value.
- Data dependence. The PR says "None", which is correct: the change reads only the
disabledmarker.docs/data-dependence/features/opencode-fallback.mdalready covers that marker. No row edit is necessary, in my view. The PR could say that in one line. - Not yet run in a real OpenCode TUI. The PR says so. The hooks are checked only with mocks. The real check before merge is important for the
tui.jspath, because the fake TUI API in the test is small.
What I checked
- Read the full diff (7 files, +248/-14) and the code around each change:
statusScript,installScript,uninstallScript,writeCommandScripts,registerCommands,safeLog,ContextGuruPlugin,setupV2,stateDirectory/stateRoot,tui.js. - Order of checks. The OpenCode 1
confighook andsetupV2now check the marker before they register commands or write scripts. Before, both registered commands first. Routing in the disabled case is the same as before: norouteProviders, nostartProxy, no session hook,routedIdsstays empty, sochat.headersdoes nothing. - Fail open.
isDisabledisexistsSyncand does not throw.disabledStartcatches the write error.safeLogcatches log errors. The v2console.logdoes not throw. No request path changes. - The way back works after
--purge. The marker stays, so the state directory exists andwriteAtomiccan writecontext-guru-install. The install script removes the marker first, then printsresult=never-installedwheninstall.envis gone. After a plain uninstall, it findscontext-guru-startand starts the proxy. The next start registers the commands again (cycle test,disabled.test.mjs:160-180). - Status script.
uninstalledNote("$STATE")gives$STATE/context-guru-installinside double quotes, andSTATEisshQuoted. So the shell expands it safely.enabled=comes beforeinstall=;--statsoutput was already mixedkey=valuelines, so the parse does not change. - Who writes
disabled. Only the uninstall script (index.js:556). No other path can hide the commands by mistake. - Tests. 8 new tests, each with a negative pair (with and without the marker) for OpenCode 1, OpenCode 2 and the TUI. Port range 10100 does not overlap the other files (9000-9900). The two changed old tests (
commands.test.mjs:163,v2.test.mjs:156) changed on purpose and the PR says so. Their other assertions (providers untouched, no hooks, install script exists) stay. - Behavior change rule. The PR names the change at the top: who, old, new, way back, and "no switch". It says the owner decided it. I did not check that decision outside the PR text.
- Docs. README and the how-to match the code. The removed sentence ("The next OpenCode start writes the command scripts again") is now false, so removing it is correct.
- I did not run the tests. Live tests are not approved for this review.
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 | 230a34f27341 |
approve |
Verdict: approve
Findings
None.
Non-blocking
opencode-plugin/index.js:58— the way-back command is not shell-quoted.uninstalledNoteprintsrun: sh <path>/context-guru-installwith the raw path. The uninstall note atindex.js:584does the same with$STATE. IfHOME,XDG_STATE_HOMEorCONTEXT_GURU_STATEhas a space, a user who copies the line getssh: <first word>: No such file. The default root (~/.local/state/context-guru-opencode/<hash>) has no space, so most users are not affected. Fix: quote the path in the note (shQuotein the JS note;'$STATE/...'style in the scripts). The test regexes would need the same change.- The new uninstall
note=line (index.js:584) has no test. The cycle test checks onlyresult=uninstalled. A one-lineassert.matchon the new note would guard it. - Run from a shell, the install script starts the proxy with that shell's environment. Before,
/context-guru-installran inside OpenCode. Now the docs tell users to run it from any shell, socontext-guru-startinherits the user's terminal environment, not OpenCode's.startScriptusessetsid/nohup, so the proxy outlives the shell. The stub test passes with onlyPATHandHOME. I found no environment variable that the start relies on. This is a note for the real-OpenCode check, not a defect. - The PR says that it was not run in a real OpenCode TUI yet. The behavior depends on OpenCode reading the
confighook,command.transformand the TUI keymap layer only at start. Please confirm in a real session before merge, as the PR plans.
What I checked
- Read the full diff (7 files, 248+/14-) and the code around each change:
stateRoot/stateDirectory,installScript,statusScript,uninstallScript,startScript,writeCommandScripts,registerCommands,ensureProxyRunning, the v1configandchat.headershooks,setupV2, andtui.js. - Behavior change permission. The PR names who is affected, the old and new behavior, and "no switch". Issue #1290 has a comment by @vz-ibm with "Expected behavior, decided by the owner". The PR matches that proposal point by point: no command at start, one log line, status says uninstalled in the same session, docs and uninstall message updated, cycle test.
- Fail open.
isDisabledisexistsSyncand does not throw.disabledStartcatches a failedwriteAtomicand usessafeLog(v1) orconsole.log(v2), so a disabled start cannot break OpenCode. With the marker, v1 returns before routing, soroutedIdsstays empty andchat.headersdoes nothing. v2 returns beforeprovider.transform, so nohttp.requesthook is registered. Requests go straight to the provider, as before. - The way back exists after
--purge. Purge keeps thedisabledmarker andcontext-guru-install, anddisabledStartrewritescontext-guru-installat each start. The state folder exists because the marker is in it. - Status script shell text.
${uninstalledNote("$STATE")}gives... sh $STATE/context-guru-install, then restart OpenCodeinside double quotes. The text has no", backtick or other$, so the shell expands only$STATE. The test checks the expanded path. - Install script after re-enable. It removes the marker, then either reports
never-installed(purge) or starts the proxy throughcontext-guru-start. The next start registers all six commands. The cycle test covers this path with a stub binary. - TUI.
tui()returns beforeregisterPickerCommandswhen the marker exists.isDisabledjoins the other named exports ofindex.js(stateDirectory,runCommandScript, and others), so it adds no new kind of export. - Tests. The new file uses port range 10100. No other test file uses it. Each test uses its own project directory under a fresh
CONTEXT_GURU_STATE. There is notime.Sleep-style wait: the tests usewaitUntilUnhealthy. The two changed assertions incommands.test.mjsandv2.test.mjspinned the old behavior. The owner decision changes them on purpose. - Docs. I searched for stale text ("disabled for this project", "re-enables it", "next OpenCode start writes the command scripts"). I found none left.
install-opencode-plugin.md:193("uninstall, then install, then restart") still works, because the commands stay until the restart. - Data dependence. The change reads only the marker file. No row change is needed.
- I did not run the tests. Live tests are not approved for this review.
Real OpenCode test of #1291: the uninstall output said undo=/context-guru-install, but that command is gone after a restart. It now names the script path. The fallback note read as if fallback: false were set, and an agent told the user so; it now says "only if you set the plugin option fallback: false yourself". Signed-off-by: Vitaly Zabershinsky <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]>
|
Real OpenCode 1.19.5 test of this PR (sandbox, released v0.7.6 proxy): after uninstall and a restart, The test found two wording problems in the uninstall output, fixed in c69b16f:
The cycle test pins both; it failed before the fix. The suite passes 121 of 121. |
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 | c69b16f01076 |
approve |
Verdict: approve
Findings
None.
Status of earlier points
Neither reviewer raised a blocking finding in round 1. The status of the non-blocking points:
- Reviewer 2:
undo=/context-guru-installnames a command that is gone after a restart. Fixed atindex.js:576and in the plan note at:544. The cycle test pins the newundo=line (disabled.test.mjs:166). - Reviewer 2: the uninstall outro at
index.js:830says the same. Not fixed. See the first non-blocking point below. - Reviewer 1 and 2: the path in the way-back line has no quotes. Not changed, and the author did not reply. The default root has no space, so this stays non-blocking.
- Reviewer 1: the new uninstall
note=line has no test. Partly fixed. The cycle test now checks the newundo=line and the fallback note (disabled.test.mjs:166-168). It does not check thenote=after an OpenCode restart ...line at:575. Theundo=line carries the same fact, so this is enough. - Reviewer 2: no test for the
catchpath ofdisabledStart. Not changed. Still non-blocking. - Reviewer 1 and 2: not run in a real OpenCode. Done for OpenCode 1.19.5, as the author's comment says. The
ctrl+pmenu is not tested yet. It needs a person.
Non-blocking
opencode-plugin/index.js:830— the uninstall outro still has the two texts that this commit fixed in the script output.- The outro tells the agent: "(with the plugin option fallback: false, they must restart OpenCode first), and that /context-guru-install undoes this".
- The author's real test showed that an agent read the same fallback wording as "fallback: false is set" and told the user so. The outro has that wording. The agent reads it on every
/context-guru-uninstallcall. - "/context-guru-install undoes this" is true only until a restart. Now the script output says
undo=sh <state>/context-guru-install, then restart OpenCode. So the agent gets two different ways back. - Fix: use the same words as the script: "only if the user set the plugin option fallback: false (it is on by default)", and "the undo line in the output gives the way back".
- The
ctrl+pcheck in a real TUI is still open. The author's comment says so. Do it before merge, because only a fake TUI API teststui.js.
What I checked
- Last review: round 1,
230a34f273413c8857d7140d8b9f50ea7ca3f0d3, 2026-11-23T05:44:09Z - New commits read: 1
c69b16f0fix(opencode): name the install script as the way back after uninstall
- Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Review by reviewer 1, round 1, 05:44:37Z, verdict approve, no findings. I checked each of its non-blocking points (see "Status of earlier points").
- Comment by @vz-ibm, 05:51:14Z: the result of the real OpenCode 1.19.5 test and the two wording fixes. I checked both fixes in the diff and in the test. I found the same wording left in the outro at
:830(non-blocking point above).
- The diff
230a34f2..c69b16f0(2 files, +7/-3):index.js:544: the plan note now namessh $STATE/context-guru-installand says thatfallback: falseapplies only if the user set it.$STATEis inside double quotes, andSTATEisshQuoted. The new text has no", backtick or other$. So the shell expands only$STATE.index.js:574: the same fallback wording in the--yesoutput.index.js:576:undo=now names the script and the restart. The same quoting check holds.disabled.test.mjs:165-168: two new assertions in the cycle test. The first compares the expanded path exactly. The second matches the fallback text. Both can fail.
- I searched the plugin for other
/context-guru-install undoesandundo=texts. Only:830is left. - Behavior: the change is text only. It does not change what the scripts do, so the behavior-change rule does not apply to it.
- I did not run the tests. Live tests are not approved for this review.
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 | c69b16f01076 |
blocking |
Verdict: blocking
Findings
- opencode-plugin/index.js:830 — the uninstall command text still gives the agent both wordings that c69b16f removed from the script.
- What fails: the user runs
/context-guru-uninstall. The agent reads the outro, which tells it to say two things:- "with the plugin option fallback: false, they must restart OpenCode first". This is the wording that, in the real OpenCode test, made the agent tell the user that
fallback: falsewas set. - "/context-guru-install undoes this". After a restart, that command does not exist.
The script output (:544,:576) now says the correct thing. The outro is an instruction to the agent, so the agent can follow it and repeat the old, wrong text. The user then gets two different answers in one reply.
- "with the plugin option fallback: false, they must restart OpenCode first". This is the wording that, in the real OpenCode test, made the agent tell the user that
- Proof:
git show c69b16f0 -- opencode-plugin/index.jschanges only:544,:574and:576.:830at head still has(with the plugin option fallback: false, they must restart OpenCode first), and that /context-guru-install undoes this. The author's PR comment (2026-11-23T05:51:14Z) says that a real agent repeated the fallback wording to the user. Reviewer 2 (round 1, first non-blocking point) named:830for the undo part. I agree with that after my own check. The fallback part of:830is new in this round. - Fix: make the outro match the script. For example: "Tell them that open sessions now send requests straight to the provider. Only if they set the plugin option fallback: false themselves (it is on by default), they must restart OpenCode. To undo it: /context-guru-install in this session, or sh /context-guru-install after a restart, then restart OpenCode." Add one assert on
COMMAND_SPECS/the registered template, for example that the uninstall template does not containwith the plugin option fallback: false, they must.
- What fails: the user runs
Non-blocking
- Path quoting (my round-1 point; reviewer 2's second point): not fixed. The way-back lines still print
sh <path>/context-guru-installwith no quotes. The author did not reply to it. The default state path has no space, andapply=sh $STATE/...uses the same form. I accept it as a rare case. disabledStartcatch path has no test (reviewer 2's third point): not fixed. The path is fail-open and only logs. Small value.- The
note=after an OpenCode restart, ...line at:575still has no direct assert. The newundo=assert covers the same fact, so the gap is small.
What I checked
- Last review: round 1, 230a34f, 2026-11-23T05:44:37Z
- New commits read: 1 —
c69b16f0fix(opencode): name the install script as the way back after uninstall - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Author comment by vz-ibm, 2026-11-23T05:51:14Z: a real OpenCode 1.19.5 test passed, except the
ctrl+pmenu, which a person must check. It found two wording problems, fixed inc69b16f0. I checked both fixes in the script (:544,:574,:576) and the two new asserts in the cycle test. I found that the same two wordings stay in the uninstall outro (:830). That is finding 1. - Commit
c69b16f0: read in full (3 lines inindex.js, 4 lines indisabled.test.mjs).
- Author comment by vz-ibm, 2026-11-23T05:51:14Z: a real OpenCode 1.19.5 test passed, except the
- Earlier findings:
- My round 1 had no findings. Non-blocking: the note test is now fixed (asserts on
undo=and on the fallback note). The real OpenCode check is done, exceptctrl+p. Shell environment: the author's real test ran the install script and got all six commands back; no problem reported. Quoting: not fixed, accepted (see above). - Reviewer 2 round 1 had no findings. Non-blocking:
:576and:544fixed;:830not fixed (finding 1); quoting not fixed; catch-path test not fixed; data dependence "None" is correct.
- My round 1 had no findings. Non-blocking: the note test is now fixed (asserts on
- New text is correct.
fallbackis on unlessoptions.fallback === false(index.js:1308), so "(it is on by default)" is true.$STATEisshQuoted at the top of the uninstall script, and theprintfargument is in double quotes, so the path expands safely. - New test asserts.
includes(\undo=sh ${join(state, "context-guru-install")}, then restart OpenCode`)matches the script output exactly. The regex/only if you set the plugin option fallback: false yourself/matches the--yesnote at:574`. - I did not run the tests. Live tests are not approved for this review.
Round 2 of #1291: the uninstall command text, which the agent follows, still said "with the plugin option fallback: false, they must restart" and "/context-guru-install undoes this". Now it says the fallback note applies only if the user set fallback: false, and gives both ways back: /context-guru-install in this session, or the install script after a restart. A test reads the registered text. Signed-off-by: Vitaly Zabershinsky <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]>
|
Reply to round 2. Reviewer 1, finding 1 (the uninstall command text still had both old wordings): fixed in 6a9c580.
The suite passes 122 of 122. |
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 | 6a9c58070279 |
approve |
Verdict: approve
Findings
None.
Non-blocking
opencode-plugin/test/disabled.test.mjs:97— the new test uses the same project directory as the next test.- Both the new uninstall-text test (
:97) and the TUI "disabled project" test (:110) use/tmp/context-guru-disabled-c. The TUI test writes thedisabledmarker in that state folder. - Today the tests run in file order, so the new test runs first and passes. If the order changes (a move, or a random order), the new test sees the marker. Then
config.commandisundefined, andconfig.command["context-guru-uninstall"]throws aTypeError. - My round-1 review said that each test uses its own directory. That is no longer true.
- Fix: use a new letter, for example
/tmp/context-guru-disabled-i.
- Both the new uninstall-text test (
- Path quoting: not fixed, still accepted. The way-back lines in the script output print the path with no quotes. The new outro text keeps the JSON quotes, so the agent's way back is quoted. The default state path has no space.
disabledStartcatch path has no test (reviewer 2, round 1): not fixed. Fail-open, only logs. Small value.- The
ctrl+pcheck in a real TUI is still open. The author's comment says that it needs a person. Do it before merge.
What I checked
- Last review: round 2, c69b16f, 2026-11-23T05:52:15Z
- New commits read: 1 —
6a9c5807fix(opencode): make the uninstall command text match the script - Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Comment by @vz-ibm, 2026-11-23T05:57:37Z: says that my round-2 finding 1 is fixed in
6a9c5807, with a new test, and that the suite passes 122 of 122. I checked the fix and the test (see below). I did not run the suite. - Commit
6a9c5807: read in full (1 line inindex.js, 14 lines indisabled.test.mjs). - Reviewer 2's round-2 review (05:52:06Z) is older than my round-2 review, but I had not read it before. Its only open point is the
:830outro, which is the same as my finding 1. It is now fixed.
- Comment by @vz-ibm, 2026-11-23T05:57:37Z: says that my round-2 finding 1 is fixed in
- Earlier findings:
- Reviewer 1, round 2, finding 1 (the uninstall outro still had the old fallback and undo wording): fixed.
index.js:830now says "Only if they set the plugin option fallback: false themselves (it is on by default)". It gives both ways back:/context-guru-installin this session, or the install script and a restart after a restart. The old text "with the plugin option fallback: false, they must" is gone. - Reviewer 2 had no findings in round 1 or round 2. Status of its non-blocking points:
:544/:576fixed in round 2;:830fixed now; quoting and the catch-path test not changed, both accepted.
- Reviewer 1, round 2, finding 1 (the uninstall outro still had the old fallback and undo wording): fixed.
- The path rewrite in the outro. v1 passes
path(spec.script)=JSON.stringify(join(state, "context-guru-uninstall"))(index.js:861). v2 passes the sameJSON.stringify(...)form (index.js:1401). So the string ends incontext-guru-uninstall". The regex/context-guru-uninstall("?)$/replaces only that tail, and keeps the closing quote. The result is"<state>/context-guru-install". A raw path with no quotes also works, because the quote group is optional. - The new test can fail. It reads the registered v1 template. It checks the exact quoted install path, the new fallback text, and the absence of the old text. The author says that it failed before the fix. That is consistent with the old outro, which had none of the new text.
- Behavior. The commit changes only the text that the agent reads. The scripts do the same as before, so the behavior-change rule does not apply.
- I did not run the tests. Live tests are not approved for this review.
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 | 6a9c58070279 |
approve |
Verdict: approve
Findings
None.
Status of earlier points
- Reviewer 1, round 2, finding 1 (the uninstall outro at
index.js:830still has both old texts): fixed in6a9c5807. I agree. This was also my round-2 non-blocking point.- The fallback sentence now says "Only if they set the plugin option fallback: false themselves (it is on by default)". This matches the script output at
:544and:574. - The undo sentence now gives both ways back:
/context-guru-installin this session, orsh "<state>/context-guru-install"and a restart after a restart.
- The fallback sentence now says "Only if they set the plugin option fallback: false themselves (it is on by default)". This matches the script output at
- Path quoting (reviewer 1 and 2, round 1): partly fixed. The outro path keeps its
JSON.stringifyquotes. The log line (:332) and the scriptnote=/undo=lines still have no quotes. Both reviewers accepted this as a rare case. - No test for the
catchpath ofdisabledStart(reviewer 2, round 1): not fixed. Still non-blocking. The path is fail-open and only logs. - No direct assert on the
note=after an OpenCode restartline at:575(reviewer 1): not fixed. Theundo=assert covers the same fact. Accepted. - The
ctrl+pcheck in a real TUI: still open, as the author said on 05:51. A person must do it.
Non-blocking
opencode-plugin/test/disabled.test.mjs:97— the new test uses the same project directory as the next test (/tmp/context-guru-disabled-c).- The next test (TUI, disabled) writes the
disabledmarker in that directory. - Today this is safe, because
node:testruns the tests of one file in order, and the new test runs first. - If someone moves the new test after the TUI test,
hooks.configsees the marker, registers no command, andconfig.command["context-guru-uninstall"]throws. Use its own directory (for example-i).
- The next test (TUI, disabled) writes the
What I checked
- Last review: round 2,
c69b16f01076cef6e7ad64eb058774f95bb66556, 2026-11-23T05:52:06Z - New commits read: 1
6a9c5807fix(opencode): make the uninstall command text match the script
- Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Review by reviewer 1, round 2, 05:52:15Z, verdict blocking, finding 1 on
:830. I checked it against the new commit: fixed (see above). - Comment by @vz-ibm, 05:57:37Z: reply to that finding, fix in
6a9c5807, new test, 122 of 122 pass. I checked the fix and the test in the diff. I did not run the suite.
- Review by reviewer 1, round 2, 05:52:15Z, verdict blocking, finding 1 on
- The outro path rewrite.
path.replace(/context-guru-uninstall("?)$/, "context-guru-install$1").- OpenCode 1 passes
JSON.stringify(join(state, name))(index.js:856). OpenCode 2 passesJSON.stringify(join(state, spec.script))insetupV2. Both end incontext-guru-uninstall". - The regex keeps the closing quote. So the result is
"<state>/context-guru-install". The test checks this exact string. - The state directory name is a 16-character hex hash, so
context-guru-uninstallcan only match at the end.
- OpenCode 1 passes
- The new text is true.
fallbackis on unlessoptions.fallback === false(index.js:1308)./context-guru-installworks in the same session, because OpenCode keeps the commands it loaded until a restart. - The new test can fail. It reads the registered OpenCode 1 template. It checks the quoted install path, the new fallback text, and that the old fallback text is gone. The author says that it failed before the fix.
- I searched
index.jsfor other/context-guru-install undoesandwith the plugin option fallback: false,texts. None are left. - Behavior: the change is text only. It changes no script and no routing.
- I did not run the tests. Live tests are not approved for this review.
…e-after-uninstall Signed-off-by: Vitaly Zabershinsky <[email protected]> # Conflicts: # opencode-plugin/index.js
OpenCode cannot drop commands from a running session. After /context-guru-uninstall, update, preset and strategy still ran there. Now, as in the Pi package, each of them prints enabled=no with the way back and stops, and the command text tells the agent to say only that context-guru is uninstalled. A command whose script is gone (after --purge, or after the installer removed the state folder) prints the same instead of a shell error, in OpenCode 1, OpenCode 2 and the TUI. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
Owner decision (2026-11-25), which replaces "no command after an uninstall": a project with the uninstall marker registers only /context-guru-install, described "Turn context-guru on again in this project", in OpenCode 1 and 2. The other 5 commands stay gone. The way back no longer needs the hidden state path. The guard tests now use the stub proxy and stop it at the end, so the suite leaves no proxy running. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
|
Update, 2026-11-25:
Local tests: waived (owner rule) Assisted-By: Claude (Anthropic AI) [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 | 4 of 4 | b59633e2ab4e |
blocking |
Verdict: blocking
Findings
- opencode-plugin/tui.js:31-38 — in the session of an uninstall, the
ctrl+ppickers say "No preset script found", not "uninstalled".- What fails: the user runs
/context-guru-uninstall --yes, then opensctrl+p→ "Context Guru: preset" (or cache strategy) in the same session. The TUI entries stay until a restart.- The picker script now stops at
stopIfUninstalled()and prints onlyenabled=noandnote=..., with status 0. pickAndSwitchseeschoices.length === 0and shows the error toastNo preset script found. Start OpenCode once with the Context Guru plugin enabled.- The same toast shows when the script is gone:
runCommandScriptreturnsGONE_OUTPUT(enabled=no, no choices). - So the user gets a wrong message ("no script", "start OpenCode once") and no way back.
- The picker script now stops at
- Proof:
0dcb3cabsays "A command whose script is gone ... prints the same [uninstalled] ... in OpenCode 1, OpenCode 2 and the TUI". The PR body says the same. Buttui.jsis not changed in0dcb3caborb59633e2.pickAndSwitch(tui.js:28-38) reads onlychoicesandreason=no-strategy-table. It never readsfacts.enabledorfacts.note. The new testrunCommandScript for a script that is gone(disabled.test.mjs) checks the output ofrunCommandScriptonly, not what the TUI shows. No test drivespickAndSwitchwith the marker. Nothing changes on disk, so this is not a fail-open problem. It is wrong output for the new behavior. - Fix: in
pickAndSwitch, before thechoicescheck:if (facts.enabled === "no") { toast(api, "info", facts.note ?? "context-guru is uninstalled for this project"); return }. Add one test with a fakeapi.ui.toastthat runspickAndSwitchafterdisable(directory)and checks the toast text.
- What fails: the user runs
Non-blocking
- The PR body "What changed" and "How it was tested" are out of date. They still say "register no command", "8 tests" and "121 pass". The top section is correct. The code now registers
/context-guru-install, the file has 13 tests, and the author's comment says 129 pass. docs/how-to/install-opencode-plugin.md:24-29names only the shell way back. After a restart,/context-guru-installis still listed and is the simpler way. The README (:46) and the uninstall output name both. Add one line to the how-to.- The 2026-11-25 owner decision is recorded only in agent-written text. The commit, the PR body and the 15:48 comment carry
Assisted-By. CLAUDE.md says that an agent's report of a decision does not count. If @vz-ibm is the owner who decided, one short line from them on the PR closes this. disabled.test.mjs: the uninstall-text test and the TUI disabled test still share/tmp/context-guru-disabled-c. Both reviewers raised this in round 3. Not fixed and not answered. It passes today only because of file order.- Not changed, still accepted: no quotes on the path in the way-back lines; no test of the
catchpath indisabledStart. GONE_OUTPUTalso applies to/context-guru-install. If that script is gone, its note says "restart OpenCode to remove these commands", which does not help there.disabledStartrewrites the script at each start, so this case is rare.
What I checked
- Last review: round 3, 6a9c580, 2026-11-23T06:42:03Z
- New commits read: 3 PR commits, plus 55
maincommits through the merge:f11d867aMerge remote-tracking branch 'origin/main' into fix/1290-opencode-gone-after-uninstall0dcb3cabfix(opencode): after an uninstall, open-session commands change nothingb59633e2feat(opencode): keep /context-guru-install after an uninstall- The 55
maincommits (98c9a740…22a6e3cb) are already on the new base22a6e3cb. I did not review them as part of this PR. I checked the merge result through the PR diff22a6e3cb..HEAD(7 files, +413/-38), which I read in full.
- Read in full: 6 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review:
- Review by reviewer 2, round 3, 2026-11-23T06:42:04Z, approve. Its only new point is the shared test directory, the same as mine. Still open (non-blocking above).
- Comment by @vz-ibm, 2026-11-25T15:48:21Z: merge of
mainwith one conflict, the session guards, the owner decision to keep/context-guru-install, stub proxies in the guard tests, a test on macOS with OpenCode 1.19.6, 129 pass,Local tests: waived (owner rule). I checked each code claim in the diff. The TUI claim of0dcb3cabis not true (finding 1). I did not run the tests.
- Merge conflict. In
setupV2, the disabled check now comes before thectx.event.subscribeblock from #1313, so a disabled project subscribes to no event. In OpenCode 1, theeventhook stays, butcreateSignaler.handlereturns whenportis not set. The port is set only after routing, which a disabled start skips. So no signal goes out. - Disabled start, OpenCode 1.
disabledStartwritescontext-guru-installand logs once. ThenregisterCommand(config, state, INSTALL_SPEC, ENABLE_DESCRIPTION)adds only that command. It is in atry. Routing andstartProxydo not run. The state folder exists because the marker is in it. - Disabled start, OpenCode 2. The same, through
addV2Command, in atry. It returns beforeprovider.transform, so nohttp.requesthook is registered. registerCommandembed.!\if [ -f "" ]; then sh ""; else printf '%s' '<GONE_OUTPUT>'; fi`.shQuotequotesGONE_OUTPUT, which has no'. The text has newlines, but no backtick, so the!`...`block still parses. The cycle test runs the install block from the template and getsresult=re-enabled`.- Session guards.
stopIfUninstalled()is placed afterSTATE=in the update and picker scripts. It is not in the install, status or uninstall scripts. That is correct: install must clear the marker, and status must report it. I found no other caller of the picker or update scripts (installer or plugin start) that the guard could break. STOP_AT_UNINSTALLED.commandTextadds it to every command but status. The install script never printsenabled=nowhile the marker exists (it removes the marker and printsresult=re-enabled), so the rule does not stop the way back.- Tests. The guard test checks update, preset and strategy with 3 argument sets each: exit 0, exactly 2 lines,
enabled=no, then the way-back note. The gone-script tests check the v1 embed andrunCommandScript.withStartedV1stops the stub proxy infinally. - Behavior change. The PR top names the 2026-11-25 changes: who, old, new, way back, no switch. See the non-blocking point about who recorded the yes.
- Data dependence. Unchanged: the change reads only the marker file.
- I did not run the tests. Live tests are not approved for this review.
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 | b59633e2ab4e |
approve |
Verdict: approve
Findings
None.
Status of earlier points
- No reviewer raised a blocking finding in round 3. Reviewer 1 and I both approved
6a9c5807. - Shared test directory
/tmp/context-guru-disabled-c(reviewer 1 and 2, round 3): not fixed.disabled.test.mjs:100and:113still use the same directory. The author did not reply. The tests pass in file order. This stays non-blocking. - Path quoting in the log line and the script
note=/undo=lines: not fixed, accepted. The new way back is the command/context-guru-install, so the user does not need the path in most cases. The risk is now smaller. - No test for the
catchpath ofdisabledStart: not fixed, accepted. The newcatchblocks aroundregisterCommandandcommand.transformhave no test either. All of them only log. - The real OpenCode check: the author's comment (2026-11-25) says that the owner tested uninstall, restart and the way back on OpenCode 1.19.6. The comment does not say that the
ctrl+ppalette was checked.
Non-blocking
opencode-plugin/tui.js:31-38— in the session of an uninstall, thectrl+ppicker shows a wrong toast.- The palette entries stay until a restart. The user picks "Context Guru: preset".
runCommandScriptruns the picker script. The newstopIfUninstalledprintsenabled=noand the note, with status 0. parsePickerOutputfinds nochoiceline. SopickAndSwitchshows "No preset script found. Start OpenCode once with the Context Guru plugin enabled."- That text is wrong: the script exists, and context-guru is uninstalled. The commit message of
0dcb3cabsays that the TUI says "uninstalled". It does not. Nothing changes, so this is safe. - Fix: in
pickAndSwitch, whenfacts.enabled === "no", showfacts.note(or "context-guru is uninstalled for this project") as the toast. The test atdisabled.test.mjs:265checks onlyrunCommandScript, not the toast.
- The palette entries stay until a restart. The user picks "Context Guru: preset".
opencode-plugin/index.jsGONE_OUTPUT— the text assumes an uninstall. It says "context-guru is uninstalled; restart OpenCode to remove these commands" for any script that is missing. If a script is gone for another reason (for example, a user deleted the state folder while context-guru was on), a restart brings all six commands back. This is rare.docs/how-to/install-opencode-plugin.md:177-184— the "turn on again" block names only the shell script. The list above it and the README now give/context-guru-installfirst. Add it here too: "Run/context-guru-installin that project, or the script from any shell, then restart OpenCode."- The PR body "What changed" and "How it was tested" are out of date. They still say "register no command", "8 tests" and "121 pass". The top section and the 2026-11-25 comment are correct (129 pass). Update the body before merge, because the squash message may use it.
What I checked
- Last review: round 3,
6a9c580702794fc886df5ba646abaf3f7a45bead, 2026-11-23T06:42:04Z - New commits read: 3 PR commits, and the merge brings 55 commits from
mainf11d867aMerge remote-tracking branch 'origin/main' into fix/1290-opencode-gone-after-uninstall0dcb3cabfix(opencode): after an uninstall, open-session commands change nothingb59633e2feat(opencode): keep /context-guru-install after an uninstall
- Read in full: 6 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review:
- Review by reviewer 1, round 3, 06:42:03Z, approve. Its points are the same as mine (shared test directory, quoting, catch path,
ctrl+p). Status above. - Comment by @vz-ibm, 2026-11-25T15:48:21Z: the merge, the two new changes, the owner decision, the owner's test on OpenCode 1.19.6, 129 pass, and
Local tests: waived (owner rule). I checked each code claim in the diff (below). I did not run the suite.
- Review by reviewer 1, round 3, 06:42:03Z, approve. Its points are the same as mine (shared test directory, quoting, catch path,
- The merge
f11d867a. I usedgit show --remerge-diff. The only conflict is inindex.js:disabledStartand the new session signals (#1313) were added at the same place. The resolution keeps both. In OpenCode 2, the disabled check comes beforectx.event.subscribe, so a disabled project sends no signals. In OpenCode 1, theeventhook stays. Butsignaler.setPortruns only on the routed path, sohandlereturns at!port. A disabled project sends no signal in either version. Apart from the conflict, the PR diff against the new base is the same as before the merge. 0dcb3cab, guards in the open session.stopIfUninstalledruns in the update script and the picker script (preset and strategy), right afterSTATE=. It printsenabled=noand the note and exits 0, before any download, save or restart. The test atdisabled.test.mjs:228runs each of the 3 scripts with no argument,set noneand--yes, and checks exactly 2 lines.- The uninstall and install scripts have no guard, which is correct. A second uninstall (for example, with
--purge) still works. The install script is the way back. STOP_AT_UNINSTALLEDgoes into every command text except status. The install script printsresult=re-enabledwith the marker, notenabled=no, so the stop text does not block the way back.- A missing script: the OpenCode 1 template runs
if [ -f "<path>" ]; then sh "<path>"; else printf '%s' '<GONE_OUTPUT>'; fi.shQuotequotes the output, andJSON.stringifyquotes the path, as before.runCommandScript(OpenCode 2 and the TUI) returnsGONE_OUTPUTwith status 0 before it spawns.
b59633e2, keep/context-guru-install.- With the marker, OpenCode 1 calls
registerCommand(config, state, INSTALL_SPEC, ENABLE_DESCRIPTION)afterdisabledStart.disabledStartwrote the install script first, so the template finds it. OpenCode 2 does the same throughaddV2Command. Both have atry/catchand only log on an error. Routing stays off. INSTALL_SPECis found by name inCOMMAND_SPECS. It is defined at module load, so a rename would fail the tests at once.registerCommandsand the OpenCode 2 loop now use the sameregisterCommand/addV2Commandhelpers. The text for an enabled project is the same as before, plus the stop sentence and the missing-script guard.- The cycle test now takes the
!block from the registered install template and runs it in a plain shell. That tests the path that the user takes. - Tests that start a proxy now use the stub binary and stop it in
finally, withwaitUntilUnhealthy. None waits on time.
- With the marker, OpenCode 1 calls
- Behavior change rule. The top of the PR names who is affected, the old and new behavior, and "no switch". It records the owner decision of 2026-11-25 by @vz-ibm, a human developer.
- Data dependence. Still none: the change reads only the marker file and whether a script exists.
- Library or host. All changes are in the OpenCode plugin. No Go code changes, so the "What goes in the proxy" rules do not apply.
- I did not run the tests. Live tests are not approved for this review.
In the session of an uninstall, the preset and strategy pickers stay in ctrl+p until a restart. They showed "No preset script found. Start OpenCode once". Now, when the disabled marker exists, they show the script's uninstalled note and open no dialog. A missing script without the marker is still a first start, and keeps the old error toast. Also: the TUI disabled test gets its own directory, and the how-to names /context-guru-install as the way back. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
|
Reply to round 4. Reviewer 1, finding 1, and reviewer 2, non-blocking 1 (the
Shared test directory The how-to names only the shell way back (both reviewers): fixed in dbd3122. The "turn on again" text now names The PR body is out of date (both reviewers): fixed. "What changed" and "How it was tested" now match the code: only the install command after a restart, 13 + 2 tests, 131 pass, 0 fail, 4 timing tests skipped.
The owner decision is recorded only in agent-written text (reviewer 1): open. This needs one line from @vz-ibm on the PR. An agent cannot close it. Still accepted, not changed: no quotes on the path in the way-back lines, and no test of the Assisted-By: Claude (Anthropic AI) [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 | dbd31228675c |
approve |
Verdict: approve
Findings
None.
Non-blocking
- The 2026-11-25 owner decision still has no line from a person on the PR. The author's reply says that an agent cannot close this. I agree. It is a merge gate, not a code defect: before merge, @vz-ibm writes one line on the PR that confirms "keep
/context-guru-installafter an uninstall" and the in-session guards. - Still accepted, not changed: no quotes on the path in the way-back lines; no test of the
catchpaths;GONE_OUTPUTassumes an uninstall. The author's reason forGONE_OUTPUTis right: in chat, a missing script without the marker is rare, and "restart OpenCode" leads to a working state. In the TUI, the note now shows only when the marker exists.
What I checked
- Last review: round 4, b59633e, 2026-11-29T07:01:56Z
- New commits read: 1 —
dbd31228fix(opencode): the ctrl+p pickers say uninstalled after an uninstall - Read in full: 8 reviews, 4 comments, 0 inline comments (from the three files)
- New items since my last review:
- Review by reviewer 2, round 4, 2026-11-29T07:02:08Z, approve. Its first non-blocking point is the same as my finding 1 (the
ctrl+ptoast). Its other points areGONE_OUTPUT, the how-to way back and the stale PR body. I checked the status of each one below. - Comment by @vz-ibm, 2026-11-29T07:08:48Z: reply to round 4. I checked each claim against
dbd31228and the PR body:ctrl+ptoast: fixed (see below).- Shared test directory: fixed. The TUI disabled test now uses
/tmp/context-guru-disabled-tui./tmp/context-guru-disabled-cnow has only one user. - How-to way back: fixed.
install-opencode-plugin.md:177-179names/context-guru-installfirst, then the script. - PR body: fixed. The author says it now matches the code. I did not read the new body in full this round. I checked the comment's numbers against the code:
disabled.test.mjshas 13 tests andtui.test.mjshas 2 new ones. GONE_OUTPUT: not changed, with a reason. I accept the reason (above).- Owner decision: open (above).
- Review by reviewer 2, round 4, 2026-11-29T07:02:08Z, approve. Its first non-blocking point is the same as my finding 1 (the
- Earlier findings:
- Reviewer 1, round 4, finding 1 (
tui.js:31-38, wrong toast in the session of an uninstall): fixed.pickAndSwitchnow checksfacts.enabled === "no" && isDisabled(state)before thechoicescheck. Then it showsfacts.noteas aninfotoast and returns, so no dialog opens.parsePickerOutputreadsnote=...intofacts.notewith the regex^([a-z_]+)=(.*)$, so the note is the full line text. - Both cases are covered: the script exists (
stopIfUninstalledprints the way-back note), or the script is gone (runCommandScriptreturnsGONE_OUTPUT). - Without the marker, a missing script still gets the old "No ... script found. Start OpenCode once" toast. That case is a first start, so the old text is right there.
- Reviewer 1, round 4, finding 1 (
- New tests in
tui.test.mjs.- "in the session of an uninstall": starts a stub proxy through
setup, writes the marker, runspickAndSwitch(..., "preset"). It checks that no dialog opens, that exactly 1infotoast shows, and the way-back text. Infinally, it stops the stub by its pid and waits withwaitUntilUnhealthy. That is the same cleanup as the other tests in the file. - "when the picker script is gone": a fresh directory with only the marker. It checks the exact toast
{ variant: "info", message: <GONE_OUTPUT note> }and no dialog. - Both tests can fail. The author says that both failed first with the old error toast. That matches the old code, which never read
facts.enabled. - Neither new test waits on time.
- "in the session of an uninstall": starts a stub proxy through
- Fail open. The change is in the TUI only. It reads a file and shows a toast. No routing and no script behavior change.
- Data dependence. Unchanged: the change reads only the marker file.
- I did not run the tests. Live tests are not approved for this review.
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 | dbd31228675c |
approve |
Verdict: approve
Findings
None.
Status of earlier points
- Reviewer 1, round 4, finding 1 (the
ctrl+ppickers say "No preset script found" after an uninstall): fixed indbd31228. This was also my round-4 non-blocking point 1. I checked it (see below). - Shared test directory
/tmp/context-guru-disabled-c(both reviewers, rounds 3 and 4): fixed. The TUI disabled test now uses/tmp/context-guru-disabled-tui. I searched the file. No other test uses that name. - The how-to names only the shell way back (both reviewers): fixed.
install-opencode-plugin.md:177now names/context-guru-installfirst, then the script. - The PR body is out of date (both reviewers): fixed. "What changed" and "How it was tested" now say "only the install command", 13 + 2 tests, and 131 pass. One small leftover: "The uninstall output says that the commands are gone after a restart". The output now says "only /context-guru-install is left". This is not important.
GONE_OUTPUTassumes an uninstall (my round 4): not changed, and the author gave a reason. The author says: a missing script without the marker means someone deleted the state folder, and a restart writes all scripts again. So "restart OpenCode" still leads to a working state. I accept this. The TUI now shows this note only when the marker exists.- The 2026-11-25 owner decision is in agent-written text only (reviewer 1, round 4): open. I agree with reviewer 1. I checked issue #1290. Its only comment (2026-11-23) asks for no command after a restart. The change to "keep
/context-guru-install" is in the PR body, the commit and the 2026-11-25 comment. All three carryAssisted-By. CLAUDE.md says that an agent's report of a decision does not count. Before merge, @vz-ibm must write one line on the PR or the issue in their own words. This is a merge check, not a code defect, so I do not block on it. - No quotes on the path in the way-back lines, and no test of the
catchpaths: not changed, accepted by both reviewers.
Non-blocking
- The
ctrl+ppalette is still not tested in a real TUI. The PR body says so. The new fix is intui.js, which only a fake API tests. One manual check closes this: uninstall, then open "Context Guru: preset" in the same session.
What I checked
- Last review: round 4,
b59633e2ab4eb26eac1d251bdd84831ffbeccc35, 2026-11-29T07:02:08Z - New commits read: 1
dbd31228fix(opencode): the ctrl+p pickers say uninstalled after an uninstall
- Read in full: 8 reviews, 4 comments, 0 inline comments (from the three files)
- New items since my last review:
- Review by reviewer 1, round 4, 2026-11-29T07:01:56Z, blocking, finding 1 on
tui.js:31-38. It is fixed (see above). I also checked its non-blocking points: the PR body, the how-to, the owner decision, the shared directory andGONE_OUTPUT. Their status is above. - Comment by @vz-ibm, 2026-11-29T07:08:48Z: a reply to each round-4 point. I checked each "fixed" claim in the diff and in the PR body. I checked the
GONE_OUTPUTreason and accept it. I agree that the owner-decision point stays open. - I also read the comment on issue #1290, to check the owner decision.
- Review by reviewer 1, round 4, 2026-11-29T07:01:56Z, blocking, finding 1 on
tui.js:32-36, the new check.pickAndSwitchruns the picker script. With the marker,stopIfUninstalledprintsenabled=noandnote=<way back>, with status 0.parsePickerOutputputs both infacts. The new check showsfacts.noteas aninfotoast and returns before any dialog.- With the marker and no script,
runCommandScriptreturnsGONE_OUTPUT. That hasenabled=noand a note too, so the same check shows that note. - Without the marker, the check does not run. A missing script then gives
GONE_OUTPUT, no choices, and the old "No … script found. Start OpenCode once" toast. That is correct for a first start. isDisabledwas already imported intui.js. The check runs beforeshown.statusandchoices, so theno-strategy-tablepath does not change.- The
setand--restartcalls inconfirmSwitchandconfirmRestartcannot run after an uninstall in this flow, because the select dialog never opens.
tui.test.mjs, 2 new tests.- Test 1 starts a stub proxy through
setup, writes the marker, runspickAndSwitchand checks: no dialog, 1infotoast, and the way-back text. Infinally, it kills the recorded pid and waits withwaitUntilUnhealthy. There is no wait on time. - Test 2 uses a fresh folder with only the marker. It checks the exact
GONE_OUTPUTnote. - Both can fail: the old code showed an
errortoast with other text, and the author says that both failed first.
- Test 1 starts a stub proxy through
- Docs. The how-to text matches the README and the uninstall output.
- Behavior. The commit changes only what the TUI shows in an uninstalled project. It changes no script and no routing. Data dependence is still none.
- I did not run the tests. Live tests are not approved for this review.
|
Real OpenCode test of dbd3122 (OpenCode 1.19.6, macOS, empty test folder, the plugin files of this PR installed). @vz-ibm did the TUI steps.
Found during the test, not in this PR's scope: the OpenCode agent said that the uninstall is global when the plugin is in the global config. It is not. Filed as #1549. Assisted-By: Claude (Anthropic AI) [email protected] |
|
Addition to the real OpenCode test above, after an OpenCode restart in the same test folder (@vz-ibm did the steps):
Assisted-By: Claude (Anthropic AI) [email protected] |
…e-after-uninstall Signed-off-by: Vitaly Zabershinsky <[email protected]> # Conflicts: # opencode-plugin/test/tui.test.mjs
|
Approved change |
Behavior change (decided by the owner, @vz-ibm: the v0.7.6 QA run, updated 2026-11-25)
/context-guru-uninstallin a project./context-guru-commands and bothctrl+pentries stayed./context-guru-statusstill answered and never said "uninstalled". In the session of the uninstall,update,presetandstrategystill changed things./context-guru-install("Turn context-guru on again in this project"), in OpenCode 1 and 2. The other 5 commands and thectrl+pentries are gone. Other projects are not changed. (2026-11-25: the owner changed "no command" to "keep the way back".)update,presetandstrategychange nothing: they printenabled=noand the way back, as the Pi package does./context-guru-statusprintsenabled=no.--purge, or after the installer removed the state folder) says "uninstalled" instead of a shell error.-s uninstall(owner decision, 2026-11-25)./context-guru-installin that project, then restart OpenCode.Summary
The owner expected that after uninstall and a restart, context-guru is no longer visible in OpenCode. v0.7.6 kept the commands, because the plugin registered them before it checked the
disabledmarker.Fixes #1290
What changed
opencode-plugin/index.js:confighook andsetupV2check thedisabledmarker first. With the marker, they rewrite only thecontext-guru-installscript (so the script that the log line names always exists, also after--purge), register only/context-guru-install, log the line once, and return. Routing stays off.isDisabled(state)anduninstalledNote().enabled=yesorenabled=nowith the note. The status command text tells the agent to report "uninstalled" first.enabled=noand the way back, and change nothing. Every command text but status tells the agent to stop atenabled=no.enabled=noand a note, not a shell error./context-guru-installis left after a restart, and names the way back.opencode-plugin/tui.js: registers noctrl+pentry for a disabled project. In the session of an uninstall, the pickers show the uninstalled note and open no dialog. A missing script without the marker keeps the old "No ... script found" toast (first start).opencode-plugin/test/disabled.test.mjs(new): 13 tests, port range 10100.opencode-plugin/test/tui.test.mjs: 2 new tests for the pickers after an uninstall.opencode-plugin/test/commands.test.mjs,opencode-plugin/test/v2.test.mjs: two tests that pinned the old behavior now expect only the install command (changed on purpose).opencode-plugin/README.md,docs/how-to/install-opencode-plugin.md: a section "After an uninstall and a restart", with/context-guru-installas the way back. The sentence "The next OpenCode start writes the command scripts again" is removed, because it is no longer true.Data dependence
None. The change reads only the
disabledmarker file.How it was tested
node --test opencode-plugin/test/*.test.mjs: 131 pass, 0 fail, 4 skipped (the 4 timing tests, which needCG_TIMING_TESTS=1). 113 passed before the PR.enabled=line in status, and the "No preset script found" toast in the session of an uninstall./context-guru-install. The block from that command's template, run in a plain shell, printsresult=re-enabled. The next start registers all six.ctrl+ppalette is not tested in a real TUI (it needs a person).Assisted-By: Claude (Anthropic AI) [email protected]
Local tests: waived (owner rule)