-
Notifications
You must be signed in to change notification settings - Fork 6
fix(cli): route stash impl and the two stash init prompts through the shared TTY gate #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0e2ce93
fix(cli): route `stash impl` interactivity through the shared TTY gate
tobyhede bb0a90f
fix(cli): route the two `stash init` prompts through the shared TTY gate
tobyhede 945743b
fix(cli): gate the `--continue-without-plan` confirm on the TTY check
tobyhede e5eb696
test(cli): close the eight TTY-gate coverage gaps from PR review
tobyhede File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| 'stash': patch | ||
| --- | ||
|
|
||
| Fix `stash impl` and `stash init` hanging on CI runners that allocate a TTY. | ||
|
|
||
| Four prompts decided whether to run interactively without going through the | ||
| shared TTY helper, so on a CI runner with an allocated TTY they rendered a clack | ||
| prompt and blocked forever on `/dev/tty` — a silent hang with no error and no | ||
| timeout: | ||
|
|
||
| - `stash impl` gated on an inline `process.env.CI !== 'true'`, which only | ||
| recognised the exact lowercase spelling. Runners that set `CI=1` or `CI=TRUE` | ||
| blocked on the plan-summary confirmation or the agent-target picker. | ||
| - `stash init`'s offer to chain into `stash plan`, and its Proxy-vs-SDK | ||
| question, gated on `process.stdout.isTTY` and did not consult `CI` at all — | ||
| so they hung on any CI runner with a TTY, whatever the spelling. Gating on | ||
| stdout was also the wrong stream: a redirected stdin still hangs a prompt. | ||
| - `stash impl --continue-without-plan` confirmed the flag with a second prompt | ||
| that was not gated at all, so a CI run with no plan on disk blocked there even | ||
| though the flag had already granted consent. The flag is now taken as consent | ||
| in non-interactive runs and only re-confirmed interactively. | ||
|
|
||
| All four now use the shared `isInteractive()` helper (stdin is a TTY and `CI` | ||
| is not set to `1`/`true` in any case), matching `stash plan`. Non-interactive | ||
| runs take the path they always should have: `stash init` skips the chain offer | ||
| and prints the `plan --target` hint, the Proxy-vs-SDK question defaults to | ||
| SDK-only, and `stash impl` proceeds without prompting. |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.