This repository was archived by the owner on Aug 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
fix(agent): make spoken narration strictly opt-in #3500
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d58a256
fix(agent): make spoken narration strictly opt-in
andrewm4894 539c826
fix(agent): allow system voice narration fallback
pauldambra f6aec6c
fix(agent): preserve narration opt-in for cloud runs
pauldambra 7e2010c
fix(agent): keep narration gating on local sessions
pauldambra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.