:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Quiet backstop narration when viewing the task
Date: 2026-07-02 Status: approved
Problem
Every permission request fires the deterministic speech backstop
(speakDeterministic(taskRunId, session, "needs_input") in
packages/core/src/sessions/sessionService.ts). shouldSpeak in
packages/ui/src/features/notifications/speechRouting.ts lets every
needs_input line bypass focus routing (if (kind === "needs_input") return true), and the queue treats them as priority lines that are never coalesced.
Result: consecutive permission prompts each speak "needs your input" while the
user is already looking at the chat approving them.
Design
Distinguish the two speakers sharing the speech pipe and gate them differently:
source: "agent"— lines from the agent'sspeaktool call. Keep current behavior:needs_inputalways plays;done/progressfollowspokenFocusMode.source: "backstop"— deterministic lines ("finished", "needs your input") fired by turn-complete and permission events. Never play when the focus channel is"suppress"(app focused and the user is viewing that task). Otherwise followspokenFocusModeas today.
"suppress" is per-task: a permission prompt on a task the user is not
viewing (app focused, different tab) still speaks — that is the multi-agent
case the voice exists for.
Changes
packages/ui/src/features/notifications/speechRouting.ts— addSpeechSource = "agent" | "backstop";shouldSpeak(kind, source, channel, settings): backstop lines returnfalsewhenchannel === "suppress"; agentneeds_inputkeeps its unconditional pass.packages/ui/src/features/notifications/speechNotifier.ts— addsourcetoSpeakRequest, pass through toshouldSpeak.packages/core/src/sessions/sessionService.ts— addsourceto theenqueueSpeechdep signature;speakDeterministicsends"backstop", the speak-tool handler sends"agent".packages/ui/src/features/sessions/sessionServiceHost.ts— type flows through unchanged (verify).packages/ui/src/features/notifications/speechRouting.test.ts— cover the new matrix: backstop suppressed on"suppress", backstop follows focus mode on"toast"/"native", agentneeds_inputunaffected.
No settings UI change. No queue changes.
Rejected alternatives
- Gate all
needs_inputby focus mode (no source flag): also mutes the agent's intentional "Hey Jon" lines. - Debounce/dedupe backstop lines in the queue: treats the symptom; focus suppression already kills repeats once the user is present, and serial prompts while away should each speak.