Repository navigation
Description
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 (
isTranscriptProactivityEnabledis hard-off outsideAppBuild.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.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn review
Activity
aryanorastar commentedon Oct 29, 2026
Fixed on main by #20494 (
d04010dffc). That commit removes the JIT proactivity producer, includingContextProactivityEngineandJITProactivityCoordinator, so live speech no longer hits that early return.