From 2e7bee5f6169c53595d6b85bce97357289efc487 Mon Sep 17 00:00:00 2001 From: Lap Tran Date: Tue, 6 Oct 2026 11:18:16 -0400 Subject: [PATCH] feat: route firstmate crews to opencode harness crew-dispatch.json: UI/image rule and default select opencode; models (muse-spark-1.3-contributor, deepseek-v4.1-flash), providers, and reasons unchanged. AGENTS.md records opencode crews and the spawn-owned opencode-store login instead of Pi ambient auth. --- AGENTS.md | 2 +- home/.config/firstmate/crew-dispatch.json | 18 +++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2d38feb..5154e6e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ Deliberate decisions in this repo - do NOT silently revert them: - Pi is managed the same way: `home/.pi/agent/{settings,models}.json`, `themes/`, and custom extensions (`terminal-status-title`, `calm`). Do not symlink the whole `~/.pi/agent` tree - sessions, auth, npm cache, and herdr's `extensions/herdr-agent-state.ts` stay live. - 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. Launch with shell alias `fm` (`cd` + OpenCode 2 via `~/.local/bin/oc2`). Self-update via `/updatefirstmate`, not rebuild. +- 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): default `opencode` + `opencode-go/deepseek-v4.1-flash`; UI/image work uses `opencode` + `opencode-go/muse-spark-1.3-contributor`, which needs the OpenCode Go "Allow models that train on request data" workspace opt-in. Crews inherit the primary's `opencode-go` 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` + OpenCode 2 via `~/.local/bin/oc2`); the primary stays OpenCode 2, only crews run on the opencode harness. Self-update via `/updatefirstmate`, not rebuild. - OpenCode 2 is the firstmate primary. It is not a Homebrew formula: install `@opencode-ai/cli@beta` with Homebrew's npm (`home.activation.opencode2`). Launch through `home/bin/oc2` so `OPENCODE_CONFIG` stays at `home/.config/opencode2/opencode.json` and cannot rewrite OpenCode 1.x's `~/.config/opencode`. Do not add a brew `opencode` / `opencode2` formula; `zap` would fight the npm install. firstmate harness detection matches `*opencode*`, so the `opencode2` process name still classifies as OpenCode. - Shell aliases: `cc` (Claude skip-permissions), `co` (Codex full-auto), `gb` (Grok --yolo), `fm` (firstmate via OpenCode 2), `oc2` (OpenCode 2, isolated). They are intentional high-agency shortcuts. diff --git a/home/.config/firstmate/crew-dispatch.json b/home/.config/firstmate/crew-dispatch.json index d2ce3de..d69cfa8 100644 --- a/home/.config/firstmate/crew-dispatch.json +++ b/home/.config/firstmate/crew-dispatch.json @@ -1,20 +1,12 @@ { "rules": [ - { - "when": "Well-specified implementation with clear acceptance criteria: pure functions, tests, repositories, adapters, or external-fetch integration.", - "use": [{ "harness": "opencode", "model": "opencode-go/deepseek-v4.1-flash", "provider": "opencode-go" }], - "why": "DeepSeek V4.1 Flash is the default OpenCode Go implementation worker; it is fast, economical, and strong on agentic coding tasks." - }, { "when": "UI work where supplied screenshots or other image context materially affect the implementation or verification.", - "use": [{ "harness": "opencode", "model": "opencode-go/glm-5.3-flash", "provider": "opencode-go" }], - "why": "GLM-5.3-Flash is the Go worker with image input; use it when visual context matters." - }, - { - "when": "Ambiguous investigation, difficult debugging, architectural tradeoffs, or broad changes with high uncertainty or blast radius.", - "use": [{ "harness": "opencode", "model": "opencode-go/gpt-6-luna", "provider": "opencode-go" }], - "why": "Reserve GPT-6 Luna for work that benefits from stronger reasoning than the fast implementation tier." + "use": [{ "harness": "opencode", "model": "opencode-go/muse-spark-1.3-contributor", "provider": "opencode-go" }], + "why": "Muse Spark 1.3 Contributor is the vision-capable Go model for work where supplied screenshots or image context matter." } ], - "default": [{ "harness": "opencode", "model": "opencode-go/deepseek-v4.1-flash", "provider": "opencode-go" }] + "default": [ + { "harness": "opencode", "model": "opencode-go/deepseek-v4.1-flash", "provider": "opencode-go" } + ] }