Repository navigation
refactor(tts): isolate streaming directive text from provider discovery - #189504
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesMoves streaming TTS directive cleanup into the existing provider-independent text module and updates its consumers. Example: A reply streams
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this PR open: it is a focused, maintainer-authored refactor with a complete caller cutover and no actionable correctness or security findings. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherNormal and ACP reply dispatch and final-caption cleanup feed assistant text through the incremental cleaner; provider-aware directive resolution remains separate. flowchart LR
A[Assistant reply chunks] --> B[Normal and ACP dispatch]
B --> C[Directive facts text cleaner]
D[Final caption text] --> C
C --> E[Visible channel text]
F[Final speech facts] --> G[Provider aware resolver]
Technical reviewBest possible solution: Keep the direct move into directive-facts, preserving the existing cleaner and provider-aware SDK parser as separate responsibilities. Do we have a high-confidence way to reproduce the issue? This PR reports an import-boundary problem rather than a runtime bug; source confirms that main's streaming consumers import a module with a runtime provider-registry dependency. Is this the best way to solve the issue? The move is the smallest complete refactor: it reuses the existing text owner, preserves the implementation and regression cases, migrates all consumers, and leaves public provider parsing intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 01d404f68843. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +22, Other +2. Total +24 across 10 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 31, 2026, 11:36 AM ET / 15:36 UTC. |
|
Merged via squash auto-merge.
|
Related: #188252
What Problem This Solves
Streaming directive-text consumers import a module that also loads provider discovery, even though the cleaner only processes text.
User Impact
No intended behavior change. Partial directives, hidden text, code fences, captioned replies and ACP delivery retain their existing behavior. Provider-aware directive parsing and public SDK exports are unchanged.
Why This Change Was Made
Move the complete cleaner, its private helper/type and retirement note into the existing host-free directive-facts owner. Migrate every production import, delivery type and test spy directly; remove the former export without a forwarding layer. Keep provider-aware parsing in its existing module.
Move existing behavior cases with the implementation and add a cold-import check that fails if provider discovery is loaded. Production is line-neutral; tests add 22 lines, covered by a separate 22-line allocation. Moved code is not counted as savings, and no startup-speed claim is made.
Evidence
b1f4495c58aaa6dbc7f96422e9c33edd69293d16, so the intended cut is still needed.5e407f5384f97a69d12761b51e3e48c9e50030c5..9a0be6c333e8ea6360e0e9f861cf4f9df321ec2dfound no actionable correctness or security findings (confidence 0.95).pnpm buildpassed in 373.803 seconds, including SDK/export and bundle checks. Exact reviewed source, HEAD and frozen dependency/native binding inputs remained unchanged through focused proof; build left source clean.