Repository navigation
fix(takeover): require a running session for permits and publish complete leases - #305
Closed
ElbertePlinio wants to merge 5 commits into
Closed
ElbertePlinio wants to merge 5 commits into
ElbertePlinio wants to merge 5 commits into
Conversation
Member
Author
This was referenced Oct 8, 2026
Member
Author
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.
Three takeover bugs. This PR changes when an agent permit is granted, so it waits for an owner's merge decision.
#213: an agent permit now requires a running session record.
acquireAgentPermitchecks the registry before it creates any coordination, and again after the permit file is verified.withAgentPermitchecks once more, after its lease check and before the action. A delayed input call across teardown is refused before its action runs. Legacy and retained session directories stay readable. Desktop startup with theinherithome policy starts VNC and Xvfb while the session is stillstarting, so that path now skips the permit for astartingrecord.#298: the human lease is now written to a temporary file and linked into place. A peer that loses the claim never sees a partly written lease. The staging file is removed on every path.
#295: a new
AgentPermitUnavailableErrormarks any permit gate failure that happens before the action starts. The MCP input tools and the CLI pointer evidence now report it, andHumanControlActiveError, asnot-attempted. Failures in the action or in permit release stayattempted.Closes #213
Closes #295
Closes #298
packages/core/test/takeover.test.ts,session-retention.test.ts~/Artifacts/pickforge-batch3-2026-10-08/A-sol/validation--inherit-homedesktop sessions: create, click, destroyinheritstartup worked~/Artifacts/pickforge-batch3-2026-10-08/qa-AHumanLeaseHeldErrorA-sol/validationdesktop click,desktop drag; after releasenot-attemptedin evidence; after release:completedqa-A/actions-*.jsonlnot-attemptedbefore,attemptedafter, in MCP and CLIdesktop-input-captures.test.ts,desktop-pointer-evidence.test.ts~/Artifacts/pickforge-batch3-2026-10-08/213-295-298-takeover-coordination-cov.log