Repository navigation
Leave a dangling shared symlink alone when setting up an agent account - #14103
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
[Medium impact] The PR appears safe to merge; no outstanding findings remain. SummaryThe PR preserves dangling shared-folder symlinks during account setup and removes scratch homes when setup fails. The latest change checks that the failed-add test reports the expected setup error. Reviews (4) · Last reviewed commit: "Test failed account setup error" · Reviewed by Greptile |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
chessing234
left a comment
There was a problem hiding this comment.
everything seems fine, ready to merge.
quattro now writes a recovery receipt into the scratch home right after linking the shared folders. Both steps sit inside the cleanup, so a home that fails either is removed rather than left in .pending without a receipt recovery can read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reviewed and verified. The bug is real on current This branch conflicted with Checked on a disposable Omarchy worker: Second opinion from Codex Medium reviewed the combined change against This is now waiting on the maintainer. |
|
Thanks @chessing234 — I appreciate the review. I rechecked the current head and also tightened the failed-setup regression in |
|
Re-checked at On a worker built from the Omarchy ISO, at this head: The second opinion came from Codex Medium, which found nothing wrong with the new lines and agreed the change is still proportionate. Independence is not guaranteed. The locale point above came from Codex, and I checked it against the file. It merges cleanly into current |
omacom#14103) * Leave a dangling shared symlink alone when setting up an agent account Co-Authored-By: Claude Opus 5.5 <[email protected]> * Only skip a dangling shared link, and test failed-setup cleanup Co-Authored-By: Claude Opus 5.5 <[email protected]> * Test failed account setup error --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Omarchybot <[email protected]> (cherry picked from commit f51ecf1)
Adding, switching to or auto-switching between agent accounts fails outright when one of the primary home's shared folders is a symlink whose target doesn't exist yet. A dotfiles link like
~/.claude/skills -> ~/dotfiles/claude/skillsbefore the dotfiles have synced is one example.link_shared()inbin/omarchy-agent-account-stateruns(primary / name).mkdir(parents=True, exist_ok=True)for every shared folder. On a dangling symlink,exist_okdoesn't help:mkdirraisesFileExistsError. Soomarchy agent account add claude Workdies with a traceback and "Couldn't set up a home for the new account.". It also leaves its scratch home inaccounts/claude/.pending/login-*, becausebegin()doesn't clean up after itself.useand the automatic switch go through the same function.begin()removes its scratch home if setting it up fails, so a failure no longer leaves a straylogin-*folder.Testing
agent-account-test.shmakes~/.claude/skillsa dangling symlink before the firstadd. It checks that the add succeeds, that the user's link is untouched and still shared into the new account, and that.pendingis empty afterwards. Onquattrothe add fails with theFileExistsErrorabove (not ok - adding an account works when a shared folder is a dangling symlink). With this change all 28 checks pass.Found while auditing the new multi-account flow from #13770 in a sandboxed
HOME.🤖 Generated with Claude Code