Repository navigation
Typing into your own idle chat reopens it instead of saying it's available - #2469
Draft
santoshkumarradha wants to merge 3 commits into
Draft
santoshkumarradha wants to merge 3 commits into
santoshkumarradha wants to merge 3 commits into
Conversation
Give the ownership watcher a child context and a separate join so its own lease release cannot announce a viewer location after idle closure. Keep final publication on the existing run context until Batcher.Close joins it. Cancelling that shared context early breaks the closing-upload guard. Reuse the deterministic release regression and add run-cancellation coverage. Keep takeover, failed-take recovery and work refusal semantics unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Draft: this changes chat ownership, so it needs the owner's yes before merging.
What the user saw. A chat on this computer goes idle in the background and releases its hold cleanly. When you type into it again, you sometimes get "This chat is available to continue here." instead of the chat reopening. No other computer had taken it, and this computer was still the holder.
Cause. When an idle chat closed, the drive released its hold before stopping its own ownership watcher. The watcher could then read that release and treat it as losing ownership. It wrote a bare "available" location, with no holder, into the app. When that landed after the correct "here" location, Send's refusal check returned it before the reopen path ran. This came in with 8cca2fe, which reached app/v3 in #2009 together with the ownership follower from #1990.
Fix. The ownership watcher gets its own context and done channel, derived from the drive's run context, so an outer cancel still stops it.
Drive.Closenow:Batcher.Close, which still joins the final publish before cancelling its request;The watcher needs its own lifetime because stopping it together with the upload interrupted the final publish and made the existing closing-upload guard panic (
TestL4FixDriveCloseJoinsUpload).No refusal rules change. A real takeover from another computer still shows "available" or "held elsewhere". A failed take still leaves the chat free. No new locks were needed: everything the watcher touches is already synchronized through the drive's and the batcher's existing locks, and the audit is in the review notes.
Validation.
TestDriveOwnReleaseDoesNotBecomeViewerholds the watcher's lease check until the correct location has landed, then lets the stale write land last. It fails 20/20 on base and passes with the fix.TestDriveRunCancelStopsOwnershipWatcherchecks that an outer cancel still stops the watcher.TestL4FixDriveCloseJoinsUpload,TestDriveSideSupersededStopsTools,TestReleasedFailedTakeKeepsSourceClosedAndAvailableandTestAppTakeInstallFailureS5.TestAppIdleReleaseI1I2BackgroundChatStaysReleasedUntilSendat-count=500 -cpu=4gives 0 refused sends both with and without-race. Base gives 1/500 without-race.-count=20:internal/syncsetuppass. The hosted-proof test is skipped because it needs a hosted runner.TestAppTake*tests and the idle-release tests pass, except idle row-count failures that reproduce identically on base and are tracked separately.🤖 Generated with Claude Code