fix(cli): no-TTY fallback for task pickers - #77
Open
olddognewflex wants to merge 1 commit into
Open
Conversation
qi task done/schedule/breakdown launched the Bubble Tea picker on an ambiguous match with no TTY guard, so in a pipe (or an agent) they died with a raw bubbletea "/dev/tty" error (closes #62). qi inbox has --dry-run as its headless path; the pickers had nothing. The three picker calls now go through a pickTasks wrapper: with a terminal it launches the picker as before; without one it prints the candidate list plus an instruction to narrow the match (a more specific query or an exact single match) and returns a clear error. TTY detection is stdinIsTTY, a package var over term.IsTerminal so tests can force the headless path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #62.
Problem
qi task done/schedule/breakdowninvoked the Bubble Tea picker on an ambiguous match with no TTY guard. In a pipe (or under an agent), that dies with a raw bubbleteaopen /dev/ttyerror.qi inboxhas--dry-runas its headless path; the pickers had nothing (§2.4).Fix
The three picker calls now route through a
pickTaskswrapper:ambiguous match: N tasks and no terminal for the pickererror, exiting non-zero.TTY detection is
stdinIsTTY, a package var overterm.IsTerminal(os.Stdin)so tests can force the headless path.Verification
Test forces the no-TTY branch and asserts the candidate list + instruction + error. Full
go test ./...,go vet,go build ./...green.Merge-order note
Touches
internal/commands/task.go. Overlaps #60 (constructor swap) and #61; a trivial rebase for whichever merges later.