You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: guard resolved write targets and sweep their stale temps
Two follow-ups from review of the symlink-preservation change.
Re-check the real-home guard against the resolved target. Callers such as
saveConfig validate only their logical config dir, which passes when
OPENCODEX_HOME points at a temp fixture. Resolving a symlink out of that
fixture could then land on the protected home the caller had just
cleared, so the guard now runs again on wherever the write actually
terminates. Inert in production, where the guard is disarmed.
Sweep stale response-state temps in the resolved directory too. Temps are
created beside the resolved target, so a symlinked responses-state.json
stranded them in the link's real directory while startup recovery only
scanned the literal config dir. A crash between write and rename would
have left a private snapshot temp there permanently. Both directories are
now swept, collapsing to one when nothing is symlinked.
Also assert the dangling-symlink cases replace the link rather than
following it: reading through the link passed either way.
0 commit comments