fix: batch argv by command-line length, and leave a usable log when a run fails - #2
Merged
Conversation
2 tasks
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
A single spawn carried every changed path, and Windows caps the whole command line at 32767 characters - 2416 CI paths met ENAMETOOLONG well before oxfmt ran. File lists are now split by cumulative length, costed against a 30k budget after the executable, config and flags take their share, and each batch is spawned on its own: --list-different merges what the batches report, format stops at the first failing batch, and git add moves from a fixed 100 paths per call - which deep CI paths could still overrun - to the same length-based split. Fixes #1
An unexpected error used to surface as one line - the shape of the ENAMETOOLONG report in #1, where the message was all there was to go on. Now the stack prints whenever CI is set, or locally under --verbose, and every crash also writes a report to the temp directory - version, node, platform, command, cwd, and the inspected error with its code and syscall kept and its arrays capped - so an issue can say attach the log and the log is enough. The rendering lives in errorReport.ts rather than the CLI shell, inside the enforced 100% coverage.
pre-commit fixes and re-stages what is staged; commit-msg fixes the message itself. CI keeps the range check for what hooks never see.
soroushm
force-pushed
the
fix/argv-length-limit
branch
from
August 20, 2026 20:59
a12bb3a to
f456ff2
Compare
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.
What this changes
Closes #1. File lists are split into batches by cumulative command-line length before being handed to a spawn - for both oxfmt invocations and
git add- so a run over thousands of changed files no longer dies withENAMETOOLONGon Windows. Unexpected errors now print their full stack in CI (or under--verbose), and every crash writes anoxfmt-quick-error.logreport to the temp directory that can be attached to an issue as-is. Ships as 1.0.1, with release notes.Also adds husky hooks running
ai-watermark-guardon staged files and commit messages, complementing the CI checks.Why
Every oxfmt invocation carried the whole changed-file list in a single spawn, and Windows caps a command line at 32767 characters - the 2416 CI paths in #1 hit the limit before oxfmt ran.
git addwas already batched, but by a fixed count of 100 paths, which deeply nested CI paths could still overrun; it now uses the same length-based split. And when the failure happened, the one-linespawnSync ... ENAMETOOLONGmessage was all the reporter had to go on - the stack, the error'scode/syscall, and the environment now land in the CI log and the report file instead of being dropped.Checklist
pnpm test:coveragepasses - the package is held at 100% (66 tests; the newbatch.tsanderrorReport.tsare inside the enforced set)pnpm lint,pnpm typecheckandpnpm format:checkpasslistDifferent/format, length-basedstageFiles, and the error-report content (property retention, array capping, write-failure fallback); also reproduced end-to-end on Windows with 2500 changed files