fix(macos): retire stale app copies after update - #5345
Merged
ronishrohan merged 3 commits intoSep 15, 2026
Merged
ronishrohan merged 3 commits into
ronishrohan merged 3 commits into
Conversation
Old AO bundles can still be launched after the relocation fix. Offer to move verified older copies from Downloads or Desktop to Trash so they cannot replace the maintained installation. Closes Untrivial-ai#3617
Pulkit7070
force-pushed
the
codex/fix-3617-stale-copy-retirement
branch
from
September 13, 2026 14:54
38f13c3 to
54aa292
Compare
ronishrohan
reviewed
Sep 14, 2026
A copy can change while the confirmation dialog is open. Preserve its device and inode, then re-read its identity, bundle ID, and version before moving the path to Trash.
ronishrohan
reviewed
Sep 14, 2026
ronishrohan
reviewed
Sep 14, 2026
Move each candidate to a private sibling path before validating it, then trash and validate that staged path. A replacement renamed into the original path after validation can no longer be what gets deleted, closing the residual TOCTOU gap between revalidation and trashing. On validation failure or a rejected trash the staged bundle is restored to its path. Compare canonical semver values during revalidation so a bundle whose plist version differs only textually (v0.10.3, padded, or +build) is not silently skipped after being listed.
ronishrohan
approved these changes
Sep 15, 2026
ronishrohan
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the latest head a428e76. The focused suite passes (26/26), CI is green, and the macOS manual race reproduction now preserves the replacement bundle with no staging residue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Old AO bundles left in Downloads or Desktop can still be launched after the macOS relocation fix. This PR offers to move verified older copies to Trash so they cannot replace the maintained installation.
Closes #3617.
Changes
~/Downloads/Agent Orchestrator.appand~/Desktop/Agent Orchestrator.app./Applicationsbuild.~/.ao, projects, sessions, databases, or caches.How to test
/Applications.Validation
cd frontend && npm test(314 files, 4,576 passed, 7 skipped)cd frontend && npm run typecheckcd frontend && npm run packageRisk
Cleanup is intentionally limited to two exact paths. Copies with missing or invalid metadata are left untouched.