Problem
When ~/.agents/ is a directory symlink, checkSymlinkSafety throws a terse error directing the user to remove the symlink. It doesn't warn that other files inside the symlinked directory will become inaccessible, leading to silent data loss.
Context
Encountered during the #377 migration. The configs.macos side of the migration (configs.macos#177) will eliminate the directory symlink, but until that runs, users hitting this error need actionable guidance.
Solution
Update the error message in checkSymlinkSafety to list the contents of the symlinked directory (up to 5 entries, with a count of remaining entries if more). This shows the user exactly what's at risk without hardcoding any assumptions about the directory.
Use readdirSync on the symlink path, which naturally follows the link.
Acceptance criteria
Problem
When
~/.agents/is a directory symlink,checkSymlinkSafetythrows a terse error directing the user to remove the symlink. It doesn't warn that other files inside the symlinked directory will become inaccessible, leading to silent data loss.Context
Encountered during the #377 migration. The
configs.macosside of the migration (configs.macos#177) will eliminate the directory symlink, but until that runs, users hitting this error need actionable guidance.Solution
Update the error message in
checkSymlinkSafetyto list the contents of the symlinked directory (up to 5 entries, with a count of remaining entries if more). This shows the user exactly what's at risk without hardcoding any assumptions about the directory.Use
readdirSyncon the symlink path, which naturally follows the link.Acceptance criteria
... and N morewhen there are more than 5