an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
feat(cli-agents): OSS-model quick-picks + local-setup blog links (ondev-c parts 2-3)
Chaitanya Girif062dab6fe82
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ef9c6134..a54ceac1 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -55,6 +55,7 @@ sleep-frozen message router and Codex workers' filesystem permissions.### Fixed- **Codex hive workers get full filesystem + auto-approval from spawn (parity with Claude).** A Codex-engine agent in auto mode launched with `-a never -s workspace-write`, whose sandbox scopes writes to the PTY cwd (the user's project). But a hive worker must also write to its agent folder at `<harnessHome>/hive/agents/<id>/` (move `inbox/` → `.done/`, append `memory.md`, drop outbox JSON, write deliverables) — a **different path tree from cwd**, which `workspace-write` blocked. So a freshly spawned Codex worker couldn't complete HIVE PROTOCOL housekeeping and reported "it does not have permissions … grant write permission to the agent folder." Codex's auto-mode flag is now `--dangerously-bypass-approvals-and-sandbox` — the documented equivalent of Claude's `bypassPermissions` / Antigravity's `--dangerously-skip-permissions` (skip all approval prompts **and** drop the OS sandbox), so a Codex worker has the same filesystem access and auto-approval as a Claude worker from the get-go (`src/shared/agentProvider.ts`; reference/copy updated in `src/shared/codexCommands.ts`, `OnboardingWizard.tsx`, `renderer/store/config.ts`). Claude/agy/antigravity behavior is unchanged.- **Re-arm the hive message router on wake (god→worker delivery survives sleep).** The outbox→inbox router is a `setInterval` (`hive.routeOnce` every ~1.5s) that, like the always-on beats, freezes during true macOS system sleep. `onSystemResume()` already re-armed the mission scheduler, the fleet/breaker beats, and keep-awake on `powerMonitor` `resume`/`unlock-screen` — but it never re-armed the router. So after a long sleep (e.g. laptop closed overnight) the scheduler→god path recovered while **every agent's outbox silently stopped draining**: god→worker, worker↔worker, and broadcast mail piled up undelivered, and no `message` event was logged. The resume handler now re-arms the router (clear-then-set, idempotent) **and** immediately drains the accumulated backlog instead of waiting for the first post-wake tick; the renderer's idle inbox-wake nudge then wakes each parked recipient once its mail lands (`src/main/index.ts`). Verified by `scripts/verify-keepalive-catchup.mjs` (now also reproduces the pre-fix backlog stall and proves the re-arm + flush).+- **Open-source model quick-picks + local-setup guides in Add-Agent.** Hiring a worker on a local-capable CLI engine (OpenCode/Crush/pi.dev) now shows curated **OSS-model quick-picks** — a **Local** bucket (Mac-runnable Ollama tags: gpt-oss 20B/120B, Qwen3 30B-A3B/Coder, DeepSeek-R1 32B, Mistral Small, GLM-4.7-Flash, Llama 3.3 70B) and a **third-party OSS provider** bucket (BYOK: gpt-oss/Llama via Groq, DeepSeek-V4-Flash, GLM-4.6, Kimi K2.6, Qwen3-Coder via OpenRouter). Picking one fills the engine-correct slug (OpenCode `local/<tag>`, Crush/pi `ollama/<tag>`; provider slugs identical across engines) and rebuilds the command. Slugs are transcribed from a verified catalog — bleeding-edge frontier models are intentionally left out of code defaults. The Add-Agent help line and **Settings → AI Engines** local-setup area now hyperlink two how-to guides (run on open models · set up on a Mac Mini) (`src/shared/ossModels.ts`, `AddAgentModal.tsx`, `AiEnginesSettings.tsx`).- **Crush no longer dies with `Unknown command` on spawn (the hive protocol now reaches it).** A Crush worker was launched as `crush --model <m> --yolo "You are …(the whole hive protocol)"` — the protocol passed as a positional arg. But bare `crush` is an interactive Bubble Tea TUI on a Cobra root command, which reads the first positional as a **subcommand**, so it aborted with `unknown command "You are…"`; the protocol never reached the model, the worker never learned it was a hive agent, and the PTY died. Crush has no `--prompt` flag and `crush run` is one-shot, so the protocol is now **typed into the TUI** instead: a new preset capability `seedDelivery:'type-into-tui'` makes the spawn drop the positional (`crush [--model m] [--yolo]`) and hand the protocol back as a `seedPrompt`, which the renderer types in as the worker's first turn after a boot-grace — through the **same per-pty write-chain as the inbox-wake nudge**, so the seed and a nudge can never jam onto one line. Covers fresh Crush spawns, restores, and Crush-as-Michael (`src/shared/agentProvider.ts`, `src/main/hive.ts`, `src/main/index.ts`, `src/preload/index.ts`, `src/renderer/src/hooks/useHive.ts`, `AddAgentModal.tsx`, `AgentStrip.tsx`, `store.ts`).- **Auto restart-and-continue after a first-time engine-CLI install (no dead-end).** When an agent's engine binary (OpenCode/Crush/pi.dev/Codex/…) wasn't installed, the missing-CLI short-circuit ran the provider's installer in the PTY, then printed *"click restart & continue to launch the agent"* — but no such button exists for a not-yet-started agent, so the PTY just sat at `process exited (code 0)` and the agent dead-ended. Now, on a **clean install exit**, the PTY-exit handler auto restart-and-continues: it re-runs the *same* spawn into the *same* pty/window (carrying a `noAutoInstall` flag) so the freshly-installed CLI launches with no user click, and the renderer re-arms that terminal in place (clears the "process exited" line, re-enables input) via a new `pty:relaunch` signal. Provider-agnostic (every engine's installer path) and idempotent by construction — `noAutoInstall` guarantees the installer can never fire twice, and providers with no bundled installer (manual-hint-only) are never armed for relaunch. The install banner copy is now honest ("Installed — launching the agent…") (`src/main/index.ts`, `src/main/pty.ts`, `src/preload/index.ts`, `src/renderer/src/components/terminalPool.ts`).diff --git a/src/renderer/src/components/AddAgentModal.tsx b/src/renderer/src/components/AddAgentModal.tsxindex 499e5d5b..3120b7bb 100644--- a/src/renderer/src/components/AddAgentModal.tsx+++ b/src/renderer/src/components/AddAgentModal.tsx@@ -1,4 +1,4 @@-import { useState } from 'react';+import { useState, type CSSProperties } from 'react';import { PixelPanel } from './PixelPanel';import { PixelButton } from './PixelButton';import { SpritePortrait } from './SpritePortrait';@@ -9,6 +9,13 @@ import { OFFICE_CAST, DEFAULT_CHARACTER, type OfficeCharacterName } from '@/scenimport { type AccentColorName } from '@/design/tokens';import type { HireManifest } from '@shared/hire';import { MCP_CATALOG } from '@shared/mcpCatalog';+import {+ OSS_LOCAL_PICKS,+ OSS_PROVIDER_PICKS,+ localSlugFor,+ hasOssQuickPicks,+ OSS_BLOG_LINKS+} from '@shared/ossModels';import {type AgentProvider,type HarnessConfig,@@ -23,6 +30,20 @@ import {const ACCENTS: AccentColorName[] = ['coral', 'mint', 'sky', 'lemon', 'lilac', 'peach'];+// OSS quick-pick chip styling (ondev-c) — mirrors the model-picker chips.+const ossChip = (active: boolean, accent: AccentColorName): CSSProperties => ({+ padding: '3px 8px 1px',+ background: active ? `var(--cth-${accent}-light)` : 'var(--cth-cream-100)',+ boxShadow: active ? 'inset 0 0 0 2px var(--cth-ink-900)' : 'inset 0 0 0 1px var(--cth-ink-700)',+ fontFamily: 'var(--cth-font-ui)', fontSize: 13,+ color: 'var(--cth-ink-900)', cursor: 'pointer', border: 'none'+});+const ossGroupHead: CSSProperties = {+ fontFamily: 'var(--cth-font-display)', fontSize: 8, lineHeight: '12px',+ color: 'var(--cth-ink-500)', textTransform: 'uppercase', marginBottom: 4+};+const ossLink: CSSProperties = { color: 'var(--cth-ink-900)', textDecoration: 'underline', cursor: 'pointer' };+// One-click briefing templates — fill Description + Goal with a sharp, ready-to-run// role so a user isn't staring at a blank field (item 7).const DESCRIPTION_TEMPLATES: { label: string; description: string; goal: string }[] = [@@ -769,10 +790,71 @@ export function AddAgentModal({ onClose, config, onConfigChange }: AddAgentModal</div></Row>}+ {/* OSS-model quick-picks (ondev-c) — local + third-party-provider+ shortlists from the verified catalog. Clicking sets the+ engine-correct slug (OpenCode `local/<tag>`, Crush/pi+ `ollama/<tag>`; provider slugs are identical across engines)+ and rebuilds the command. */}+ {hasOssQuickPicks(provider) && (+ <Row label="OSS models">+ <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>+ <div>+ <div style={ossGroupHead}>Local · no key (Ollama / LM Studio)</div>+ <div style={{ display: 'flex', gap: 6, flexWrap: 'wrap' }}>+ {OSS_LOCAL_PICKS.map((p) => {+ const slug = localSlugFor(provider, p.tag);+ const active = (model ?? '') === slug;+ return (+ <button+ key={p.tag}+ onClick={() => pickModel(slug)}+ title={`${slug} · needs ~${p.minRam} RAM — pull with: ollama pull ${p.tag}`}+ style={ossChip(active, accent)}+ >+ {p.label}+ </button>+ );+ })}+ </div>+ </div>+ <div>+ <div style={ossGroupHead}>Via OSS provider · BYOK</div>+ <div style={{ display: 'flex', gap: 6, flexWrap: 'wrap' }}>+ {OSS_PROVIDER_PICKS.map((p) => {+ const active = (model ?? '') === p.slug;+ return (+ <button+ key={p.slug}+ onClick={() => pickModel(p.slug)}+ title={`${p.slug} · set ${p.keyEnv} in Settings → AI Engines`}+ style={ossChip(active, accent)}+ >+ {p.label}+ </button>+ );+ })}+ </div>+ </div>+ </div>+ </Row>+ )}+{(provider === 'opencode' || provider === 'crush' || provider === 'pi' || provider === 'qwen') && (<div style={{ fontSize: 12, color: 'var(--cth-ink-500)', lineHeight: '16px', margin: '2px 0 6px' }}>BYOK keys & local endpoints for this engine live in <strong>Settings → AI Engines</strong>.- Live end-to-end is pending real model calls (verify on-device).+ {' '}New to local models? Read{' '}+ <a+ href={OSS_BLOG_LINKS.openModels}+ onClick={(e) => { e.preventDefault(); void window.cth.openExternal(OSS_BLOG_LINKS.openModels); }}+ style={ossLink}+ >run on open models</a>+ {' '}or{' '}+ <a+ href={OSS_BLOG_LINKS.macMini}+ onClick={(e) => { e.preventDefault(); void window.cth.openExternal(OSS_BLOG_LINKS.macMini); }}+ style={ossLink}+ >set up on a Mac Mini</a>.+ {' '}Live end-to-end is pending real model calls (verify on-device).</div>)}diff --git a/src/renderer/src/components/AiEnginesSettings.tsx b/src/renderer/src/components/AiEnginesSettings.tsxindex f7f0803b..2ad6f5bf 100644--- a/src/renderer/src/components/AiEnginesSettings.tsx+++ b/src/renderer/src/components/AiEnginesSettings.tsx@@ -2,6 +2,7 @@ import { useState, useEffect, type CSSProperties } from 'react';import type { HarnessConfig, AgentProvider } from '@/store/config';import { PixelButton } from './PixelButton';import { ProviderLogo } from './ProviderLogo';+import { OSS_BLOG_LINKS } from '@shared/ossModels';/*** AiEnginesSettings — the v0.3.1 per-provider config surface for the BYOK CLI@@ -54,6 +55,7 @@ const headStyle: CSSProperties = {fontFamily: 'var(--cth-font-display)', fontSize: 8, lineHeight: '12px',color: 'var(--cth-ink-500)', textTransform: 'uppercase', marginBottom: 2};+const linkStyle: CSSProperties = { color: 'var(--cth-ink-900)', textDecoration: 'underline', cursor: 'pointer' };export function AiEnginesSettings({ config }: { config: HarnessConfig }) {// Which backends already have a key stored (boolean only — never the value).@@ -174,6 +176,21 @@ export function AiEnginesSettings({ config }: { config: HarnessConfig }) {</div></div>))}+ {/* Local-setup guides (ondev-c part-3) — link the two how-to blogs. */}+ <div style={{ fontSize: 12, color: 'var(--cth-ink-700)', lineHeight: '17px' }}>+ Running open models? Step-by-step guides:{' '}+ <a+ href={OSS_BLOG_LINKS.openModels}+ onClick={(e) => { e.preventDefault(); void window.cth.openExternal(OSS_BLOG_LINKS.openModels); }}+ style={linkStyle}+ >run Munder Difflin on open models</a>+ {' '}·{' '}+ <a+ href={OSS_BLOG_LINKS.macMini}+ onClick={(e) => { e.preventDefault(); void window.cth.openExternal(OSS_BLOG_LINKS.macMini); }}+ style={linkStyle}+ >set it up on a Mac Mini</a>.+ </div></div>{/* Unsandboxed-in-auto caveat (Pam guardrail #6) */}diff --git a/src/shared/ossModels.ts b/src/shared/ossModels.tsnew file mode 100644index 00000000..606abced--- /dev/null+++ b/src/shared/ossModels.ts@@ -0,0 +1,76 @@+import type { AgentProvider } from './agentProvider';++/**+ * Open-source model quick-picks for the Add-Agent modal (ondev-c part-2).+ *+ * Curated, STABLE shortlist transcribed verbatim from the verified catalog+ * `hive/shared/cli-agents/oss-models-catalog.md` §7 (frozen by Jim). Robust slugs+ * only — bleeding-edge frontier models (GLM-5.2, Kimi-K2.7) are intentionally+ * EXCLUDED from code defaults (catalog §8 = verify-live) and left to the blogs.+ *+ * Two buckets: LOCAL (Mac-runnable via Ollama/LM Studio, no key) and THIRD-PARTY+ * OSS PROVIDER (BYOK). Every engine consumes the same upstream id; only the+ * local prefix differs (§6): OpenCode names its local provider `local`; Crush and+ * pi use `ollama`. Provider-routed slugs are identical across the three engines.+ */++/** A Mac-runnable local model (Ollama tag). Slug is engine-prefixed via localSlugFor. */+export interface OssLocalPick {+ label: string;+ /** Ollama tag — keep the colon (e.g. `gpt-oss:20b`). */+ tag: string;+ /** Rough minimum unified memory to run it. */+ minRam: string;+}++/** A third-party OSS-provider model (BYOK). Slug used as-is across all three engines. */+export interface OssProviderPick {+ label: string;+ /** `provider/model` slug (native provider prefix where possible). */+ slug: string;+ /** The backend key env var this route reads (set in Settings → AI Engines). */+ keyEnv: string;+}++/** §7.A — Local quick-picks (Mac-runnable, no key) — Ollama tags. */+export const OSS_LOCAL_PICKS: OssLocalPick[] = [+ { label: 'gpt-oss 20B', tag: 'gpt-oss:20b', minRam: '16 GB' },+ { label: 'Qwen3 30B-A3B', tag: 'qwen3:30b-a3b', minRam: '32 GB' },+ { label: 'Qwen3-Coder 30B', tag: 'qwen3-coder:30b', minRam: '32 GB' },+ { label: 'DeepSeek-R1 32B', tag: 'deepseek-r1:32b', minRam: '32 GB' },+ { label: 'Mistral Small 24B', tag: 'mistral-small:24b', minRam: '16–32 GB' },+ { label: 'GLM-4.7-Flash', tag: 'glm-4.7-flash', minRam: '32 GB' },+ { label: 'Llama 3.3 70B', tag: 'llama3.3:70b', minRam: '64 GB' },+ { label: 'gpt-oss 120B', tag: 'gpt-oss:120b', minRam: '96 GB' }+];++/** §7.B — Third-party OSS-provider quick-picks (BYOK). */+export const OSS_PROVIDER_PICKS: OssProviderPick[] = [+ { label: 'gpt-oss 120B · Groq', slug: 'groq/openai/gpt-oss-120b', keyEnv: 'GROQ_API_KEY' },+ { label: 'Llama 3.3 70B · Groq', slug: 'groq/llama-3.3-70b-versatile', keyEnv: 'GROQ_API_KEY' },+ { label: 'DeepSeek-V4-Flash · OpenRouter', slug: 'openrouter/deepseek/deepseek-v4-flash', keyEnv: 'OPENROUTER_API_KEY' },+ { label: 'DeepSeek-V4-Flash · DeepSeek', slug: 'deepseek/deepseek-v4-flash', keyEnv: 'DEEPSEEK_API_KEY' },+ { label: 'GLM-4.6 · OpenRouter', slug: 'openrouter/z-ai/glm-4.6', keyEnv: 'OPENROUTER_API_KEY' },+ { label: 'Kimi K2.6 · OpenRouter', slug: 'openrouter/moonshotai/kimi-k2.6', keyEnv: 'OPENROUTER_API_KEY' },+ { label: 'Qwen3-Coder 480B · OpenRouter', slug: 'openrouter/qwen/qwen3-coder', keyEnv: 'OPENROUTER_API_KEY' },+ { label: 'Qwen3 235B · OpenRouter', slug: 'openrouter/qwen/qwen3-235b-a22b-2507', keyEnv: 'OPENROUTER_API_KEY' },+ { label: 'gpt-oss 120B · OpenRouter', slug: 'openrouter/openai/gpt-oss-120b', keyEnv: 'OPENROUTER_API_KEY' }+];++/** Engine-correct slug for a local Ollama tag (§6): OpenCode → `local/<tag>`;+ * Crush and pi → `ollama/<tag>`. The tag keeps its colon. */+export function localSlugFor(provider: AgentProvider, tag: string): string {+ return provider === 'opencode' ? `local/${tag}` : `ollama/${tag}`;+}++/** Whether to surface the OSS quick-picks for this engine — the local-capable CLI+ * engines integrated in v0.3.1. (Claude/Codex/Antigravity use their own logins.) */+export function hasOssQuickPicks(provider: AgentProvider): boolean {+ return provider === 'opencode' || provider === 'crush' || provider === 'pi';+}++/** Canonical blog URLs the local-setup UI hyperlinks to (ondev-c part-3). */+export const OSS_BLOG_LINKS = {+ openModels: 'https://munderdiffl.in/blog/run-munder-difflin-on-open-models/',+ macMini: 'https://munderdiffl.in/blog/run-munder-difflin-on-a-mac-mini/'+} as const;