Repository navigation
fix: desktop Copy and replace buttons start a session again - #141
Merged
Merged
Conversation
…input SessionDriver bound .local to every .unselected intent. Copy and apply-replacement jobs do not take an input source, so the default bind threw invalidSessionState and every desktop Copy button and the menu bar replace button silently did nothing. Bind only for .input. Tests drive the real NativeDesktopHost and driver the way the desktop buttons do. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.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.
Outcome
Every desktop Copy button (overlay, menu bar popover, History row and context menu) and the menu bar "replace with formatted text" button work again. On installed 0.0.60 they did nothing, so text from a failed insertion could not be recovered from the UI even though the failure message says "you can copy the text".
Root cause:
SessionDriver.admitrantry job.bind(input: .local)for every.unselectedintent.CopySessionJobandDeferredReplacementJobuse the protocol defaultbind, which throwsIntegrationError.invalidSessionState(NSError code 8).NativeDesktopHost.startswallowed it and loggedDesktop action could not start. The one-line fix binds.localonly whenintent.operation == .input.SDLC bundle and risk
docs/sdlc/changes/2026-10-30-desktop-copy-apply-start/(intent, spec, plan, verification all approved)Verification
Evidence is committed under
docs/sdlc/changes/2026-10-30-desktop-copy-apply-start/evidence/.bash scripts/sdlc-checks.sh(the template'sscripts/sdlc.pydoes not exist in this repo)bash scripts/ci-basic-checks.shswift test: 618 tests, 26 skipped (pre-existing), 0 failurescopied; 0Desktop action could not startentries (installed 0.0.60: 11)0e0f3c1(the whitespace case passes both ways by design)Not clicked in a real window: overlay Copy, the three menu bar popover copy buttons, the History context menu, and the replace button. They all go through
NativeDesktopHost.copy/applyReplacement, whichDesktopActionStartTestsdrive through the production factory.Residual risk and rollback
Sources/UtterSession/SessionDriver.swift; no data or settings migration.Reviewer focus
SessionDriver.swift:98: confirm that only.inputneeds the.localbinding and that.restoreSelectionEdit(started with.text("")) is unaffected. Also check thatDesktopActionStartTestscall the realNativeDesktopHostinstead of building intents by hand.Companion (not in this PR): dictation into WeChat ending not-inserted, tracked separately in
2026-10-30-wechat-delivery-no-focus.