From 1b98a9ed2acff1605895700302ff276ba88baa5b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 13 Jul 2026 23:05:00 -0500 Subject: feat(launcher): wire the local runtime — codex --oss over ollama MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ai --runtime local now launches codex against the machine's ollama (explicit --local-provider=ollama, model from AI_LOCAL_MODEL, default gpt-oss:120b). Verified end to end with a codex exec completion through the local model. The dependency check probes AGENT_BIN now that AGENT_CMD carries flags. This makes codex-over-ollama the de-facto answer to the runtime spec's first-supported-local-CLI blocker. --- claude-templates/bin/ai | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'claude-templates/bin/ai') diff --git a/claude-templates/bin/ai b/claude-templates/bin/ai index c09faab..c805e8b 100755 --- a/claude-templates/bin/ai +++ b/claude-templates/bin/ai @@ -11,9 +11,10 @@ # in the 'ai' session (new window or switch to existing). # Use '.' for current directory. Git prep per dir. # -# ai --runtime Launch with a different agent CLI: claude (default) or -# codex. 'local' is reserved for a local-LLM CLI, pending -# the model evaluation. Also settable via AI_RUNTIME. +# ai --runtime Launch with a different agent CLI: claude (default), +# codex, or local (codex --oss against this machine's +# ollama; model per AI_LOCAL_MODEL, default gpt-oss:120b). +# Also settable via AI_RUNTIME. # # ai --attach Attach to the existing 'ai' session without changes. # @@ -30,20 +31,21 @@ SESSION="ai" RUNTIME="${AI_RUNTIME:-claude}" - -# Map the runtime name to the agent CLI a pane launches. Both current CLIs -# take the opening instructions as a positional prompt, so only the command -# name varies; a runtime whose CLI needs different plumbing gets its own case. +LOCAL_MODEL="${AI_LOCAL_MODEL:-gpt-oss:120b}" + +# Map the runtime name to the agent CLI a pane launches. All three take the +# opening instructions as a positional prompt. AGENT_BIN is the binary the +# dependency check probes; AGENT_CMD is the full launch command (the local +# runtime rides codex's open-source provider against the machine's ollama — +# model per AI_LOCAL_MODEL, default gpt-oss:120b, verified on ratio's +# Strix Halo 2026-07-13). resolve_agent_cmd() { case "$RUNTIME" in - claude) AGENT_CMD="claude" ;; - codex) AGENT_CMD="codex" ;; - local) - echo "ai: the 'local' runtime is reserved but not wired yet (pending the local-model evaluation) — valid runtimes: claude, codex" >&2 - exit 2 - ;; + claude) AGENT_BIN="claude"; AGENT_CMD="claude" ;; + codex) AGENT_BIN="codex"; AGENT_CMD="codex" ;; + local) AGENT_BIN="codex"; AGENT_CMD="codex --oss --local-provider=ollama -m $LOCAL_MODEL" ;; *) - echo "ai: unknown runtime '$RUNTIME' — valid runtimes: claude, codex" >&2 + echo "ai: unknown runtime '$RUNTIME' — valid runtimes: claude, codex, local" >&2 exit 2 ;; esac @@ -73,7 +75,7 @@ usage() { } check_deps() { - for cmd in fzf tmux "$AGENT_CMD"; do + for cmd in fzf tmux "$AGENT_BIN"; do if ! command -v "$cmd" &>/dev/null; then echo "ai: $cmd is not installed" >&2 exit 1 -- cgit v1.2.3