fix(distributed): stage sound detection audio - #11907
Merged
Merged
Conversation
Sound detection passes frontend temporary paths directly to remote workers, unlike transcription. Stage the WAV before classification so CED can read it without a shared temporary directory. Preserve the original request for retries and propagate staging errors without calling the backend. Cover staging, request preservation, and error handling with regression tests. Assisted-by: Codex:GPT-6 golangci-lint
mudler
previously approved these changes
Sep 7, 2026
Call sound detection through the client returned by SmartRouter.Route. This checks interface dispatch through both routing wrappers, rather than constructing FileStagingClient directly. The test fails without the sound-staging override and passes with it. Assisted-by: Codex:GPT-6 golangci-lint
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Distributed sound classification passes the API server's temporary WAV path directly to the worker. CED then fails with
failed to read wavwhen the worker cannot access that path. Transcription succeeds because its RPC already stages input files.Stage sound-detection audio through the existing
FileStagerbefore calling the worker. Clone the request before replacing its path, so retries retain the frontend path. Return staging errors without calling the backend. This covers uploaded audio and realtime sound windows without changing CED or the protobuf contract.Notes for Reviewers
Regression tests failed before the fix: no file was staged, and staging failures did not prevent backend calls. Focused staging tests pass after the fix, including race detection. A router-level regression also calls
SoundDetectionon the client returned bySmartRouter.Route, proving dispatch through the routing wrappers. It fails without the override and passes with it. Node-package lint reports no issues, and the API server builds with theauthtag.Validation:
go test ./core/services/nodes -run TestNodes -ginkgo.focus='FileStagingClient' -ginkgo.no-color -ginkgo.succinct -count=1go test -race ./core/services/nodes -run TestNodes -ginkgo.focus='FileStagingClient' -ginkgo.no-color -ginkgo.succinct -count=1golangci-lint run ./core/services/nodes/...go build -tags auth -o /tmp/local-ai-sound-staging-fix ./cmd/local-aiThe broader node suite was manually interrupted after about five minutes; it did not complete. Its shutdown handler turned the interrupt into an
os.Exit(0)test panic. No full-suite pass is claimed.Live verification requires rolling out the API-server fix and submitting audio with CED on a remote worker. This draft is not deployed.
Signed commits
Assisted-by.docs/content/features/audio-classification.md.