chore: sync core lib and CLAUDE.md from agent-core#17
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d565a0b. Configure here.
| if (backup) { | ||
| const backupPath = `${filePath}.backup`; | ||
| // Refuse if the backup slot itself is a pre-existing symlink. | ||
| assertNotSymlink(backupPath); |
There was a problem hiding this comment.
Backup symlink error misattributed to original file path
Low Severity
assertNotSymlink(backupPath) on the backup slot has no dedicated try/catch, so an ESYMLINK_REFUSED error falls through to the outer catch, which records the error against filePath (the original file) rather than backupPath. The generic message "target is a symlink; refusing to follow" doesn't identify which path is the symlink. A consumer investigating this error would look at the original file—which is a regular file—and find nothing wrong, while the actual symlink at ${filePath}.backup goes uninvestigated. The pre-read symlink check already demonstrates the correct pattern with a dedicated inner try/catch that adds success and reason fields.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d565a0b. Configure here.


Automated sync of lib/ and CLAUDE.md from agent-core.
Note
Medium Risk
Changes file read/write behavior in the auto-fixer by rejecting symlink targets, which could affect workflows that rely on symlinked files and impacts write/restore paths.
Overview
Adds a new
assertNotSymlinkguard and applies it throughoutlib/enhance/fixer.jsto refuse reading, backing up, restoring, or writing any file path that is a symlink.applyFixesnow checks the target path before reading and again immediately before writing (plus validates the.backuppath), andrestoreFromBackupsimilarly refuses symlinked backup/target paths to prevent symlink-based overwrite attacks.Reviewed by Cursor Bugbot for commit d565a0b. Configure here.