fix: empty response handling, /no_think model gating, per-model profiles

- Detect empty LLM responses (no content, no tool calls) instead of
  silently treating them as task completion. Retries once without tools
  before warning the user.
- Gate /no_think system message and chat_template_kwargs to Qwen/QwQ
  models only — sending /no_think to llama3.x caused empty responses.
- Add model_profiles config section for per-model overrides (token
  budget, thinking, temperature, max_tokens) matched by name prefix.
  Applied at startup and on /model switch.
- Update SessionManager on /model switch so session files record the
  correct model.
- Add NDJSON fallback in SSE stream parser for Ollama compatibility.
- Improve read_file error to suggest find_files on FileNotFoundError.
- Add diagnostic logging for empty streams and empty results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 23:09:04 -05:00
parent 1ee721ac10
commit 16d79df421
10 changed files with 191 additions and 33 deletions

View File

@@ -1,21 +1,12 @@
Pressing up should cycle history like claude code.
# UI Issues
on /clear we need to reset the token counter in the header panel.
~~Remove the user's input from output "you" - it's not needed.~~ Brought back as a condensed one-liner (first line + line count for multi-line).
# Bugs
Smart shell auto-approve: auto-approve `run_command` when the base executable is in the `allowed_commands` list and the full command doesn't match any `denied_commands` prefix. Only prompt the user for commands whose base executable is unlisted. Currently all shell commands prompt regardless, which is tedious for safe read-only commands like `git branch` or `ls`. The allow/deny lists in `ShellToolConfig` already define what's safe — the permissions service just needs to be shell-aware.
# Improvements
add -p to command line args so that the agent can run the prompt and return data directly via STDOUT
Show a token count or some other display for when the model is "thinking" for a long period of time. I want a way for the user to know the model is working on it.
# Open questions:
How might we pass a directory to this app and have it use that directory as it's workspace so I don't have to copy files or do odd things to work in other directories.
/models command to show models available and temporarly change models in the session
pass a directory to the tool so that it uses that directory as it's root for commands.
add a skills directory so we can prompt our own skills for the tool to use similar to Claude Code
need not only a session log, but also a log of what the llm is thinking and how it's working somehow. I need a way to see behind the curtain.
# Left of from Phase 7 of old roadmap - finish these first
- Permission modal auto-approves (TODO: proper modal dialog)
- Session resume auto-resumes (TODO: modal y/n)
- LLM client cleanup on unmount not yet wired
- No automated TUI tests (Textual's AppTest can be added later)
How do we handle huge files not taking up so many tokens?