Compare commits

...
Author SHA1 Message Date
Lap Tran 2e7bee5f61 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.
2026-10-06 11:18:16 -04:00
hermes ca3c7fa45a Merge pull request 'fix: keep herdr runtime state out of the dotfiles working tree' (#3) from fm/fm-clone-runtime-dirt-dotfiles into main 2026-10-06 10:25:44 -04:00
Lap Tran 2bcaf5fd32 no-mistakes(document): Point herdr state-file rationale at the cleanup list 2026-10-05 23:19:25 -04:00
Lap Tran b0d7087a46 fix(rebuild): rotate herdr config.toml backup as a file target
~/.config/herdr moved from a whole-directory home.file target to a file
target, so rebuild.sh must follow. Treat ~/.config/herdr/config.toml as a
managed file backup target and stop listing ~/.config/herdr as a directory
target, otherwise a real config.toml backed up to config.toml.backup would
fail the next switch with "would be clobbered".
2026-10-05 22:58:29 -04:00
4 changed files with 12 additions and 20 deletions

No files matched your search

+1 -1
View File
@@ -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. - 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`. - 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. - 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 `<XDG_DATA_HOME>/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. - 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. - 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.
+5 -5
View File
@@ -82,11 +82,11 @@ in
force = true; force = true;
}; };
# herdr treats ~/.config/herdr as both its config directory and its state # herdr treats ~/.config/herdr as both its config directory and its state
# directory: it writes herdr.sock, herdr-client.sock, herdr-server.log, # directory: it writes its sockets, logs, lock files and session state beside
# .plugins.lock, session.json and session-snapshots/ beside config.toml, and it # config.toml, and it offers no option to relocate them. Keep that directory a
# offers no option to relocate them. Keep that directory a real directory and # real directory and link only the config file - a whole-directory symlink into
# link only the config file - a whole-directory symlink into this repo makes # this repo makes every running herdr server dirty the working tree. The exact
# every running herdr server dirty the working tree. # artifact list is the cleanup below, so it cannot drift from the code.
home.file.".config/herdr/config.toml" = { home.file.".config/herdr/config.toml" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/herdr/config.toml"; source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/.config/herdr/config.toml";
force = true; force = true;
+5 -13
View File
@@ -1,20 +1,12 @@
{ {
"rules": [ "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.", "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" }], "use": [{ "harness": "opencode", "model": "opencode-go/muse-spark-1.3-contributor", "provider": "opencode-go" }],
"why": "GLM-5.3-Flash is the Go worker with image input; use it when visual context matters." "why": "Muse Spark 1.3 Contributor is the vision-capable Go model for work where supplied screenshots or image context matter."
},
{
"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."
} }
], ],
"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" }
]
} }
+1 -1
View File
@@ -40,6 +40,7 @@ managed=(
"$HOME/.claude/CLAUDE.md" "$HOME/.claude/CLAUDE.md"
"$HOME/.codex/AGENTS.md" "$HOME/.codex/AGENTS.md"
"$HOME/.codex/luna.config.toml" "$HOME/.codex/luna.config.toml"
"$HOME/.config/herdr/config.toml"
"$HOME/.config/opencode/AGENTS.md" "$HOME/.config/opencode/AGENTS.md"
"$HOME/.config/opencode/opencode.json" "$HOME/.config/opencode/opencode.json"
"$HOME/.config/opencode2/opencode.json" "$HOME/.config/opencode2/opencode.json"
@@ -62,7 +63,6 @@ done
for path in \ for path in \
"$HOME/.config/wezterm" \ "$HOME/.config/wezterm" \
"$HOME/.config/nvim" \ "$HOME/.config/nvim" \
"$HOME/.config/herdr" \
"$HOME/.config/opencode/skills" \ "$HOME/.config/opencode/skills" \
"$HOME/.pi/agent/themes" \ "$HOME/.pi/agent/themes" \
"$HOME/.pi/agent/extensions/calm" "$HOME/.pi/agent/extensions/calm"