Skip to content

fix: ensure non-TTY agents dont hang - #172

Merged
Simon Knott (Skn0tt) merged 4 commits into
microsoft:mainfrom
Skn0tt:agents
Apr 2, 2026
Merged

Simon Knott (Skn0tt) merged 4 commits into
microsoft:mainfrom
Skn0tt:agents

Conversation

@Skn0tt

@Skn0tt Simon Knott (Skn0tt) commented Apr 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes microsoft/playwright#39986:

  • prevents createFiles from hanging in quiet mode
  • add --test-dir flag, which was only configurable interactively before

@Skn0tt Simon Knott (Skn0tt) self-assigned this Apr 2, 2026
@Skn0tt Simon Knott (Skn0tt) changed the title fix: fix: ensure non-TTY agents dont hang Apr 2, 2026
Comment thread src/generator.ts Resolved
Comment thread src/cli.ts Resolved
Comment thread src/cli.ts
@@ -34,6 +34,7 @@ program
.option('--quiet', 'do not ask for interactive input prompts')
.option('--gha', 'install GitHub Actions')

@karlhorky Karl Horky (karlhorky) Apr 2, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simon Knott (@Skn0tt) I think there's still not a --no-gha flag for non-interactive rejection of GitHub Actions workflow files, as I mentioned here:

@Skn0tt Simon Knott (Skn0tt) Apr 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's needed, GitHub Actions workflow files are off unless --gha is passed. So --no-gha is the default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that requires the --quiet flag, which hides the defaults

it's less obvious what this does:

pnpm create playwright --browser=chromium --test-dir=playwright --quiet

it would be easier to understand if you can just exhaustively pass in all options (this would break after your PR):

pnpm create playwright --browser=chromium --test-dir=playwright --no-gha

we're getting into the same conversation territory in the new PR, so I'll continue over here:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original issues #39986 and #39987 weren't actually resolved by this PR

There may be an option to complete this over here:

@Skn0tt
Simon Knott (Skn0tt) merged commit c0f2d83 into microsoft:main Apr 2, 2026
13 checks passed
Pavel Feldman (pavelfeldman) added a commit that referenced this pull request Nov 6, 2026
…187)

* fix: overwrite prompt, option parsing, workflow and epilogue issues

- Ask before overriding existing files in interactive mode again; the
  check compared relative paths against absolute ones (regression from #172).
- Check for conflicting files before installing anything, skip files whose
  content is unchanged, report paths relative to the cwd and add the
  `--force` option the error message refers to.
- Accept `--lang JavaScript`/`javascript`/`JS`, comma-separated `--browser`
  lists, and reject unknown values for both.
- Install only the selected browsers in the generated workflow.
- Only use `cache: "npm"` in the workflow for npm with a package-lock.json;
  actions/setup-node fails without a lock file.
- Match whole `.gitignore` lines, with or without leading/trailing slashes.
- Escape `--test-dir` in the generated config and tsconfig.json, and do not
  expand `$&`-style patterns in template values.
- Only suggest an enabled project and existing files in the closing message.

Fixes microsoft/playwright#43950
Fixes microsoft/playwright#43951
Fixes microsoft/playwright#43952
Fixes microsoft/playwright#43953
Fixes microsoft/playwright#43954
Fixes microsoft/playwright#43955
Fixes microsoft/playwright#43956
Fixes microsoft/playwright#43957

* test: normalize line endings in new tests on Windows

Templates are checked out with CRLF on Windows runners. Also mark the
tests that download browsers as slow, like the current directory test.

* chore(ci): make Node.js 22 the main version, drop Node.js 20

Node.js 24 and 26 jobs keep running but no longer fail the workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: create-playwright should ensure non-interactive setup for AI agents

3 participants