Skip to content

fix(ollama): missing streamSimple, broken theme color, instant UI dismiss#3425

Open
tosoyn wants to merge 2 commits intogsd-build:mainfrom
tosoyn:fix/ollama-extension-compat
Open

fix(ollama): missing streamSimple, broken theme color, instant UI dismiss#3425
tosoyn wants to merge 2 commits intogsd-build:mainfrom
tosoyn:fix/ollama-extension-compat

Conversation

@tosoyn
Copy link
Copy Markdown

@tosoyn tosoyn commented Apr 2, 2026

Summary

Fixes #3424

Three issues in the Ollama extension (778d6ac, PR #3371) that prevent it from working on current main (394cb18):

  • streamSimple missing: registerProvider with authMode: "none" now requires streamSimple (enforced since 91f0286). Added wrapper around streamOpenAICompletions with dummy apiKey
  • Invalid theme color: theme.fg("fg", ...)theme.fg("text", ...) (3 occurrences)
  • Instant UI dismiss: ctx.ui.custom() used setTimeout(() => done(), 0) and returned a Text component. Now returns { render, handleInput, invalidate } contract, waits for keypress

Affected version: main at 394cb18. Not in npm v2.58.0.

Test plan

  • Start gsd from patched main with Ollama running
  • /models opens without crash, ollama models visible in "all" scope
  • /ollama shows status and stays visible until keypress
  • /ollama list shows models and stays visible until keypress
  • /ollama ps shows running models (if any loaded)
  • /ollama pull <model> pulls with progress
  • Without Ollama running: no crash, graceful "not running" message

🤖 Generated with Claude Code

lunas-ai-lab and others added 2 commits April 2, 2026 11:27
The unknown-command fallback added in 91f0286 returns true for any
unrecognised "/" input before the extension system gets a chance to
handle it.  This breaks every extension-registered command (/gsd,
/kill, /worktree, /exit, etc.).

Check extensionRunner.getCommand() before showing the error so that
extension commands fall through to session.prompt() as intended.

Affects: main branch at 394cb18 (HEAD), not yet in any npm release.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d broken UI

Three issues in the Ollama extension added in 778d6ac prevent it from
working on current main (394cb18):

1. registerProvider("ollama", { authMode: "none" }) without streamSimple.
   Commit 91f0286 made streamSimple mandatory for keyless providers.
   Fix: add streamSimple wrapping streamOpenAICompletions with a dummy
   apiKey ("ollama") since Ollama needs no auth.

2. theme.fg("fg", ...) uses non-existent theme color "fg".
   Fix: replace with "text" which is a valid ThemeColor.

3. ctx.ui.custom() returns immediately via setTimeout(() => done(), 0),
   causing the UI to flash and disappear. Also returns a Text component
   instead of the expected { render, handleInput, invalidate } contract.
   Fix: return proper component object that waits for keypress to dismiss.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🔴 PR Risk Report — CRITICAL

Files changed 3
Systems affected 5
Overall risk 🔴 CRITICAL

Affected Systems

Risk System
🔴 critical Agent Core
🟠 high Modes
🟠 high AI Providers
🟡 medium Commands
🟡 medium TUI Components
File Breakdown
Risk File Systems
🟠 packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts Modes, Commands
🔴 src/resources/extensions/ollama/index.ts Agent Core, AI Providers, TUI Components
src/resources/extensions/ollama/ollama-commands.ts (unclassified)

⚠️ Critical risk — please verify: state persistence, auth token lifecycle, agent loop race conditions, RPC protocol compatibility.

@github-actions github-actions bot added bug Something isn't working High Priority labels Apr 2, 2026
@jeremymcs
Copy link
Copy Markdown
Collaborator

@tosoyn please fix Ci issues.

@jeremymcs
Copy link
Copy Markdown
Collaborator

This PR has merge conflicts with the base branch. Please rebase or merge main to resolve before review can proceed.

🤖 Automated PR audit — 2026-04-04

@jeremymcs
Copy link
Copy Markdown
Collaborator

Note: PR #3443 also addresses this same Ollama streamSimple crash (#3440/#3424) with a different approach (switching authMode to apiKey). These should be coordinated to avoid duplicate work. 🤖 Automated PR audit — 2026-04-04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ollama): extension crashes on main — missing streamSimple, broken theme color, instant UI dismiss

3 participants