Skip to content

fix(cli): Ctrl+C or Ctrl+D at the t3 triage agent picker exits cleanly - #42303

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/cli-triage-abort-exit
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/cli-triage-abort-exit

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

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).

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Changes: Agent picker cancellation

Layer / File(s) Summary
Picker cancellation flow
apps/server/src/cli/triage.ts, apps/server/src/cli/triage.test.ts
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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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
Recent review info

Run configuration

Commits

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.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

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.

Before After
51a721da44 9a78cd64b1
Cancellation recording Cancellation recording
Both keys: AbortError stack trace, exit 1. Both keys: “No agent started.”, exit 0; no stack trace, agent launch, or missing-agent message.

PTY driver and recording renderer · Before transcript · After transcript

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 24, 2026
@juliusmarminge
juliusmarminge merged commit acce92f into pingdotgg:main Nov 24, 2026
55 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants