From 2a147c911a4c4691fccc678f2e5e4d2959442f80 Mon Sep 17 00:00:00 2001 From: Lap Tran Date: Sun, 8 Nov 2026 12:23:20 -0500 Subject: [PATCH] no-mistakes(review): Remove retired OpenCode 2 npm beta during rebuild --- AGENTS.md | 2 +- rebuild.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 2f7719b..8ca2b0f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,7 @@ Deliberate decisions in this repo - do NOT silently revert them: - herdr stores runtime state beside its config, so `~/.config/herdr` stays a real directory and only `config.toml` is symlinked; `home.activation.herdrConfigDir` migrates the old whole-directory symlink and clears leaked artifacts. Do not symlink the whole directory - rationale and artifact list are in `home.nix`. - Codex runs on the OpenCode Go subscription. The ChatGPT app owns and rewrites the live `~/.codex/config.toml`, so it is NOT symlinked; `home.activation.codexOpenCodeGo` merges the repo fragment `home/.codex/config.toml` into it on every rebuild, and the app's own sections (`[desktop]`, `[plugins]`, `[mcp_servers]`, ...) survive. Auth is command-backed via `~/.local/bin/opencode-go-token` (prints the key from the opencode store), so `~/.codex/auth.json` stays in ChatGPT mode and ChatGPT sign-in coexists with Go. Only Go models that speak the Responses API work (`deepseek-v4.1-flash`, `gpt-6-luna`, `gpt-5.6-luna`, `grok-4.7/4.6`); GLM/Kimi/MiMo/LongCat are chat-completions-only and need a proxy. Desktop Codex is now the `chatgpt` cask - do not use the deprecated `codex-app` cask. - firstmate lives at `~/Documents/firstmate` as a mutable git clone (not in the Nix store). `home.activation.firstmate` clones it if missing and seeds `config/backend=herdr` + `config/crew-harness=opencode` only when those files are absent. Crew routing is `home/.config/firstmate/crew-dispatch.json` (symlinked in): per the captain's order 2026-10-21, coding crewmates and scouts use `opencode` + `opencode-go/deepseek-v4.1-flash` through the OpenCode CLI. Design, architecture, and design-review tasks are the exception: the file's first rule sends them to Pi with `openai-codex/gpt-6.1-sol` at `xhigh`, and implementation tasks re-resolve their profile instead of keeping that model. The free `deepseek-v4.1-flash-free` order of 2026-10-20 resumes when that lane resets. The validation pipeline stays on Pi with `opencode-go/deepseek-v4.1-flash` steps and the `opencode-go/glm-5.3-flash` reviewer. Avoid the `muse-spark-*-contributor` models, which train on prompts, and the `exo-free`, `mimo-*-free`, and `nemotron-*-free` models, whose data may be used to improve the model. `cat-jam-free` retains for 30 days. Crews inherit the primary's OpenCode login through the spawn-owned symlink (the isolated worker data root links the primary `/opencode/auth.json`; no `~/.pi/agent/auth.json` reliance). Launch with shell alias `fm` (`cd` + `pi` with the two firstmate primary extensions); the primary runs Pi on the OpenCode Go subscription, while crews run on the opencode harness unless a dispatch rule selects another harness. `oc2` remains the isolated OpenCode 2 fallback. Self-update via `/updatefirstmate`, not rebuild. -- OpenCode 2 is the isolated OpenCode harness behind `oc2`, not the firstmate primary. It is the stable Homebrew `opencode` formula, installed with `link = false` so the OpenCode 1.x CLI keeps `/opt/homebrew/bin/opencode`, and launched only through `home/bin/oc2` so `OPENCODE_CONFIG` stays at `home/.config/opencode2/opencode.json` and cannot rewrite OpenCode 1.x's `~/.config/opencode`. Switching between builds needs `opencode service restart`, because the client refuses a background service left over from the other build with `Background service uses an incompatible health protocol`. firstmate harness detection matches `*opencode*`, so it still classifies as OpenCode. +- OpenCode 2 is the isolated OpenCode harness behind `oc2`, not the firstmate primary. It is the stable Homebrew `opencode` formula, installed with `link = false` so the OpenCode 1.x CLI keeps `/opt/homebrew/bin/opencode`, and launched only through `home/bin/oc2` so `OPENCODE_CONFIG` stays at `home/.config/opencode2/opencode.json` and cannot rewrite OpenCode 1.x's `~/.config/opencode`. Switching between builds needs `opencode service restart`, because the client refuses a background service left over from the other build with `Background service uses an incompatible health protocol`. The npm beta package `@opencode-ai/cli` that `home.activation.opencode2` used to install is removed by `rebuild.sh` at rebuild time, so the stable formula is the only OpenCode 2 install. firstmate harness detection matches `*opencode*`, so it still classifies as OpenCode. - Shell aliases: `cc` (Claude skip-permissions), `co` (Codex full-auto), `gb` (Grok --yolo), `fm` (firstmate via Pi), `oc2` (OpenCode 2, isolated). They are intentional high-agency shortcuts. - OpenSuperWhisper is installed by the `opensuperwhisper` cask, and `home.activation.openSuperWhisper` downloads its Whisper model (`ggml-large-v3-turbo.bin` under the app's Application Support directory, never the Nix store) and seeds the model selection only when it is missing or dangling. All other app settings (trigger, language, paste behavior) belong to the app and must not be rewritten by a rebuild, so `modifierOnlyHotkey = rightOption` on this machine stays the effective trigger. Microphone/Accessibility/Input Monitoring grants stay manual because macOS TCC cannot be declarative; do not kill a running app to apply defaults. The model is local-only. diff --git a/rebuild.sh b/rebuild.sh index d24b115..11f0139 100755 --- a/rebuild.sh +++ b/rebuild.sh @@ -32,6 +32,21 @@ else echo "==> OpenCode 1.x already installed: $(${OPENCODE_BIN} --version)" fi +# Remove the retired OpenCode 2 beta (@opencode-ai/cli, binary "opencode2") if +# an older rebuild installed it. The stable Homebrew `opencode` formula declared +# in configuration.nix is now the only OpenCode 2 install. Local check only, so +# an offline rebuild skips this instead of failing. +NPM=/opt/homebrew/bin/npm +if [ -x "$NPM" ] && beta_root="$("$NPM" root -g 2>/dev/null)" && [ -d "$beta_root/@opencode-ai/cli" ]; then + echo "==> Removing retired OpenCode 2 beta (@opencode-ai/cli)..." + if "$NPM" uninstall -g @opencode-ai/cli 2>&1; then + echo "==> OpenCode 2 beta removed" + else + echo "==> WARNING: OpenCode 2 beta removal failed. Remove it manually:" + echo " $NPM uninstall -g @opencode-ai/cli" + fi +fi + echo "==> Updating no-mistakes..." NO_MISTAKES_BIN="$HOME/.no-mistakes/bin/no-mistakes" if [ -x "$NO_MISTAKES_BIN" ]; then