fix(tts): allow trusted local media in message_tool_only mode#91192
fix(tts): allow trusted local media in message_tool_only mode#91192clawSean wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 26, 2026, 6:40 AM ET / 10:40 UTC. ClawSweeper reviewWhat this changesThe branch keeps message-tool transcript mirrors text-only, emits trusted local TTS audio as a separate media-only reply, and permits that stripped reply through Merge readiness⛔ Blocked until stronger real behavior proof is added - 5 items remain Keep this PR open. Current main still drops tool media when a Priority: P2 Review scores
Verification
How this fits togetherEmbedded agent runs collect media returned by tools and merge it into reply payloads before auto-reply dispatch applies source-reply visibility rules. This PR changes the boundary between tool-media aggregation and suppressed channel delivery so generated TTS audio can reach a channel without publishing private assistant text or duplicating a message-tool response. flowchart LR
A[Room event] --> B[Embedded agent and TTS tool]
B --> C[Tool media aggregation]
C --> D[Message-tool transcript mirror]
C --> E[Standalone trusted media payload]
D --> F[Source-reply suppression]
E --> G[Text stripped and provenance checked]
G --> H[Channel voice delivery]
Decision needed
Why: This is a core cross-channel visibility and trust contract; tests can prove the selected rule but cannot choose which producer classes may be privileged to deliver after suppression. Before merge
Findings
Agent review detailsSecurityNeeds attention: The diff introduces a deliberate privileged outbound-delivery path, so it needs owner confirmation that the trusted-media marker is an adequate provenance boundary. PR surfaceSource +101, Tests +84. Total +185 across 5 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Mantis proof suggestionA Telegram Desktop proof can directly show the exact-head voice note arriving without duplicate text, which materially strengthens review of this message-delivery change. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the standalone media-only design, but land it only after an owner confirms the trusted-media provenance contract and an exact-head redacted Telegram run shows a voice send with no text leakage or duplicate transcript delivery. Do we have a high-confidence way to reproduce the issue? No high-confidence current-main live reproduction was established in this review. The linked report supplies concrete Telegram and Discord traces, and current main's mirror branch visibly discards the relevant tool media, so the source path is reproducible but live confirmation remains needed. Is this the best way to solve the issue? Unclear. Splitting trusted TTS media from an immutable message-tool mirror is the narrowest apparent repair, but the privileged suppression bypass needs an explicit owner decision and current-head transport proof before it can be called the best solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cd5a5ecb4cfa. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
✅ Live Telegram Proof Delivered Voice note sent to thread (message 2979): https://t.me/c/1003778833824/2397/2979 Proof details:
This demonstrates:
The 'Real behavior proof' check should now pass with this evidence. |
0ca4ff0 to
33e6016
Compare
33e6016 to
c84b666
Compare
|
@clawsweeper re-review Updated head Added regression coverage for:
Validation passed locally:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c84b666 to
bcc102e
Compare
bcc102e to
a069d38
Compare
|
@clawsweeper re-review Updated head
Added regressions for trusted block TTS delivery, ordinary/reasoning/status suppression, block/final text+media near-misses, untrusted media suppression, and the merge helper text-free standalone media contract. Validation:
GitHub checks are green on the fresh head, including Real behavior proof, |
0c5b76a to
774a494
Compare
774a494 to
a091df4
Compare
|
@clawsweeper re-review Rebased and force-pushed the TTS trusted-local-media branch onto current Current head: Validation run locally:
Conflict resolution note: kept current main's dispatch lifecycle/commentary/reasoning flow and re-applied the PR behavior only where needed: trusted local TTS media can bypass |
|
🦞🧹 I asked ClawSweeper to review this item again. |
a091df4 to
698dc18
Compare
698dc18 to
76d62ec
Compare
|
Rebased onto current @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
76d62ec to
d6001f9
Compare
What Problem This Solves
Trusted local TTS media generated during
message_tool_onlyroom-event flows could be attached to a source-reply transcript mirror or consumed by suppressed block delivery before reaching the channel.Why This Change Was Made
message_tool_onlysuppression only after stripping private text.User Impact
Voice notes generated by the configured TTS provider can reach Telegram/other channel adapters in message-tool-only flows without leaking the private source/final text or duplicating the already-sent message-tool response.
Evidence
Current contributor head:
76d62ec04aeon upstreammaina040f10e85a.node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/tool-media-payloads.test.ts src/auto-reply/reply/dispatch-from-config.test.ts: 287 tests passed (14 merge/provenance tests + 273 dispatch tests).git diff --check upstream/main...HEADpassed.Real behavior proof
An earlier patch-equivalent head generated speech through the configured Microsoft TTS provider and sent an OGG/Opus voice note through the real Telegram adapter/API; the redacted send returned
operation=sendVoice,deliveryKind=voice, and no outbound text. That transport proof remains useful history but is not claimed as exact-head proof after this rebase.The current-head focused suite exercises the changed merge and dispatch boundaries directly. No Gateway restart/deploy was performed for this refresh. A maintainer/Mantis live run on the current head remains the strongest visual confirmation.
Fixes #83636.
AI-assisted; reviewed and validated before submission.