Repository navigation
refactor(tests): type speech synthesis fixtures - #195933
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 changesThis PR uses real speech and transcode request types while removing generic call-inspection scaffolding. Example: The existing voice-memo test synthesizes mp3 and requests CAF output.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it makes a focused fixture simplification, and source review found no actionable correctness or security defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherShared TTS fixtures exercise speech routing, fallback, summary, dispatch, and cron delivery, supplying synthetic provider audio and checking resulting requests and payloads. flowchart LR
A[Consumer suites] --> B[Shared TTS fixtures]
B --> C[Production TTS owners]
C --> D[Typed speech provider mock]
C --> E[Typed transcode mock]
C --> F[Payload and audio assertions]
Technical reviewBest possible solution: Keep the direct typed fixtures and existing behavioral assertions without adding another abstraction. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving fixture refactor rather than a reported product bug; source inspection confirms the redundant type-erasing path. Is this the best way to solve the issue? The patch is the smallest complete cleanup: reuse the existing function and request types, preserve missing-call detection, and assert transcode arguments directly. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cde34f111b4d. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests -7. Total -7 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 9, 2026, 6:49 AM ET / 11:49 UTC. |
|
Merged via squash.
|
* refactor(tests): type speech synthesis fixtures * fix(tests): use typed synthesis text in fallback assertion
Related: #188252
What Problem This Solves
Shared TTS fixtures discard real request types and recover them through generic unknown-call plumbing. Once the helper returns the actual synthesis request type, one existing fallback assertion also retains an unnecessary string conversion; exact-head CI caught that directly affected consumer.
User Impact
No production runtime, public API or configuration change. Existing synthesis, transcoding, fallback, summary, dispatch and cron cases and their behavioral assertions remain intact.
Why This Change Was Made
Use the real transcode function signature/return union and typed first synthesis request directly. Preserve the missing-call Error, live record/attempt helpers, and the CAF called-once/mp3-to-caf argument checks. In the existing UTF-16 truncation case use the already-typed
request.textdirectly, preserving its input, awaited call, both expectations, preference setup and finally cleanup byte-for-byte.Full reviewed candidate:
09c642f7b0ef7683c8da211c9f066588257e61e3, original base26c18f969746809b62933052a9781b771ea1c024. Three test/support files,6+/13- lines (net-7),339 fewer bytes. The correction itself is one replacement,-8 bytes,zero LF/case/assertion delta. Both original fixture files remain byte-identical to incoming29e985e86978092eb8b6c58836df7a90aecdd224. No cast, suppression, rule/baseline relaxation, extra test or unrelated cleanup.Evidence
check-lint-core-2) failedtypescript(no-unnecessary-type-conversion)atsrc/tts/tts-runtime-fallbacks.test.ts:445:37. The helper returnsSpeechSynthesisRequestand its text field is string. Final attempt2 disposition:57 jobs,26 success/29 skipped/2 failed (lint and downstream combined gate),no active jobs. Complete134910-byte failed-job log retained, SHA25663763735bf05e4ba3ecf4e60eff982e31094e9018c28cbddbe9bc756044f5349. This is PR-induced, not the earlier backend error or an inherited-main exception.config/tsconfig/oxlint.core.json) over all three candidate files:exit0,3.50s.The original DNS checkout failure and CI attempt1 provider-level Internal server error remain historical evidence. Their later normal setup recovery and separate attempt2 lint failure do not erase those failures. A test-only change does not alter SDK declarations/package topology; no full runtime build/API-byte-diff claim is made.
Historical compiler-warm comparison: base26c versus incoming29e, before this one-line correction
The following predeclared population and raw rows are retained unchanged. They are not measurements of correction09c. Every20percent stop remains binding; no sample was discarded, replaced or averaged away.
Predeclared matched cost protocol and results
Before any runtime sample, the unused initial warmup plan was explicitly superseded by one compiler-warm set: five serial base/head pairs, each selected revision followed by exactly one separately timed preparation and then one identical measured invocation. No extra warmups, replacement arms, hand-seeded cache or subtracted startup/compiler/verification/cleanup costs. Preparation remains a separate population and is included in total spend.
Exact command for both populations:
Same physical qualified graph, Node26.13.0/Darwin arm64, inherited
NODE_OPTIONS=--max-old-space-size=4096, ordinary worker policy, fresh invocation/one worker. Identical task-localGOMAXPROCS=1,GOMEMLIMIT=3GiB,RAYON_NUM_THREADS=1,OPENCLAW_VITEST_MAX_WORKERS=1, and normal filesystem-module cache at$PWD/.local/tts-fixture-proof/vitest-fs. Host load was recorded at source selection. Every measured arm observed a maintained local compiler-cache hit/reused outputs plus normal complete input/output inventory verification, cache ownership and retention/cleanup; source/graph bindings stayed unchanged. Preparation1/base missed; all other preparations hit, so preparation is not labeled cold.Whole-command seconds; RSS is bytes; Vitest is its three reported shard durations in seconds. Every row below is exit0/five files/70 cases and positively settled.
Nearest-rank p95 with n=5 is the observed maximum, not a reliable tail estimate. The unchanged20% STOP was applied independently to every paired raw wall/user/system/RSS cell and each median/p95 cell. All passed; largest paired increase13.06% (wall, pair4). Favorable cells did not offset adverse cells.
Total20-command spend, including all10 preparations: wall377.09s, user353.99s, system326.03s, aggregate CPU680.02s. Observation window687s includes gaps. Largest individual command maximum RSS8057503744B; largest measured command maximum RSS1603764224B. Per-command RSS maxima are not summed as simultaneous memory. This is a compiler-warm test-command cost gate, not product latency, cold-start, CPU, allocation or universal speedup evidence.