From d3e715937948dab74804338fa277fa256925b231 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Wed, 19 Aug 2026 01:58:13 -0700 Subject: [PATCH] review: pin the driver flip and correct the applyMobileDisplayMode contract - Tighten the held-branch driver assertion to the exact post-release state so it pins releaseDesktopTakeBack's flip rather than merely "not mobile". - applyMobileDisplayMode's doc claimed reclaimTerminalForDesktop gates its transitions on the returned convergence flag. No branch does after this change; say so, so the gate is not reinstated. Hooks skipped (machine load); oxfmt --check and oxlint verified clean manually. --- src/main/runtime/orca-runtime.ts | 6 ++++-- src/main/runtime/remote-desktop-driver.test.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/runtime/orca-runtime.ts b/src/main/runtime/orca-runtime.ts index c8a48430c57..d19055d5716 100644 --- a/src/main/runtime/orca-runtime.ts +++ b/src/main/runtime/orca-runtime.ts @@ -16771,8 +16771,10 @@ export class OrcaRuntimeService { // Returns the post-condition "no fit-override remains held" (#7588): `true` // when it cleared a held override OR nothing was held to begin with, `false` // only when a restore was attempted and the resize failed (override rolled - // back, still held). reclaimTerminalForDesktop gates its driver/mode - // transitions on this; other callers ignore it. + // back, still held). Informational for every caller today — + // reclaimTerminalForDesktop deliberately does NOT gate on it, because an + // explicit take-back must drop the lock even when the resize cannot + // converge. Do not reinstate a convergence gate there. async applyMobileDisplayMode(ptyId: string): Promise { const mode = this.getMobileDisplayMode(ptyId) const inner = this.mobileSubscribers.get(ptyId) diff --git a/src/main/runtime/remote-desktop-driver.test.ts b/src/main/runtime/remote-desktop-driver.test.ts index 355a65c49b8..e031aed8d18 100644 --- a/src/main/runtime/remote-desktop-driver.test.ts +++ b/src/main/runtime/remote-desktop-driver.test.ts @@ -545,7 +545,7 @@ describe('remote desktop viewer width driver', () => { await expect(runtime.reclaimTerminalForDesktop('pty-1')).resolves.toBe(true) expect(runtime.getTerminalFitOverride('pty-1')).toBeNull() - expect(runtime.getDriver('pty-1').kind).not.toBe('mobile') + expect(runtime.getDriver('pty-1')).toEqual({ kind: 'desktop' }) expect(fitOverrideEvents.slice(notifierBefore).some((e) => e.mode === 'desktop-fit')).toBe(true) // A second click must not be needed, and must stay idempotent. await expect(runtime.reclaimTerminalForDesktop('pty-1')).resolves.toBe(false)