fix(6.34): wire claude-code-ollama into HA + PA launchers#40
Merged
fstamatelopoulos merged 1 commit intomainfrom May 9, 2026
Merged
fix(6.34): wire claude-code-ollama into HA + PA launchers#40fstamatelopoulos merged 1 commit intomainfrom
claude-code-ollama into HA + PA launchers#40fstamatelopoulos merged 1 commit intomainfrom
Conversation
A user with `helpAssistantAgent.adapter = "claude-code-ollama"`
(configured at `cfcf init` since 6.28 surfaced the new adapters in
the picker) hit:
[ha] failed to launch: Help Assistant doesn't support adapter
"claude-code-ollama" yet. Supported: claude-code, codex.
The PA + HA launchers (in `packages/core/{help-assistant,product-architect}/
launcher.ts`) have their own argv-builder switch statements rather
than going through the standard `AgentAdapter.buildCommand()` path,
because they need true TUI takeover via `Bun.spawn(... { stdio:
"inherit" })` and the standard pipeline assumes headless `-p`. The
new adapters from item 6.28 were never added to those switches.
Added a `case "claude-code-ollama"` arm to both launchers that wraps
the existing claude-code argv with `ollama launch claude --model
<ollama-model> --yes -- <claude-flags>`. The `--model` flag is the
ollama-side model name; claude itself doesn't get `--model` because
ollama already pinned the model serving the API. For HA: no
`--dangerously-skip-permissions` (HA is interactive — user reviews
tool calls). For PA: `--dangerously-skip-permissions` flows through
in non-safe mode (matches the direct claude-code path).
Error message for the still-unsupported adapters (`opencode`,
`opencode-ollama`) now lists `claude-code-ollama` as the supported
ollama path so users on `opencode-ollama` see the alternative.
Tests: 7 new unit tests across `help-assistant/launcher.test.ts`
and `product-architect/launcher.test.ts` (argv shape, model
omission, PA safe-mode behaviour, helpful-error-message check).
852/852 core+cli+web tests pass.
Out of scope for this fix: `opencode` + `opencode-ollama`
interactive support. opencode's interactive default reads
`AGENTS.md` from cwd, which doesn't fit cf²'s ephemeral-tempfile
pattern (would pollute the user's repo or sandbox opencode away
from it). Needs investigation into opencode's runtime system-prompt-
injection mechanism. Tracked as the deferred half of item 6.34 in
docs/plan.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The agent picker in
cfcf initand the web Settings page surfaces every detected adapter for every role — but the Help Assistant and Product Architect have their own launchers (separate from the standardspawnProcesspath because they need true TUI takeover viaBun.spawn(... { stdio: "inherit" })) with hardcodedswitchstatements for argv composition. The new adapters from item 6.28 (opencode,claude-code-ollama,opencode-ollama) were never added to those switches.Result for users who configured
helpAssistantAgent.adapter = "claude-code-ollama"atcfcf init:What's fixed
case "claude-code-ollama"arm in bothhelp-assistant/launcher.tsandproduct-architect/launcher.ts. Wraps the existing claude-code argv composition withollama launch claude --model <ollama-model> --yes -- <claude-flags>.--modelflag goes to ollama (pins the local model serving the API surface); claude itself doesn't get--model. Soagent.modelis the ollama-side model name (e.g.qwen3-coder:latest).--dangerously-skip-permissions(HA is interactive — user reviews tool calls).--dangerously-skip-permissionsflows through after--in non-safe mode (matches the direct claude-code behaviour).opencode,opencode-ollama) now listsclaude-code-ollamaas the supported ollama path so users onopencode-ollamasee the alternative immediately.Out of scope (deferred — round 2 of 6.34)
opencode+opencode-ollamainteractive support. opencode's interactive default readsAGENTS.mdfrom cwd, which doesn't fit cf²'s ephemeral-tempfile pattern (would either pollute the user's repo or sandbox opencode away from the user's working tree). Needs investigation into opencode's runtime system-prompt-injection mechanism (--prompt?-c instructions=...? config-file-only?) before we can wire it cleanly.Test plan
bun run typecheck— cleanbun test packages/core packages/cli packages/web— 852/852 pass (7 new launcher tests)cfcf help assistantwithhelpAssistantAgent.adapter = "claude-code-ollama"andmodel = "qwen3-coder:latest"→ expected spawnollama launch claude --model qwen3-coder:latest --yes -- --append-system-prompt "<HA-prompt>" "<initial-message>"cfcf specwithproductArchitectAgent.adapter = "claude-code-ollama"→ same shape with--dangerously-skip-permissionsafter--(and without it when passing--safe)