8 Commits

Author SHA1 Message Date
can1357 e8090bb48a feat: introduced binary file detection to prevent encoding corruption
- Introduced `isProbablyBinary` utility to sniff file headers for NUL bytes or invalid UTF-8 sequences.
- Updated `ReadTool` to use the binary sniffer, preventing mojibake corruption in output when reading non-text files.
- Refined `file-mentions` auto-reads to skip binary files and mark them as `binary` in the message transcript.
- Added comprehensive unit tests for binary detection logic, covering NUL bytes, truncated multibyte characters, and path-based file sniffing.
2026-06-30 02:59:41 +02:00
oldschoola a2854ba768 fix: migrate coding-agent tests from fs.rm to removeWithRetries
Migrate 203 test files (356 call sites) from fs.rm/fs.rmSync to
removeWithRetries/removeSyncWithRetries to reduce EBUSY test failures
on Windows. removeWithRetries is now exported from @oh-my-pi/pi-utils.

The migration uses a regex-based approach that:
- Replaces fs.rm(path, { recursive, force }) → removeWithRetries(path)
- Replaces fs.rmSync(path, { recursive, force }) → removeSyncWithRetries(path)
- Replaces fs.rm(path) → removeWithRetries(path) (no options)
- Skips fs.rm/fs.rmSync inside template literals (bun --eval scripts)
- Adds imports to existing @oh-my-pi/pi-utils import or creates new one
- Removes unused fs imports where fs.rm was the only fs usage (4 files)
2026-06-23 15:28:05 -07:00
devxpi d082abcebd fix(coding-agent): clean up file-mentions tests and add CHANGELOG entry for quoted path fix 2026-06-18 13:14:30 +08:00
devxpi 3646facd45 fix(coding-agent): support quoted paths with spaces in file arguments and mentions
- Support single and double quoted file paths starting with @ in CLI arguments
- Update FILE_MENTION_REGEX and extraction logic to match and resolve quoted mentions with spaces
- Add regression tests covering unquoted, single-quoted, and double-quoted file mentions
2026-06-18 13:14:30 +08:00
can1357 8943fb8084 refactor(file-mentions): removed fuzzy and prefix resolution for @-mentions
- Resolved @-mentions to exact existing paths only.
- Relied on the TUI @-selector to insert complete real paths.
- Dropped candidate scanning to avoid dragging in same-named files.
2026-06-05 15:51:37 +02:00
can1357 1dfab0a883 fix(file-mentions): resolved trailing-slash mentions to directories only
- Made `@`-mention resolution directory-aware so a mention ending in `/` or `\` matches only directory candidates.
- Stopped stripping the trailing separator and fuzzy-matching an arbitrary same-named file (e.g. npm scopes like `@scope/`).
- Left non-slash mentions unchanged.
2026-06-05 15:47:53 +02:00
can1357 e831c2c758 chore: reformat 2026-05-30 18:08:51 +02:00
can1357 3ade89fd1f fix(coding-agent): added fuzzy @file auto-read matching
Fixes #57
2026-02-13 14:07:38 +01:00