Skip to content

fix(desktop): make open_ask_omi report the chat-first composer it actually opens - #13234

Merged
Git-on-my-level merged 4 commits into
mainfrom
fix/open-ask-omi-automation-contract
Sep 9, 2026
Merged

Git-on-my-level merged 4 commits into
mainfrom
fix/open-ask-omi-automation-contract

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

What changed and why

open_ask_omi still polled the retired notch composer (showingAIConversation), so wait=true always returned openMs=timeout and wait=false's triggered=true lied about what opened. Typed Ask Omi is the chat-first main-window composer. This retargets the bridge action and snapshot to that surface without changing product UX or remounting a notch composer. Fixes #13201.

Product invariants affected

  • INV-CHAT-1
  • INV-NAV-1

How it was verified

Swift unit tests only, from this worktree at fix/open-ask-omi-automation-contract.

CI job Desktop Swift Static & Test Contracts crashed HomeStageCloseSemanticsTests with signal 5: ShellSummon.shellWindow() reads NSApp.windows, and NSApp is a nil IUO in the headless XCTest host. Local GUI sessions hid this. Follow-up commit keeps OpenAskOmiAutomation nil-safe (shellWindowIfAppRunning / runningApplication) and never creates NSApplication.shared or opens a window when AppKit is not running. ShellSummon product behavior is unchanged.

cd desktop/macos && xcrun swift test --package-path Desktop --filter 'HomeStageCloseSemanticsTests|DesktopAutomationWindowPresentationTests|QueryShellTests|DesktopAutomationBridgeRouteTests'

Selected tests: 83 passed, 0 failed (was 82; added testOpenAskOmiStaysNilSafeWithoutNSApplication).

Isolated CI-style runner (desktop/macos/scripts/swift-test-suites.sh, discovery restricted to these two suites, OMI_SWIFT_TEST_SUITE_BATCH_SIZE=1):

Ran 2 Swift suites in isolation with 2 worker(s), 300s per-suite budget

HomeStageCloseSemanticsTests and DesktopAutomationBridgeRouteTests both passed.

Also: python3 desktop/macos/scripts/check_desktop_test_quality.py (OK), ./scripts/swift-format-wrapper.sh lint on changed Swift files (OK), OMI_PR_BODY_FILE=/tmp/pr-body-13201.md make preflight (25 checks passed).

The same CI run's KernelTurnRecordedProjectionTests.testAnOwnerTransitionDissolvesAnOutstandingRevocation failure is a main-branch flake also seen on an unrelated PR. It is not caused by this change and was not touched.

Installed app binaries were not rebuilt, relaunched, or live-tested. Three authenticated QA sessions on this machine took precedence. Pre-fix live evidence (quiet automation, openMs=timeout, triggered=true with askOmiOpen=false) is in issue #13201 (slot omi-e2e-1, source 9ff63a63b047, 2026-09-08).

Tests

Regression coverage that would have caught #13201:

  • HomeStageCloseSemanticsTests.testOpenAskOmiUnderQuietDoesNotTimeOutOrExitQuiet — quiet stays quiet; no openMs/focusMs timeout
  • HomeStageCloseSemanticsTests.testOpenAskOmiWaitFalseReturnsMainChatTarget — wait=false returns target=main_chat
  • HomeStageCloseSemanticsTests.testOpenAskOmiContractOmitsFocusTimeoutWhenQuietBlocksFocus
  • HomeStageCloseSemanticsTests.testOpenAskOmiStaysNilSafeWithoutNSApplication — no NSApp IUO crash / no window open in a headless host
  • DesktopAutomationWindowPresentationTests.testOpenAskOmiLeavesQuietWindowsMountedAndUnrevealed
  • DesktopAutomationBridgeRouteTests.testOpenAskOmiIsRegisteredOnTheMainChatSurface
  • QueryShellTests.testChatComposerSnapshotExposesPlaceholderAndMode

Failure class (fixes)

Failure-Class: none

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 20 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Git-on-my-level added a commit that referenced this pull request Sep 9, 2026
…ication

CI's XCTest host has no NSApplication, so ShellSummon.shellWindow() crashed
on the NSApp IUO. Guard the new automation path instead of changing
product summon behavior (#13201, #13234).

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Correction on the KernelTurnRecordedProjectionTests.testAnOwnerTransitionDissolvesAnOutstandingRevocation failure in Desktop Swift Static & Test Contracts: it is not a generic main flake. The test (from #12664) runs its owner transition against UserDefaults.standard, and the fence only cycles the revocation when the planned owner differs from the persisted one. The standard xctest domain is shared across parallel suite processes on the runner, so when a concurrent suite has auth_userId set there the transition is a same-owner no-op and the assertion fails. Reproduced locally by seeding that key; unrelated desktop PRs pass or fail depending on batch scheduling.

Test-only fix: #13260. Nothing in this PR touches owner or defaults state; once #13260 lands, a rebase or rerun of this job should be green.

Git-on-my-level and others added 4 commits September 9, 2026 15:25
…ually opens

Typed Ask Omi is the main-window composer, not the retired notch panel. The
action now selects Chat, reuses the home_open_chat caret claim, and returns
target=main_chat without calling revealForUser, so quiet automation stays
quiet instead of timing out (#13201).

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
The action moved into Desktop/Sources/Automation/; flow lint only
discovers names from that inventory, so the updated YAML flows were
reported as unknown actions.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
…ication

CI's XCTest host has no NSApplication, so ShellSummon.shellWindow() crashed
on the NSApp IUO. Guard the new automation path instead of changing
product summon behavior (#13201, #13234).

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
… disclose the resting surface on close

Addresses cubic-dev-ai review feedback on #13234:
- isComposerPresented now reads visibleRoute (the mounted destination's
  markRouteVisible acknowledgement), so a navigation command is no longer
  reported as an already-open composer; wait=true waits (bounded) for the
  mount before recording openMs instead of returning an instant openMs for
  a composer that is not on screen yet (P1).
- close_ask_omi still closes the floating panel, but when the chat-first
  composer is presented it reports mainChatPresented/mainChatClosed so a
  paired flow cannot read a floating-bar-only result as Ask Omi closed (P2).
- ask-omi-animation-benchmark S4 close capture retargeted to main, matching
  the open step's surface (P3).
- Quiet-contract test now asserts focusMs is nil (omitted), not merely
  != timeout which passed trivially (P3).
- Presentation-mode defers restore the exact previous value (P3).
- ask-omi-open-benchmark covers: drops DesktopAutomationActivationActions,
  which the flow never exercises; chat-paste covers it via
  paste_clipboard_into_chat/chat_composer_snapshot (P3).
@Git-on-my-level
Git-on-my-level force-pushed the fix/open-ask-omi-automation-contract branch from 165b2b5 to 89e025f Compare September 9, 2026 09:06
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Addressed all six unresolved cubic review threads in 89e025f (branch rebased onto latest main first; patch-equivalent by range-diff):

  • P1 DesktopAutomationAskOmiActions.swift: isComposerPresented now reads visibleRoute (the mounted destination's markRouteVisible acknowledgement) instead of route. wait=true waits (bounded 500 ms) for that mount before recording openMs, so a navigation command is no longer reported as an already-open composer. New regression test testOpenAskOmiWaitTrueTimesOutUntilChatMountAcknowledges pins the honest-timeout behavior.
  • P2 close_ask_omi: registration moved next to open_ask_omi in DesktopAutomationAskOmiActions.swift (also keeps the bridge file under its line-count baseline). It still closes the floating panel, but when the chat-first composer is presented it now reports mainChatPresented=true / mainChatClosed=false, so a paired flow cannot read a floating-bar-only result as "Ask Omi closed". Covered by testCloseAskOmiDisclosesMainChatRestingSurfaceWhenPresented.
  • P3 animation benchmark: S4 close capture retargeted floating → main (and the same stale target: floating example in e2e/harness.md).
  • P3 quiet contract test: asserts focusMs is nil (omitted), not merely != "timeout" which passed trivially.
  • P3 presentation-mode defers restore the exact previous value instead of forcing .normal.
  • P3 open-benchmark covers: drops DesktopAutomationActivationActions.swift, which the flow never drives (chat-paste covers it via paste_clipboard_into_chat / chat_composer_snapshot).

Verification (worktree at 89e025f): focused suites HomeStageCloseSemanticsTests|DesktopAutomationWindowPresentationTests|QueryShellTests|DesktopAutomationBridgeRouteTests — 85 passed, 0 failed. Full repo preflight against origin/main — 25/25 checks passed (the hook's own invocation crashed only because its shebang resolved Python 3.9; the equivalent gate was run explicitly with Python 3.14 and passed, which is the documented basis for the narrow --no-verify transport bypass).

All six review threads resolved as addressed. CI is running on the new head.

@Git-on-my-level
Git-on-my-level merged commit 60a5d42 into main Sep 9, 2026
29 of 32 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/open-ask-omi-automation-contract branch September 9, 2026 09:51
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.

Clarify Ask Omi semantic open behavior under quiet automation presentation

1 participant