Skip to content

fix(agent/run): silent no-response + provider visibility#187

Merged
tbitcs merged 3 commits into
developfrom
fix/agent-run-no-response
May 21, 2026
Merged

fix(agent/run): silent no-response + provider visibility#187
tbitcs merged 3 commits into
developfrom
fix/agent-run-no-response

Conversation

@tbitcs
Copy link
Copy Markdown
Contributor

@tbitcs tbitcs commented May 21, 2026

Summary

Fixes specsmith run silently discarding all input with no response.

Root causes

  1. Wrong default model: qwen2.5:7b hardcoded as default but not installed. Ollama returns HTTP 404 → silently swallowed →
    un_chat returns None → nothing printed.
  2. Silent failure: _handle_command returned None with zero output when no provider responded.
  3. JSONL tokens in terminal: EventEmitter.token() always wrote JSONL, so even when tokens flowed they appeared as raw JSON blobs in the terminal.

What changed

  • chat_runner._pick_ollama_model(): queries /api/tags and selects the first installed model from a preference list (lighter models first). Falls back to the hardcoded default only when Ollama is unreachable. SPECSMITH_OLLAMA_MODEL env var wins unconditionally.

unner._handle_command(): prints an actionable hint when
un_chat returns None — distinguishes between Ollama running but unresponsive vs no provider configured at all.

  • �vents.PlainTextEmitter: new subclass — oken() writes raw text, �mit() is a no-op. Used by AgentRunner when json_events=False so LLM responses render as readable prose.

unner.check_providers(): probes all 4 providers and returns ProviderStatus(name, available, model, note).

unner._print_banner(): shows a full provider status table in interactive mode — user knows exactly which model will respond before typing a word.

  • cli run --check: validates providers and exits 0/1 without starting the REPL. Runnable at any time to diagnose setup.

un_interactive: trailing newline after each streamed response.

What specsmith run now shows at startup

`
Nexus 0.11.5 — specsmith run
project : /path/to/project
profile : (default)

LLM providers:
✓ ollama ✓ ready model: qwen2.5-coder:7b-instruct (auto, 13 installed)
✗ anthropic ✗ no ANTHROPIC_API_KEY
✗ openai ✗ no OPENAI_API_KEY
✗ gemini ✗ no GOOGLE_API_KEY

Type plain English, or use /plan /ask /fix /test /commit /pr /exit
`

Tests

19 new tests in est_agent_run_feedback.py — 854 total, 0 failures.

Co-Authored-By: Oz oz-agent@warp.dev

tbitcs and others added 3 commits May 21, 2026 13:53
…followup

Root causes of specsmith run returning nothing:
1. DEFAULT_OLLAMA_MODEL=qwen2.5:7b not installed; Ollama 404 silently swallowed
2. run_chat returning None gave user zero feedback
3. EventEmitter always wrote JSONL even in interactive terminal mode

Fixes:
- chat_runner: _pick_ollama_model() queries /api/tags and selects the first
  installed model from a preference list (lighter models first); falls back
  to DEFAULT_OLLAMA_MODEL only when the API is unreachable or list is empty.
  SPECSMITH_OLLAMA_MODEL env var still wins unconditionally.
- runner: _handle_command() prints an actionable hint when run_chat returns
  None — explains whether Ollama is running (with model name) or no provider
  is available at all.
- events: PlainTextEmitter subclass — token() writes raw text to stdout,
  emit() is a no-op. Used by AgentRunner when json_events=False so LLM
  responses render as readable prose instead of JSONL blobs.
- runner: check_providers() probes all four providers (Ollama, Anthropic,
  OpenAI, Gemini) and returns ProviderStatus(name, available, model, note).
- runner: _print_banner() shows a provider status table in interactive mode
  so the user knows upfront which model will respond before typing.
- cli: specsmith run --check validates providers and exits 0/1 without
  starting the REPL.
- run_interactive: adds a trailing newline after each streamed response so
  the next prompt doesn't bleed onto the last output line.

19 new tests in test_agent_run_feedback.py (854 total, 0 failures).

Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
@tbitcs tbitcs merged commit bce93bd into develop May 21, 2026
17 checks passed
@tbitcs tbitcs deleted the fix/agent-run-no-response branch May 21, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant