Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d651151a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (device.kind === 'device' && deviceTunnelIp === undefined) { | ||
| deviceTunnelIp = await resolveDeviceTunnelIp(device.id, timeoutBudgetMs); | ||
| } | ||
| return resolveRunnerCommandEndpoints(device, port, deviceTunnelIp ?? null); |
There was a problem hiding this comment.
Retry tunnel IP resolution on each device connect attempt
This caches deviceTunnelIp after the first probe, including the null case, so later retries in waitForRunner never call resolveDeviceTunnelIp again. Because resolveDeviceTunnelIp explicitly returns null on transient states (non-zero devicectl, non-success outcome, timeout), a physical device whose tunnel address appears a bit later can never have its tunnel endpoint added, and the full retry loop can fail even though a subsequent probe would have succeeded.
Useful? React with 👍 / 👎.
| output.on('finish', () => settle()); | ||
| armTimeout(); | ||
| source.pipe(output); | ||
| void pipeline(source, byteLimit, fs.createWriteStream(destPath)).then( |
There was a problem hiding this comment.
Keep a writable handle before deleting timed-out artifact file
The timeout/error path calls settle(error) which removes destPath, but the destination stream is now created inline and cannot be explicitly destroyed/closed first. On Windows, deleting a file that still has an open write handle can throw EPERM, so a timed-out/interrupted transfer can raise from cleanup instead of returning the intended rejection. Retaining the write stream handle and closing it before rmSync avoids this platform-specific failure.
Useful? React with 👍 / 👎.
446daa5 to
b62318a
Compare
Summary
Harden Node runtime, daemon shutdown, process/stream cleanup, platform discovery, and test lifecycle handling.
Fixes included:
packageManager, raise the Node engine floor, and expandformatcoverage for tooling config files.verbatimModuleSyntax,erasableSyntaxOnly, andrewriteRelativeImportExtensions.close, including app logs, Apple runners, and retained materialized paths.Buffer.concatin exec stdout capture and consolidate spawn/error handling.AbortSignalsupport torunCmdand return the daemon-recognized request-canceled error shape on abort.runCmdstdin throughpipeline(Readable.from(...), child.stdin)and keep benign earlyEPIPEhandling.pipeline()for better stream teardown/backpressure.Readable.fromWebfor fetch response download streams.AbortSignal.timeout/AbortSignal.anyfor fetch timeout handling where applicable.Touched-file count: 24. Scope intentionally spans tooling, daemon lifecycle, process I/O, platform discovery, and test cleanup from the requested all-around audit follow-ups.
Docs/skills were not updated because no CLI behavior, flags, workflows, or user-facing docs changed.
Validation
pnpm install --lockfile-only --frozen-lockfile
pnpm format
pnpm typecheck
pnpm vitest run src/utils/tests/exec.test.ts src/platforms/ios/tests/runner-transport.test.ts
pnpm vitest run src/daemon/tests/server-shutdown.test.ts src/utils/tests/exec.test.ts src/platforms/ios/tests/runner-transport.test.ts src/platforms/tests/install-source.test.ts
pnpm exec node --test test/integration/smoke-daemon-http.test.ts test/integration/smoke-open-remote-config.test.ts
pnpm vitest run src/daemon/tests/http-server.test.ts src/daemon/tests/artifact-materialization.test.ts src/utils/tests/daemon-client.test.ts
pnpm vitest run src/daemon/tests/upload.test.ts src/platforms/ios/tests/runner-transport.test.ts
pnpm check:fallow
pnpm check:unit
pnpm check