fix: uninstall when the control task is archived - #119
Merged
Conversation
Contributor
Merge Queue Status
This pull request spent 19 seconds in the queue, including 5 seconds running CI. Required conditions to merge
|
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.
Summary
Uninstall no longer depends on the persistent ThreadBear task being active. Before this change, archiving that task made its final title cleanup unreachable and stranded the installation; now any active native task can own a resumable uninstall, temporarily restore the archived home for cleanup, put it back exactly where it was, and remove ThreadBear without navigating away or using visual controls.
The prepared operation persists the exact initiator, main/controller identities, and original archive state. While it exists, maintenance, updates, and every ordinary title write stop; only cleanup writes from that initiator are accepted. Abort restores normal operation after archive recovery, and commit validates the clean main title plus restored archive state before removing state and the binary last.
Local teardown is checkpointed for interruption: pre-commit drift leaves every retry artifact intact, edited markerless managed guidance fails closed, and a retained candidate can finish or repeat the already-settled removal safely.
Fixes BEAR-113.
Linear: BEAR-113
Validation
go test ./...go test -race ./...go vet ./...The exact final head (
e30b61b064bd3351b37f3cce84fac884c7fa0a7a, arm64 SHA-256b80dbd32587e2cc3d13e1db336e3838560c1f6bb6c958c298cc17450a5cbad40) was installed into the real Codex environment. A completed-install state was seeded only to isolate this uninstall canary from the unrelated historical migration backlog; prepare onward used the installed candidate and supported native controls. The live run proved:Renamedand exact home-title writes were blocked by the installed hook while uninstall was prepared;No visual inspection, screenshot, browser automation, or computer-control tool was used.
Monitoring
The shipped-logic count sits exactly at the 2,000-line hard ceiling, so CI intentionally rejects any additional production Go or installer-shell line until another shipped path is simplified.