Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (codex): ship only the CLI OpenCode provider, defer the TUI variant (#1814)

Adam Eivyb7633469d006
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 1572b4a944..954b76f431 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -8,7 +8,7 @@
## AI Providers
- **[issue-1801] "Test" now finds your CLI provider on Windows.** Testing a CLI/TUI provider (e.g. `claude`) on Windows always failed with `Command 'claude' not found in PATH` even when the command worked fine from a terminal. The test resolved the command with the Unix-only `which` tool, which doesn't exist on Windows — so the check itself errored and was misreported as a missing command. It now uses `where` on Windows (and `which` elsewhere), and runs the version probe against the exact resolved executable, so the test correctly succeeds when your provider is installed. (Closes #1801)
-- **[issue-1802] Run local Ollama models that actually edit files with the new "OpenCode Ollama" provider (CLI + TUI).** Ollama models are trained against the OpenAI tool-calling format, so under the Claude harness they often *describe* a file edit as JSON without ever applying it — the model "responds" but nothing changes on disk. **OpenCode Ollama** drives the `opencode` agent against your local Ollama daemon instead, speaking the OpenAI-compatible protocol natively, so the same local models reliably read, write, and edit files. It ships in two variants — **OpenCode Ollama (local model)** (`cli`, headless agent tasks) and **OpenCode Ollama TUI (local model)** (`tui`, interactive) — both disabled by default; enable one, hit **Refresh Models** to pull your tool-use-capable Ollama models, pick a default model, and run. Tool approvals are auto-allowed for unattended execution, and the Ollama connection is configured for you (no `opencode.json` to hand-write). Both arrive on the AI Providers page after `./update.sh` (migration `148-opencode-ollama-providers.js` adds them to existing installs) and appear under **Load Samples** on fresh installs. Requires the `opencode` CLI on your PATH. (Closes #1802)
+- **[issue-1802] Run local Ollama models that actually edit files with the new "OpenCode Ollama" provider.** Ollama models are trained against the OpenAI tool-calling format, so under the Claude harness they often *describe* a file edit as JSON without ever applying it — the model "responds" but nothing changes on disk. **OpenCode Ollama** drives the `opencode` agent against your local Ollama daemon instead, speaking the OpenAI-compatible protocol natively, so the same local models reliably read, write, and edit files in headless agent tasks. It's disabled by default; enable it, hit **Refresh Models** to pull your tool-use-capable Ollama models, pick a default model, and run. Tool approvals are auto-allowed for unattended execution, and the Ollama connection is configured for you (no `opencode.json` to hand-write). It arrives on the AI Providers page after `./update.sh` (migration `148-opencode-ollama-providers.js` adds it to existing installs) and appears under **Load Samples** on fresh installs. Requires the `opencode` CLI on your PATH. (Closes #1802)
- **[issue-1776] Run CoS agent tasks on a local model with the new "Claude Ollama" provider (CLI + TUI).** If your only LLM is Ollama or LM Studio, you couldn't run file-writing agent tasks — those providers return plain text with no Read/Write/Edit harness. **Claude Ollama** runs the full Claude Code harness on top of your local model: it's a `claude` CLI/TUI pre-wired to your Ollama daemon, and its **Refresh Models** pulls the installed Ollama models filtered to the **tool-use-capable** ones the agent loop depends on. It now ships in **two variants** — **Claude Ollama (local model)** (`cli`, headless) and **Claude Ollama TUI (local model)** (`tui`, interactive) — and **both arrive on the AI Providers page after `./update.sh`** (migration `146-claude-ollama-providers.js` adds them to existing installs and renames the earlier "Clawed Ollama" sample, preserving your settings; previously it lived only in the toolkit sample and never reached the merge path). The task form offers **only coding providers** — raw Ollama / LM Studio / kimi are excluded (with an inline advisory pointing you to Claude Ollama when they're all you have), and a server-side guard rejects an API provider that slips into the spawn path instead of silently writing nothing. Includes a copy-ready global `~/.claude/settings.json` example and a setup guide with the tool-use model caveat. (`data.reference/providers.json`, `server/lib/aiToolkit/`, `scripts/migrations/146-claude-ollama-providers.js`, `docs/features/claude-ollama.md`, `docs/examples/`)
## Dashboard
diff --git a/data.reference/providers.json b/data.reference/providers.json
index 3468cf81f6..4e16786aea 100644
--- a/data.reference/providers.json
+++ b/data.reference/providers.json
@@ -173,24 +173,6 @@
"secretEnvVars": [],
"headlessArgs": []
},
- "opencode-ollama-tui": {
- "id": "opencode-ollama-tui",
- "name": "OpenCode Ollama TUI (local model)",
- "type": "tui",
- "command": "opencode",
- "args": [],
- "models": [],
- "defaultModel": null,
- "ollamaBacked": true,
- "timeout": 600000,
- "enabled": false,
- "envVars": {
- "OPENCODE_CONFIG_CONTENT": "{\"permission\":\"allow\",\"provider\":{\"ollama\":{\"npm\":\"@ai-sdk/openai-compatible\",\"name\":\"Ollama (local)\",\"options\":{\"baseURL\":\"http://localhost:11434/v1\"}}}}"
- },
- "secretEnvVars": [],
- "tuiPromptDelayMs": 2500,
- "tuiIdleTimeoutMs": 180000
- },
"antigravity-tui": {
"id": "antigravity-tui",
"name": "Antigravity TUI",
diff --git a/scripts/migrations/148-opencode-ollama-providers.js b/scripts/migrations/148-opencode-ollama-providers.js
index 69af0f63ef..c09624d3df 100644
--- a/scripts/migrations/148-opencode-ollama-providers.js
+++ b/scripts/migrations/148-opencode-ollama-providers.js
@@ -1,21 +1,25 @@
/**
- * Ship the "OpenCode Ollama" provider pair (CLI + TUI) to existing installs.
+ * Ship the "OpenCode Ollama" CLI provider to existing installs.
*
* Background: issue-1802. Anthropic-format tool-calling (what the `claude` CLI
* expects) is a poor fit for Ollama models trained against the OpenAI tool
* schema — they emit JSON tool-call text that the harness never executes, so a
* Claude-Ollama agent "runs" but silently fails to edit files. OpenCode speaks
* the OpenAI-compatible protocol natively, so the SAME local models reliably
- * apply file changes. These providers run `opencode` against a local Ollama
+ * apply file changes. This provider runs `opencode run` against a local Ollama
* daemon (declared inline via OPENCODE_CONFIG_CONTENT) so api-only / local-model
- * users get working tool execution.
+ * users get working headless tool execution.
+ *
+ * Only the headless CLI variant ships: the interactive TUI completion path drives
+ * the slashdo `/do:pr` / `/do:push` handoff that OpenCode can't execute, so a TUI
+ * variant is deferred to its own follow-up.
*
* `setup-data.js` merges *missing* provider entries from data.reference, but only
- * when an install actually re-runs setup. This migration delivers the pair on a
- * plain server restart too, and is the canonical path for deployed installs to
- * pick them up. Purely additive: brand-new ids, so there's no rename or pinned-
- * id rewrite to do (contrast migration 146, which renamed clawed-ollama). Adds
- * each provider only when missing — idempotent; existing keys are left untouched.
+ * when an install actually re-runs setup. This migration delivers the provider on
+ * a plain server restart too, and is the canonical path for deployed installs to
+ * pick it up. Purely additive: a brand-new id, so there's no rename or pinned-id
+ * rewrite to do (contrast migration 146, which renamed clawed-ollama). Adds the
+ * provider only when missing — idempotent; an existing key is left untouched.
*
* Kept in lockstep with data.reference/providers.json and
* server/lib/aiToolkit/defaults/providers.sample.json. Frozen here as the
@@ -51,23 +55,6 @@ const OPENCODE_OLLAMA_CLI = {
headlessArgs: [],
};
-const OPENCODE_OLLAMA_TUI = {
- id: 'opencode-ollama-tui',
- name: 'OpenCode Ollama TUI (local model)',
- type: 'tui',
- command: 'opencode',
- args: [],
- models: [],
- defaultModel: null,
- ollamaBacked: true,
- timeout: 600000,
- enabled: false,
- envVars: { OPENCODE_CONFIG_CONTENT },
- secretEnvVars: [],
- tuiPromptDelayMs: 2500,
- tuiIdleTimeoutMs: 180000,
-};
-
export default {
async up({ rootDir }) {
const providersPath = join(rootDir, PROVIDERS_REL_PATH);
@@ -96,7 +83,7 @@ export default {
const providers = config.providers;
let changed = false;
- for (const def of [OPENCODE_OLLAMA_CLI, OPENCODE_OLLAMA_TUI]) {
+ for (const def of [OPENCODE_OLLAMA_CLI]) {
if (!providers[def.id]) {
providers[def.id] = { ...def, envVars: { ...def.envVars } };
changed = true;
diff --git a/scripts/migrations/148-opencode-ollama-providers.test.js b/scripts/migrations/148-opencode-ollama-providers.test.js
index 491a4fc994..bb73a7d2c2 100644
--- a/scripts/migrations/148-opencode-ollama-providers.test.js
+++ b/scripts/migrations/148-opencode-ollama-providers.test.js
@@ -27,7 +27,7 @@ describe('migration 148 — OpenCode Ollama providers', () => {
rmSync(rootDir, { recursive: true, force: true });
});
- it('adds both shipped OpenCode providers to an existing install', async () => {
+ it('adds the OpenCode Ollama CLI provider to an existing install', async () => {
writeJson(providersPath, {
activeProvider: 'claude-code',
providers: { 'claude-code': { id: 'claude-code', type: 'cli', command: 'claude' } },
@@ -37,16 +37,13 @@ describe('migration 148 — OpenCode Ollama providers', () => {
const out = readJson(providersPath);
const cli = out.providers['opencode-ollama'];
- const tui = out.providers['opencode-ollama-tui'];
expect(cli.type).toBe('cli');
expect(cli.command).toBe('opencode');
expect(cli.args).toEqual(['run']);
expect(cli.ollamaBacked).toBe(true);
expect(cli.enabled).toBe(false);
- expect(tui.type).toBe('tui');
- expect(tui.command).toBe('opencode');
- expect(tui.args).toEqual([]);
- expect(tui.ollamaBacked).toBe(true);
+ // only the CLI variant ships (TUI completion path is a follow-up)
+ expect(out.providers['opencode-ollama-tui']).toBeUndefined();
// unrelated providers + active provider untouched
expect(out.providers['claude-code']).toBeDefined();
expect(out.activeProvider).toBe('claude-code');
@@ -80,8 +77,6 @@ describe('migration 148 — OpenCode Ollama providers', () => {
// existing CLI entry preserved untouched
expect(out.providers['opencode-ollama'].enabled).toBe(true);
expect(out.providers['opencode-ollama'].models).toEqual(['qwen2.5-coder:32b']);
- // but the missing TUI variant is still added
- expect(out.providers['opencode-ollama-tui']).toBeDefined();
});
it('is idempotent — a second run makes no changes', async () => {
diff --git a/server/lib/aiToolkit/defaults/providers.sample.json b/server/lib/aiToolkit/defaults/providers.sample.json
index e5b9ec857f..ce619a5854 100644
--- a/server/lib/aiToolkit/defaults/providers.sample.json
+++ b/server/lib/aiToolkit/defaults/providers.sample.json
@@ -94,24 +94,6 @@
"secretEnvVars": [],
"headlessArgs": []
},
- "opencode-ollama-tui": {
- "id": "opencode-ollama-tui",
- "name": "OpenCode Ollama TUI (local model)",
- "type": "tui",
- "command": "opencode",
- "args": [],
- "models": [],
- "defaultModel": null,
- "ollamaBacked": true,
- "timeout": 600000,
- "enabled": false,
- "envVars": {
- "OPENCODE_CONFIG_CONTENT": "{\"permission\":\"allow\",\"provider\":{\"ollama\":{\"npm\":\"@ai-sdk/openai-compatible\",\"name\":\"Ollama (local)\",\"options\":{\"baseURL\":\"http://localhost:11434/v1\"}}}}"
- },
- "secretEnvVars": [],
- "tuiPromptDelayMs": 2500,
- "tuiIdleTimeoutMs": 180000
- },
"codex": {
"id": "codex",
"name": "Codex CLI",