Skip to content

fix: desktop Copy and replace buttons start a session again - #141

Merged
IchenDEV merged 2 commits into
mainfrom
fix/desktop-copy-apply-start
Oct 30, 2026
Merged

IchenDEV merged 2 commits into
mainfrom
fix/desktop-copy-apply-start

Conversation

@IchenDEV

Copy link
Copy Markdown
Owner

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.admit ran try job.bind(input: .local) for every .unselected intent. CopySessionJob and DeferredReplacementJob use the protocol default bind, which throws IntegrationError.invalidSessionState (NSError code 8). NativeDesktopHost.start swallowed it and logged Desktop action could not start. The one-line fix binds .local only when intent.operation == .input.

SDLC bundle and risk

  • Bundle: docs/sdlc/changes/2026-10-30-desktop-copy-apply-start/ (intent, spec, plan, verification all approved)
  • Risk: medium (user-visible behavior of desktop output actions; no permission, privacy, signing, or release-pipeline change). Corrective intent for a regression first shipped in v0.0.51 (source trace).
  • Human decisions still required: merge, and whether this ships as its own patch release.

Verification

Evidence is committed under docs/sdlc/changes/2026-10-30-desktop-copy-apply-start/evidence/.

  • bash scripts/sdlc-checks.sh (the template's scripts/sdlc.py does not exist in this repo)
  • bash scripts/ci-basic-checks.sh
  • swift test: 618 tests, 26 skipped (pre-existing), 0 failures
  • Release-style app build: not run, no packaging/dependency/resource change
  • Real window on a dev build: History row Copy changed the pasteboard to the row's text; log shows terminal copied; 0 Desktop action could not start entries (installed 0.0.60: 11)
  • Failing first: 4 of 5 new tests fail on 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, which DesktopActionStartTests drive through the production factory.

Residual risk and rollback

  • Installed 0.0.60 stays broken until a release contains this.
  • Real-window coverage is one of six call sites; all share the same two host methods and driver path.
  • A host failure still only logs; visible feedback is a separate UX decision (non-goal).
  • Rollback: revert the one-line change in Sources/UtterSession/SessionDriver.swift; no data or settings migration.

Reviewer focus

SessionDriver.swift:98: confirm that only .input needs the .local binding and that .restoreSelectionEdit (started with .text("")) is unaffected. Also check that DesktopActionStartTests call the real NativeDesktopHost instead 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.

IchenDEV and others added 2 commits October 30, 2026 15:57
…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>
@IchenDEV
IchenDEV merged commit 3748367 into main Oct 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant