Skip to content

fix(bark): reject blank text and null output formats before synthesis - #3808

Closed
tang-vu wants to merge 3 commits into
Osmantic:public-betafrom
tang-vu:fix/bark-request-validation-20260907
Closed

tang-vu wants to merge 3 commits into
Osmantic:public-betafrom
tang-vu:fix/bark-request-validation-20260907

Conversation

@tang-vu

@tang-vu tang-vu commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Why this matters

Bark accepted empty/whitespace text and explicit null output_format, then failed or scheduled needless synthesis instead of rejecting the unusable HTTP request.

Fix and overlap check

Require nonblank text and a nonnullable output format while preserving the default WAV format, meaningful text whitespace and optional voice. Updated the original canonical request-validation PR onto public-beta. Searched all-state Bark validation and bark/server.py PRs. #5204 bounds generation admission, a different lifecycle contract; this patch rejects invalid requests before synthesis. No duplicate was created.

Validation

pytest -q test_request_validation.py test_server.py::test_tts_text_empty: 9 passed on Linux Python3.10.21/FastAPI0.111.0/soundfile0.12.1/numpy1.26.4, matching the declared version families. Both /tts and /tts/stream reject three invalid payloads with 422 and zero synthesis calls; defaults/null voice remain valid. The synthesis backend is replaced with a fixture: no Torch model, GPU or audio-quality validation is claimed. Focused pre-commit/diff check passed.

Baseline smoke/simulation passed; full make gate/BATS retain known environment/fixture failures.

Compatibility and rollback

Clients sending null output_format must omit it for WAV or supply a supported string. No model format or persisted state changes. Revert restores invalid-input acceptance. Ready for independent review.

Follow-up and shared-file compatibility

Follow-up 797cc0b5799ee61b19f5451b107589bd13e1661d updates the legacy empty-text expectation from 200 to the intended 422 response and validates the error location. Production code merges cleanly with #5204 at 02d0dd5809819fbc2ed2fe0a463308e50b749cc2. Pair branch integration/beta-bark-pair-20260916 passed 20 tests at that exact SHA: request validation, the legacy empty case and generation-admission regressions.

The broader legacy test_server.py suite was also attempted, but is not green in the fixture-only environment: 11 setup errors require the unavailable Bark package; old validation assertions assume string-shaped Pydantic errors, and a model-boundary case also requires that package. The empty-text mismatch is fixed here; #3974's separate legacy assertion/timeout scope is not duplicated. No Bark weights, live synthesis or GPU qualification is claimed. Independent human review remains required.

Final beta-batch receipt — 2026-09-16

Candidate: 797cc0b5799ee61b19f5451b107589bd13e1661d. GitHub check audit at 11:07:47 UTC: 37 successful, 4 skipped, 0 failed, 0 pending, matching this exact head; OPEN, public-beta base, Ready (not Draft). Skipped checks are not counted as passed tests.

The combined integration head, 5b9877184ceab0751c6c9fe3564c73303e78f0a3, contains all 30 exact candidate heads on public-beta 3c186f3f12ba21dad7b7266ec5449393529abb00. At this exact final SHA: full dashboard 171 files / 1,274 tests passed; full dashboard API 3,124 passed, 2 skipped; advice boundary suite 23 passed; Bark request/legacy-empty cases 9 passed; changed-file secret/key/size hooks and diff check passed. Shell-only hooks had no matching changed files.

Additional combined checks ran at predecessor 28adf1aa5c0710d3c0de13df7870629e24977fec: Token Spy 130 passed, 1 skipped; CLI contracts 16 passed; real backup/restore round trip passed; Open Interpreter HTTP/runner cases 4 passed; make lint smoke simulate, frontend lint (zero errors, 624 warnings) and production build passed. The only final-head differences are two test files (advice dialog fixtures and Bark's empty-text expectation); production files are identical. These results are not live GPU/model or service rollout qualification.

Qualified merge order: #5490 → #5494 → #5495 → #3848 → #3846 → #3845 → #3844 → #3843 → #3841 → #3838 → #3837 → #3836 → #3835 → #3834 → #3809 → #3808 → #3807 → #3806 → #3804 → #3803 → #3802 → #3801 → #3800 → #3712 → #3711 → #3710 → #3709 → #3708 → #3852 → #3849. Branches are independently useful. Shared-file merging required only preserving the union of four adjacent Makefile registrations: provider-probe redirects, healthcheck error-body, Milvus persistence and healthcheck latency. Production code in these 30 merged without manual conflict resolution. External advice/Bark overlaps have separate pairwise receipts in #5494/#3808. Recheck the combined tree if other shared-file PRs land first; do not drop test registrations.

Full release qualification remains not green: baseline make gate fails a no-sudo Docker fallback fixture; 5 of 428 BATS cases fail in this environment; all-files private-key scanning flags two pre-existing dummy-key fixtures. No checks were disabled. CI success and Ready status do not replace independent human review, especially for auth backups and Milvus data migration. No upstream merge or deployment was performed.

@tang-vu
tang-vu changed the base branch from main to public-beta September 16, 2026 10:37
This was referenced Sep 16, 2026
@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants