Skip to content

Speech-triggered proactivity: live speech never reaches the prompt when the JIT lane delivers #12852

Closed

Description

@aryanorastar

What

When the JIT lane handles a speech-triggered proactivity visit and decides to deliver, the live speech that prompted the visit never reaches the prompt. Only the legacy-director path sees the == LIVE SPEECH == section.

Where

desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextProactivityEngine.swift, in evaluateFromSpeech:

if await JITProactivityCoordinator.shared.handle(
  fence: fence, snapshot: snapshot, frame: frameSample.frame,
  authorizationSnapshot: authorizationSnapshot)      // L359 — no speech argument
{
  return                                             // L363
}
let speechSection = ContextProactivityPromptBuilder.liveSpeechSection(speech)  // L365
await evaluateAndDeliver(... speechSection ...)

handle(fence:snapshot:frame:authorizationSnapshot:) takes no speech parameter, and liveSpeechSection is built only after the early return. In JITProactivityCoordinator.handle, .deliver returns true — JIT delivers on its own — so the engine returns at L363 with the speech never having been passed anywhere.

The same call shape is used by contextEntered (L222) and evaluateAfterDeparture (L280), which is correct: those two lanes have no speech to give. Only the speech lane loses evidence.

Why it matters

A spoken question answered by the JIT path would be answered without the speech that prompted it — the model sees the screen frame and context snapshot, but not what the user said.

Why it is not urgent

No shipped impact today:

  • the transcript flag is dogfood-only (isTranscriptProactivityEnabled is hard-off outside AppBuild.isNonProduction)
  • JIT fails closed to the legacy director by default, and the legacy path does get the speech section

The bug only becomes reachable if both lanes widen — JIT on by default and transcript proactivity out of dogfood. Worth fixing before that, not before shipping either one alone.

Shape of a fix

Give handle an optional speech argument that the two non-speech lanes omit, and thread it into whatever the JIT lane hands its prompt builder. The bounded framing already exists and should be reused rather than reinvented: ContextProactivityPromptBuilder.liveSpeechSection applies the untrusted-data framing, ContextDestinationKey.singleLine(_:limit: 160) flattening, and the ≤6-slice cap. The JIT path must not receive raw transcript text on a looser contract than the legacy path already holds itself to.

Provenance

Raised in review of #11804 (#11804), which the reviewer asked be recorded as a follow-up rather than changed in that PR — its routing work is what made this visible, and #12407 closed the related .suppressed asymmetry. Verified against b81fa980: the call sites, handle's return branches, and the position of the liveSpeechSection build were each read directly rather than inferred.

Activity

  1. added
    understand
    p2
    and removed
    understand
    p2
    on Oct 6, 2026
  2. aryanorastar commented on Oct 29, 2026

    @aryanorastar
    CollaboratorAuthor

    Fixed on main by #20494 (d04010dffc). That commit removes the JIT proactivity producer, including ContextProactivityEngine and JITProactivityCoordinator, so live speech no longer hits that early return.

  3. moved this from Someday to In review in omi TODO / bountieson Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2understand

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions