Skip to content

Commit fa74272

Browse files
t3dotggclaude
andcommitted
fix(cli): triage picker needs stdout TTY, repeat runs reuse existing clone
With stdout redirected the agent picker prompt was invisible and the command hung; both streams must now be terminals. The playbook tells the agent to reuse an existing clone for the same hash instead of failing the second clone into a non-empty directory. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent c4e925d commit fa74272

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎.github/triage/PLAYBOOK.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ cache directory named in the context file, one subdirectory per commit hash:
3838

3939
If the tag does not exist (nightly builds), clone `main` instead, and treat file
4040
and line references as approximate: the user's build may not match `main`
41-
exactly. Before cloning,
42-
delete other entries in the source cache directory, but only entries whose git
43-
state is clean (no uncommitted changes, no unpushed commits).
41+
exactly. If the target directory already exists from an earlier triage run,
42+
reuse it instead of cloning again. Before cloning, delete other entries in the
43+
source cache directory, but only entries whose git state is clean (no
44+
uncommitted changes, no unpushed commits).
4445

4546
Use the clone to map stack traces, log lines, and error messages to real code.
4647
Diagnosis grounded in source beats guessing.

‎apps/server/src/cli/triage.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ export const triageCommand = Command.make("triage", {
240240
} else if (installed.length === 1) {
241241
selected = installed[0];
242242
} else if (installed.length > 1) {
243-
if (!process.stdin.isTTY) {
243+
// Both streams must be terminals: with stdout redirected the picker
244+
// prompt is invisible and the command would hang waiting on it.
245+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
244246
return yield* new TriageAgentChoiceRequiredError();
245247
}
246248
selected = yield* pickAgent(installed);

‎apps/server/src/cli/triagePrompt.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ cache directory named in the context file, one subdirectory per commit hash:
5050
5151
If the tag does not exist (nightly builds), clone \`main\` instead, and treat file
5252
and line references as approximate: the user's build may not match \`main\`
53-
exactly. Before cloning,
54-
delete other entries in the source cache directory, but only entries whose git
55-
state is clean (no uncommitted changes, no unpushed commits).
53+
exactly. If the target directory already exists from an earlier triage run,
54+
reuse it instead of cloning again. Before cloning, delete other entries in the
55+
source cache directory, but only entries whose git state is clean (no
56+
uncommitted changes, no unpushed commits).
5657
5758
Use the clone to map stack traces, log lines, and error messages to real code.
5859
Diagnosis grounded in source beats guessing.

0 commit comments

Comments
 (0)