-
Notifications
You must be signed in to change notification settings - Fork 60
fix(agent): make spoken narration strictly opt-in #3500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d58a256
539c826
f6aec6c
7e2010c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| import { isCloudRun } from "../utils/common"; | ||
|
|
||
| /** Minimal shape needed to resolve the effective task id from session meta. */ | ||
| interface TaskIdSource { | ||
| taskId?: string; | ||
|
|
@@ -19,18 +17,21 @@ export function resolveTaskId( | |
|
|
||
| /** Minimal shape needed to resolve spoken narration from session meta. */ | ||
| interface SpokenNarrationSource { | ||
| environment?: "local" | "cloud"; | ||
| spokenNarration?: boolean; | ||
| } | ||
|
|
||
| /** | ||
| * An explicit setting wins; otherwise cloud runs (including sandbox runs | ||
| * detected via `IS_SANDBOX`) default to on because the sandbox can't know | ||
| * which clients are listening, so consumers gate playback. Local runs stay | ||
| * silent. Shared by the Claude and Codex adapters. | ||
| * Spoken narration is strictly opt-in: it is on only when a caller explicitly | ||
| * sets `spokenNarration` true at session start. The desktop is the only client | ||
| * that can play audio and the only place that knows the feature flag and the | ||
| * user's setting, so it computes that boolean and passes it. Everything else | ||
| * (headless cloud runs like Slack threads and Signals scouts, sandboxes, local | ||
| * runs without the setting) stays silent, so the `speak` tool and its | ||
| * instructions never load and never cost tokens where nothing is listening. | ||
| * Shared by the Claude and Codex adapters. | ||
| */ | ||
| export function resolveSpokenNarration( | ||
| meta: SpokenNarrationSource | undefined, | ||
| ): boolean { | ||
| return meta?.spokenNarration ?? isCloudRun(meta); | ||
| return meta?.spokenNarration === true; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note 🤖 Automated comment by QA Swarm — not written by a human [convergent: paul-reviewer + xp-reviewer] 🟠 HIGH Strict opt-in currently makes narration local-only because interactive cloud runs have no backend-supported way to carry the desktop flag + user opt-in decision. Supporting cloud narration requires a coordinated server contract or another explicit transport; otherwise this PR intentionally leaves cloud runs silent. |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.