install: a fresh box's opencode gets a config, and a lane added later its provider

- A box with no ~/.config/opencode/opencode.json gets this repo's (it was a
  printed cp: a first install left opencode answering "Provider not found:
  qwen38"). A config that exists is never overwritten.
- A config with one of this repo's providers gains the provider of a lane
  installed since (oc-merge-limits.py --add-providers: targeted edit, backup,
  read back and compared, restored if anything else moved). The 27B first and
  the flash lane later left opencode sending the 27B's limits to the flash lane.
- A missing opencode is said plainly where a first-time user meets it: the
  installer's step 7 and last lines, the oc launcher, the cockpit's Agent tab.
- The last lines name a command the user's shell can run, and the config
  opencode actually reads.
- CI: the unittest step prints what failed instead of dying silently.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hasan BasbunarandClaude Opus 5.5 committed 2026-09-23 15:17:30 +02:00
1 parent caa596ad79
commit f89f4f31c2
9 files changed
+416 -20

No files matched your search

+11 -5
View File
@@ -4,11 +4,17 @@ What the installer writes for [opencode](https://opencode.ai), why each piece is
The installer writes a complete, ready-to-use [opencode](https://opencode.ai) config at `~/.config/qwen38/opencode.json` (the API key is referenced via `{file:...}`, no secret inside). It contains one provider per installed engine (`qwen38` for the 27B pair, `flashnext` for flash), each with `low` / `medium` / `xhigh` reasoning-effort variants (no variant = the template's own default, xhigh), and its default model follows the installed target (`./switch-model.sh` re-points it on every switch):
A box with no opencode config of its own gets this one as `~/.config/opencode/opencode.json`
(since v1.18.4: before, it was printed as a `cp` command, and a first install left opencode,
`oc` and the Agent tab with no provider for the box's own model, "Provider not found: qwen38").
A config you already have is kept: the installer merges the served lane's limits into it,
and adds the provider of a lane installed since (the 27B first, the flash lane later) when
it already has one of this repo's providers. When it has none of them, the installer says
so and leaves it alone: merge the `qwen38` (and/or `flashnext`) block from
`~/.config/qwen38/opencode.json` into it yourself.
```bash
# no opencode config yet? use it as-is:
mkdir -p ~/.config/opencode && cp ~/.config/qwen38/opencode.json ~/.config/opencode/opencode.json
# already have one? merge the "qwen38" (and/or "flashnext") provider block into it
opencode
oc # opencode on this box's model, with the output cap lifted (see below)
```
## Which opencode: one pinned version, on every box
@@ -50,7 +56,7 @@ install.
## Opting out
Do not want any of it? `./install.sh --no-opencode` (one-liner: `| bash -s -- --no-opencode`) installs the API only: no generated config, no `oc` launcher, and `switch-model.sh` never touches your opencode default model. The choice is remembered by later runs (marker `~/.config/qwen38/opencode.off`); `./install.sh --with-opencode` turns it back on. Your own `~/.config/opencode/opencode.json` is never rewritten in either mode: when the integration is on, the installer only merges into it the served lane's limits, its compaction block and, with the version pinned, `"autoupdate": "notify"`, each by a targeted edit that keeps your comments and your other providers, with a dated backup first.
Do not want any of it? `./install.sh --no-opencode` (one-liner: `| bash -s -- --no-opencode`) installs the API only: no generated config, no `oc` launcher, and `switch-model.sh` never touches your opencode default model. The choice is remembered by later runs (marker `~/.config/qwen38/opencode.off`); `./install.sh --with-opencode` turns it back on. Your own `~/.config/opencode/opencode.json` is never rewritten in either mode: when the integration is on, the installer only merges into it the served lane's limits, its compaction block, the provider of a lane installed since and, with the version pinned, `"autoupdate": "notify"`, each by a targeted edit that keeps your comments and your other providers, with a dated backup first.
What the shipped config gets right for you: