You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cli): Ctrl+C or Ctrl+D at the t3 triage agent picker exits cleanly - #42303
When two or more agent CLIs are installed and the terminal is interactive, t3 triage prompts for which agent to run. Pressing Ctrl+C or Ctrl+D at that picker makes readline's question() reject with AbortError, which Effect.promise turns into an unhandled defect with an internal node:internal/readline stack trace and exit code 1. Sibling prompts (t3 uninstall, t3 update, t3 doctor, t3 up) treat cancel as a quiet "no" and print a short line (for example "Left as is." / "Nothing changed.").
Repro on Linux with Node v26.13.1 at base 4c2e2b37343 (real CLI t3 triage --base-dir <scratch>/t3home on a pseudo-terminal with stub claude and codex on PATH): pressing Ctrl+C printed ERROR (#2): AbortError: Aborted with Ctrl+C (and Ctrl+D printed ERROR (#2): AbortError: Aborted with Ctrl+D), followed by 10 stack frames and exit code 1.
Change
In apps/server/src/cli/triage.ts, catch only AbortError in pickAgent and return undefined (other errors still throw), export pickAgent with optional input/output streams defaulting to process.stdin/process.stdout, and on undefined in triageCommand, print a newline and No agent started. then return early so it exits 0 without falling through to "No supported agent CLI ... was found".
In apps/server/src/cli/triage.test.ts, add a two-row test that sends Ctrl+C (\x03) and Ctrl+D (\x04) to the real pickAgent through a fake terminal (PassThrough output marked isTTY: true) and asserts it returns undefined.
Scope
This is a small, localized fix for an obvious interactive-cancellation bug—an uncaught AbortError stack trace and exit code 1 at the t3 triage picker—so it needs no issue. Like those sibling prompts, t3 triage now treats cancel quietly by printing No agent started. and exiting 0; nothing else changes.
Verification
An AI agent ran all checks below on Linux with Node v26.13.1. No UI changes (terminal output only), so no screenshots apply.
Revision
Key at the picker
Output after the prompt
Exit
base 4c2e2b37343
Ctrl+C
ERROR (#2): AbortError: Aborted with Ctrl+C + 10 stack frames
1
base 4c2e2b37343
Ctrl+D
ERROR (#2): AbortError: Aborted with Ctrl+D + 10 stack frames
1
head ef54b0bf0a5
Ctrl+C
No agent started. (no AbortError, no "No supported agent")
0
head ef54b0bf0a5
Ctrl+D
No agent started. (no AbortError, no "No supported agent")
0
Regression test (apps/server/src/cli/triage.test.ts): with only the AbortError catch removed, both new cases fail with AbortError: Aborted with Ctrl+C and AbortError: Aborted with Ctrl+D (2 failed | 15 passed (17)); on head ef54b0bf0a5, 3 of 3 runs pass (17 passed (17)).
Normal pick on head ef54b0bf0a5: answering 2 at the picker prints Starting Codex. It will ask what went wrong. and starts Codex (started codex), exiting 0.
vp run check:changed on a clean tree at ef54b0bf0a5: exit 0; passed format, lint, knip 1/2, knip 2/2, graphql (apps/server), typecheck (3 packages), and test (2 files) (unused patch check skipped: no dependency files changed).
No actionable comments were generated in the recent review.
Walkthrough
The agent picker now accepts injectable input and output streams and returns undefined when the prompt is aborted. The multiple-agent flow logs “No agent started.” and stops without launching an agent after cancellation.
pickAgent is exported and accepts optional input and output streams. It returns undefined for readline AbortError and rethrows other errors. The multiple-agent flow logs “No agent started.” and returns if selection is canceled. Tests cover Ctrl+C and Ctrl+D.
pingdotgg/t3code#42046: Updates answer parsing and tests for the same agent picker prompt flow.
Suggested reviewers:motaghi, shethshlok
Merge Risk: Minimal · up to 9a78c
Merge Risk:⚪ Minimal · up to 9a78c
Pressing Ctrl+C or Ctrl+D at the agent picker now exits quietly with a short message instead of an error. The change is small and tested, and no merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: Ctrl+C or Ctrl+D at the t3 triage agent picker now exits cleanly. The changeset catches AbortError in pickAgent and prints "No agent started." with exit 0, so the titl…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug, expected behavior, and repro steps with environment. The Change secti…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: Ctrl+C or Ctrl+D at the t3 triage agent picker now exits cleanly. The changeset catches AbortError in pickAgent and prints "No agent started." with exit 0, so the title matches the fix. It is specific, single-sentence, and follows conventional commit form.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the bug, expected behavior, and repro steps with environment. The Change section lists the edits in triage.ts and triage.test.ts. The Scope section explains why no issue is linked and why the fix is small. The Verification section gives a results table, regression test evidence, and check runs. It ends with the model and harness, as the template asks.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 51a721d and ef54b0b.
Files selected for processing: 2
apps/server/src/cli/triage.test.ts
apps/server/src/cli/triage.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Run t3 triage --base-dir <fresh-empty-dir> without --agent, wait for the picker, and send Ctrl+C. Repeat with a fresh empty directory and Ctrl+D. Environment on both sides: Linux x86_64, Node v26.13.1, 120×36 PTY; separately built real CLI. Videos render the captured PTY output and key timing.
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
size:S10-29 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
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.
Problem
When two or more agent CLIs are installed and the terminal is interactive,
t3 triageprompts for which agent to run. Pressing Ctrl+C or Ctrl+D at that picker makesreadline'squestion()reject withAbortError, whichEffect.promiseturns into an unhandled defect with an internalnode:internal/readlinestack trace and exit code 1. Sibling prompts (t3 uninstall,t3 update,t3 doctor,t3 up) treat cancel as a quiet "no" and print a short line (for example "Left as is." / "Nothing changed.").Repro on Linux with Node v26.13.1 at base
4c2e2b37343(real CLIt3 triage --base-dir <scratch>/t3homeon a pseudo-terminal with stubclaudeandcodexonPATH): pressing Ctrl+C printedERROR (#2): AbortError: Aborted with Ctrl+C(and Ctrl+D printedERROR (#2): AbortError: Aborted with Ctrl+D), followed by 10 stack frames and exit code 1.Change
apps/server/src/cli/triage.ts, catch onlyAbortErrorinpickAgentand returnundefined(other errors still throw), exportpickAgentwith optionalinput/outputstreams defaulting toprocess.stdin/process.stdout, and onundefinedintriageCommand, print a newline andNo agent started.then return early so it exits 0 without falling through to "No supported agent CLI ... was found".apps/server/src/cli/triage.test.ts, add a two-row test that sends Ctrl+C (\x03) and Ctrl+D (\x04) to the realpickAgentthrough a fake terminal (PassThroughoutput markedisTTY: true) and asserts it returnsundefined.Scope
This is a small, localized fix for an obvious interactive-cancellation bug—an uncaught
AbortErrorstack trace and exit code 1 at thet3 triagepicker—so it needs no issue. Like those sibling prompts,t3 triagenow treats cancel quietly by printingNo agent started.and exiting 0; nothing else changes.Verification
An AI agent ran all checks below on Linux with Node v26.13.1. No UI changes (terminal output only), so no screenshots apply.
4c2e2b37343ERROR (#2): AbortError: Aborted with Ctrl+C+ 10 stack frames4c2e2b37343ERROR (#2): AbortError: Aborted with Ctrl+D+ 10 stack framesef54b0bf0a5No agent started.(noAbortError, no "No supported agent")ef54b0bf0a5No agent started.(noAbortError, no "No supported agent")apps/server/src/cli/triage.test.ts): with only theAbortErrorcatch removed, both new cases fail withAbortError: Aborted with Ctrl+CandAbortError: Aborted with Ctrl+D(2 failed | 15 passed (17)); on headef54b0bf0a5, 3 of 3 runs pass (17 passed (17)).ef54b0bf0a5: answering2at the picker printsStarting Codex. It will ask what went wrong.and starts Codex (started codex), exiting0.vp run check:changedon a clean tree atef54b0bf0a5: exit0; passedformat,lint,knip 1/2,knip 2/2,graphql (apps/server),typecheck (3 packages), andtest (2 files)(unused patch check skipped: no dependency files changed).Generated with Gemini 4 Neon in T3 Code Nightly