Commit bce93bd
fix(agent/run): silent no-response + provider visibility (#187)
* fix(agent/run): silent no-response + provider visibility — closes #186-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>
* style: ruff format cli.py
Co-Authored-By: Oz <oz-agent@warp.dev>
* style: fix import sort in test_agent_run_feedback.py
Co-Authored-By: Oz <oz-agent@warp.dev>
---------
Co-authored-by: Oz <oz-agent@warp.dev>1 parent 205c077 commit bce93bd
5 files changed
Lines changed: 694 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
37 | 55 | | |
38 | 56 | | |
39 | 57 | | |
| |||
239 | 257 | | |
240 | 258 | | |
241 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
242 | 294 | | |
243 | 295 | | |
244 | 296 | | |
245 | 297 | | |
246 | 298 | | |
247 | 299 | | |
248 | 300 | | |
249 | | - | |
250 | 301 | | |
251 | 302 | | |
252 | 303 | | |
253 | 304 | | |
254 | 305 | | |
| 306 | + | |
| 307 | + | |
255 | 308 | | |
256 | 309 | | |
257 | 310 | | |
| |||
284 | 337 | | |
285 | 338 | | |
286 | 339 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | 340 | | |
296 | 341 | | |
297 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
0 commit comments