diff --git a/docs/opencode.md b/docs/opencode.md index e2503667..beeb26c7 100644 --- a/docs/opencode.md +++ b/docs/opencode.md @@ -123,7 +123,7 @@ install. ## OpenCode 2, opt-in -OpenCode 2 is not the default of anything: the box stays on the tested 1.19.6 until you ask. `./install.sh --opencode 2` (one-liner: `| bash -s -- --opencode 2`) installs the pinned 2.3.2 (GitHub's release asset, `OPENCODE2_VERSION` with its `OPENCODE2_SHA256`, refused without its checksum like 1.x), remembers the choice in `~/.config/qwen38/opencode.major`, and wires everything to it: the Agent unit, the `oc` launcher, the generated config. `./install.sh --opencode 1` goes back: it takes this repo's `permissions` array out of your global config (OpenCode 1.19 refuses to start while one holds it, measured against 1.19.5 on 2026-11-14; an array that is not the one this repo wrote is left alone and said, with the way back), erases the marker and installs the pinned 1.x again. A stray 2.x found on the PATH (Homebrew Core's formula is one) never opts a box in: the choice wins, and a run that cannot download serves neither major as the other. +OpenCode 2 is not the default of anything: the box stays on the tested 1.19.6 until you ask. `./install.sh --opencode 2` (one-liner: `| bash -s -- --opencode 2`) installs the pinned 2.3.2 (GitHub's release asset, `OPENCODE2_VERSION` with its `OPENCODE2_SHA256`, refused without its checksum like 1.x), remembers the choice in `~/.config/qwen38/opencode.major`, and wires everything to it: the Agent unit, the `oc` launcher, the generated config. `./install.sh --opencode 1` goes back: it takes this repo's `permissions` array out of your global config (OpenCode 1.19 refuses to start while one holds it, measured against 1.19.5 on 2026-11-14; an array that is not the one this repo wrote is left alone and said, with the way back), erases the marker and installs the pinned 1.x again. If you installed the v2 plugin by hand, take it out too: `rm -f ~/.config/opencode/plugins/auto-continue-v2.js` (1.x does not run a default-export plugin; the file would sit there dead). A stray 2.x found on the PATH (Homebrew Core's formula is one) never opts a box in: the choice wins, and a run whose download fails keeps serving the OpenCode already installed and writes nothing for the other major (no marker, no config key, no unit), so no mixed state is left behind; re-run `./install.sh --opencode ` once GitHub is reachable to install the pin. What the 2.x server is, measured on 2.3.0 on this box (the binary, its answers and its bundle, 2026-11-14 and 15): diff --git a/tests/test_docs_facts.py b/tests/test_docs_facts.py index 2389e06d..c55a8d88 100644 --- a/tests/test_docs_facts.py +++ b/tests/test_docs_facts.py @@ -364,5 +364,26 @@ class ThePrivilegedPathNamesWhatSudoRuns(unittest.TestCase): self.assertIsNone(named.search(ln), f"ARCHITECTURE.md: {ln.strip()!r} puts {word} beside sudo") +class TheRollbackInOpencodeMdIsComplete(unittest.TestCase): + """docs/opencode.md's OpenCode 2 section is the return path's instructions: going back to + 1.x must also take the v2 plugin out of the plugins directory (1.x does not run a + default-export plugin, the file stays dead), and a run whose download fails must be + described as it behaves: it keeps serving the OpenCode already installed and writes + nothing for the other major (blind review of 2026-11-20, D7 and D2/D3).""" + + def section(self): + text = (REPO / "docs/opencode.md").read_text() + i = text.index("## OpenCode 2, opt-in") + return text[i:text.index("## Opting out", i)] + + def test_going_back_to_1x_names_the_v2_plugin_removal(self): + self.assertIn("rm -f ~/.config/opencode/plugins/auto-continue-v2.js", self.section()) + + def test_a_failed_download_is_said_to_keep_serving_what_is_installed(self): + s = self.section() + self.assertIn("keeps serving the OpenCode already installed", s) + self.assertIn("writes nothing for the other major", s) + + if __name__ == "__main__": unittest.main(verbosity=2)