Skip to content

Fix CLI quality regressions#103

Merged
Desperado merged 7 commits into
mainfrom
Desperado/qua-578-579-580-cli-quality
May 15, 2026
Merged

Fix CLI quality regressions#103
Desperado merged 7 commits into
mainfrom
Desperado/qua-578-579-580-cli-quality

Conversation

@Desperado
Copy link
Copy Markdown
Contributor

@Desperado Desperado commented May 15, 2026

Summary

Included fixes

  • route one-shot prompts through configured CLI backends
  • recover queued input typed while the agent is running
  • disclose Claude Agent SDK credit cutover for cc backend users
  • validate model names locally
  • fail fast for non-TTY interactive startup

Tests

  • go test ./...

Desperado and others added 6 commits May 15, 2026 22:17
If the agent's response races the user's typing (turn ends before the
user has pressed Enter), the typing-line buffer was silently dropped,
making the v1.13 "type while agent runs, auto-queue" feature appear
broken: the user sees `⌨  partial text` appear, agent response prints,
and the partial vanishes. Subsequent keystrokes that arrive between
stopQueueReader() and the next tui.ReadInput end up split across two
prompts, producing confusing "phantom" input.

The queue reader now exposes its in-flight line buffer via its stop
function. After the agent finishes, repl pushes any partial line onto
the queue with a clear "↩ partial input recovered" notice. Users can
discard it with the new `/queue clear` command if it was stray input.

The fix preserves the existing Enter-to-queue, Enter-cancels-agent,
and Ctrl+C-clears behaviour unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Before this change, both `qmax-code -p "..."` and `qmax-code "..."`
called `ag.Run` (the Anthropic API agent) unconditionally — silently
ignoring `backend=cc` and `backend=codex`. Every CI / scripting /
cloud-session invocation bypassed the cc backend and hit the
Anthropic API directly (often producing a 401 from a stale keychain
key, masking the real issue). The doc claims that the cc backend
needs no Anthropic API key were also false for these paths.

The fix introduces a single `runOneShot` dispatcher shared by both
non-interactive entry points: if `cliAgent` is configured, prompts
go through it (claude/codex CLI) with its own streaming output; only
when there is no CLI backend do we fall back to `ag.Run`.

Regression tests (main_oneshot_test.go) mirror the dispatch contract
with a fake CLIAgent and assert (1) CLI takes precedence, (2) API
is used as the fallback, (3) CLI errors propagate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…' into Desperado/qua-578-579-580-cli-quality
…-580-cli-quality

# Conflicts:
#	internal/session/stdin_queue_unix.go
#	main.go
@qualitymaxapp
Copy link
Copy Markdown

qualitymaxapp Bot commented May 15, 2026

✅ QualityMax Pipeline

Gate Result
🔍 AI Review ✅ Clean
🧪 Repo Tests ✅ 298/298 passed (go)
🤖 AI Tests ✅ 28/32 passed

Powered by QualityMax — AI-Powered Test Automation

@Desperado Desperado merged commit db91e5d into main May 15, 2026
5 of 6 checks passed
@Desperado Desperado deleted the Desperado/qua-578-579-580-cli-quality branch May 15, 2026 21:55
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