- Delayed reader cancellation so pipeline consumers can flush after producers are terminated.
- Kept the JavaScript watchdog behind bounded native timeout cleanup.
- Added native and executor regressions for timeout-time output draining.
Fixes#5316
unbounded_tail emulated Unix SIGPIPE on Windows by calling
std::process::exit(13) when a broken-pipe flush failed. Inside the
long-lived host shell that terminated the entire omp process with code
13 and no output, breaking the run contract that pi-uutils builtins
never call std::process::exit.
Flush uniformly across platforms so a broken pipe surfaces as a normal
io::Error and propagates to the caller, matching every other builtin
(e.g. uu-cat's handle_broken_pipe). Added a regression test covering the
streaming unbounded_tail path the reported repro exercises.
Fixes#5609
- Added normalization that translated escaped `\|` alternation to `|` outside character classes before default-mode matching.
- Refactored default matcher construction into a helper that retries compilation with malformed patterns escaped as literals after an initial failure.
- Added a regression test confirming `tools.xdev\|tools.toolbox` now returns the expected two matches in default mode.
- Rewrote logical /dev/fd operands to live OS descriptors before invoking in-process uutils.
- Added regression coverage for diff reading two process substitutions.
Fixes#5557
- Updated `run_fd_sync` to handle `io::ErrorKind::BrokenPipe` by returning exit code `141` without writing an error message.
- Added a regression test that verifies `fd` exits with `141` and empty stderr when stdout is closed early (e.g. `fd ... | head` scenario).
- Recorded the broken-pipe behavior fix in `packages/coding-agent/CHANGELOG.md`.
Added a direct-argv PTY entry point and used it for Windows launch sessions so portable-pty no longer re-quotes cmd.exe command text.
Rejected direct .bat and .cmd applications with guidance to use cmd.exe /c.
Fixes#5416
- Implemented bsd-to-gnu flag translation for `date`, `find`, `mktemp`, `sed`, and `tail` utilities to support native bsd command usage.
- Adjusted argument parsing logic in `ln` and `base32` to accommodate bsd-compatible short-flag aliases and behavior.
- Added comprehensive regression tests and bsd-specific compatibility suites across modified utilities to ensure consistent behavior.
- Updated project documentation to reflect the expanded cross-platform utility support.
- Added `rewrite_bsd_invocation` to detect macOS-style `stat -f FORMAT` syntax, preventing misinterpretation as GNU filesystem mode.
- Implemented `translate_bsd_format` to map BSD-specific format directives to GNU equivalents, including support for time forms, user/group IDs, and file metadata.
- Enabled BSD flag cluster parsing (`-LnfqF`) to allow common macOS command patterns to function correctly within the in-process `stat` utility.
- Added comprehensive unit tests to validate BSD syntax translation, sub-field handling, and error reporting for unsupported directives.
- Reflowed compile_pattern/wrapper_template comments and while-condition to rustfmt's preferred layout.
- Made wrapper_template a const fn to satisfy clippy::missing_const_for_fn under -D warnings.
A pattern like `"@types/bun": $V` parses to multiple root AST nodes and was
rejected with "Multiple AST nodes are detected". When no explicit selector is
given, retry the fragment wrapped in a minimal single-node context (JSON: `{ <frag> }`
selecting `pair`), quoting bare metavars so JSON parses. Falls back to the
original error if the wrapped form still fails, so bad patterns are unchanged.
Applies to both ast_edit (compile_pattern) and ast_grep (compile_search_patterns).
- Enabled deduplication of byte-identical edits in `apply_edits` to prevent false overlap errors.
- Added logic in `ast_edit_blocking` to filter out duplicate rewrite matches before staging.
- Updated `apply_edits` to collapse multiple identical replacements into a single deterministic operation.
- Added regression tests for both `apply_edits` and `ast_edit_blocking` to ensure identical matches resolve cleanly.
- Integrated 17 new coreutils-based shell builtins including `diff`, `date`, `ln`, `stat`, `seq`, `touch`, and others.
- Refactored vendored utilities to execute as in-process shell builtins by routing I/O, environment access, and path resolution through `pi_uutils_ctx`.
- Disabled process-level modifications (e.g., clock setting, hostname modification) to ensure safety and scope adherence within the shell environment.
- Implemented shell-specific features such as cancellation polling, custom exit code management, and efficient output streaming for all new builtins.
- Added base64, checksum utilities (md5, sha1, sha224, sha256, sha384, sha512, b2sum), path utilities (basename, dirname), and text processing tools (cut, tee, tr, paste, comm) to the shell.
- Registered new utility builtins in crates/pi-shell/src/coreutils.rs and crates/pi-shell/src/shell.rs.
- Updated Cargo.toml to include the necessary dependencies for the new core utilities.
- Vendored multiple uutils coreutils packages with custom adaptations for in-process I/O and path redirection using `pi-uutils-ctx`.
- Implemented consistent `run` entry points across all utilities to replace process-global termination and allow execution within the embedding application.
- Developed a shared `uu-checksum-common` library to centralize CLI construction, checksum computation, and digest validation logic.
- Integrated thread-local command handling and resource management to support memory-bounded stream processing and localized error reporting.
Replace mmap-backed native grep reads with bounded owned reads so concurrently rewritten files cannot fault the process or mutate captured search bytes.
Add a regression for oversized prefix snapshots and remove the direct memmap2 dependency. Fix existing pi-natives doc-markdown warnings so the native clippy gate passes.
Fixes#5205
- Removed the bash command fixup system and associated logic from both the Rust and TypeScript components.
- Deleted the redundant fixup module and its exported implementations.
- Updated technical documentation and configuration settings to reflect the removal of pre-execution bash command rewriting.
- Implemented path_depth as a tie-break mechanism for fuzzy search results.
- Updated fuzzy_find_sync sorting logic to surface shallow matches before deeper ones during score ties.
- Added a regression test confirming that root-level directories rank above nested ones when scores are identical.
- Integrated PCRE2 regex engine with automatic fallback for patterns unsupported by the standard Rust engine.
- Implemented structured JSON output, byte offset reporting, and match replacement functionality.
- Added support for advanced file traversal including Gitignore integration, decompression of archives, and path filtering.
- Updated crate dependencies to include support for expanded grep CLI options and printer utilities.
- Added support for advanced grep features including Perl-compatible regex, match limits, and byte offsets.
- Implemented robust file and directory filtering mechanisms using include/exclude patterns and custom path rules.
- Enhanced output formatting with control over group separators, null-terminated output, and binary file handling.
- Integrated `grep-pcre2` and expanded test coverage for the builtin ripgrep functionality.
- Updated gitignore loading to filter out ancestor ignore rules that match the current explicit walk root.
- Retained unrelated parent ignore rules and processed local ignore files within the root normally.
- Added a regression test to ensure ignored roots still respect nested ignore rules.
- Added `walk_depth_bound` to calculate the maximum file path depth based on glob pattern segments.
- Configured the glob walker to restrict traversal depth for non-recursive patterns, preventing unnecessary scanning of subtrees that cannot match.
- Improved response times for narrow globs over large directories by pruning the search space earlier.
- Added test cases to verify depth-bounded matching behavior and pattern edge cases.