Repository navigation
Conversation
`apify init` with no name and a non-TTY stdin never terminated: the retry loop around the prompt treated a permanent failure as retryable and wrote ~28 MB/s to stderr until the process was killed. - --yes now uses the current directory name, as the help already promised. - The name prompt validates inside inquirer, so a typo re-asks and a prompt that cannot be answered fails once with a message naming the escape hatch. - The directory confirmation no longer turns "cannot ask" into "no", which exited 0 having done nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A directory called `my_project` or `scraper.v2` is not a legal Actor name, so --yes failed where the help says it should succeed. The Python branch already sanitized its package name; do the same for the directory name, and keep the clean error for names that sanitizing cannot save. Also deduplicate the dist paths and spawn environment shared by the two e2e runners. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The local harness resolves the project type against the repo root, so the "directory confirmation" test was a duplicate of the missing-name one under a misleading name. The e2e test covers that path in a real subprocess, and now asserts the message rather than just a non-zero exit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The positional name was never validated, so `apify init 'Bad Name!!'` exited 0 and wrote a name that only failed later, on push. Both new non-interactive errors point the user at that argument, so it has to hold up. Also share the prompt validator with `apify create` and track the name source so the --yes failure quotes what it actually read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
l2ysho
marked this pull request as ready for review
October 8, 2026 17:20
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
TL;DR
apify initnever terminated when stdin was not a TTY. Fixed, along with three other defects on the same path.What was broken
apify initwith no name and a non-TTY stdin never exited. Not a blocked read — a retry loop writing ~28 MB/s to stderr. Measured 152 MB in 6 s, which also makes the process hard to kill.stdinCheckWrapperthrows whenever stdin cannot be read. The loop caught that, printed it, and retried. The error is permanent, so the retry could never succeed.What changed
--yesdid not skip the name prompt, thoughinteractiveNoteand theapify init --yesexample both promise it doesinit 'Bad Name!!'exited 0 and wrote that name, failing later on pushD2 is fixed by removing the loop, not capping it. Validation moved inside inquirer's own
validate, so a typo still re-asks interactively, while a prompt that cannot be answered fails once with a message naming the escape hatch:Two supporting changes: the directory name is now sanitized for every project type rather than only Python (
my_project→my-project), and the prompt validator is shared withapify create, which had its own copy.Behavior changes worth a reviewer's attention
Tests
Three e2e tests through a new
runCliBoundedhelper, plus four local tests.Both layers assert on the loop itself, not on a timeout. A hang and a loop are indistinguishable by deadline and cost the full deadline either way. The helper caps combined output at 256 KB and kills on breach, so a regression fails in under a second.
execa's own
maxBufferwas the obvious alternative and was measured instead of assumed: 7–20 s to trip, against 25–500 ms for the counter. In one run it blew past its own 15 s timeout and still reportedtimedOut: false.Not in scope
readStdin()at entrypoint load, before any command code runs — #1206, fixed by #1330. Verified: with the eager read stubbed out, that case exits 0 in 1.3 s with the default name.--non-interactiveflag) is adjacent but different. It covers pseudo-terminals, where a TTY exists; this is the plain non-TTY path.--confirm/--no-confirm, which do not exist.initnow has its own messages; other commands still print the misleading default.validateActorNamesays "maximum of 30 characters" whileACTOR_NAME.MAX_LENGTHis 63. Pre-existing; the new--yesfailure path surfaces it more often.Checks
lint,format,buildclean.test:local660 passed. Local e2e 44 passed. No dependency changes, so no install-size impact.update-docsproduces no diff — flags, args, description and examples are untouched.CI's one red check is
actors info --input, inherited from master. The same assertion fails on master's own E2E runs daily back to 5 October, and #1473 fixes it.🤖 Generated with Claude Code