Skip to content

fix(distributed): stage sound detection audio - #11907

Merged
mudler merged 2 commits into
masterfrom
fix/distributed-sound-staging
Sep 7, 2026
Merged

fix(distributed): stage sound detection audio#11907
mudler merged 2 commits into
masterfrom
fix/distributed-sound-staging

Conversation

@localai-org-maint-bot

@localai-org-maint-bot localai-org-maint-bot commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Description

Distributed sound classification passes the API server's temporary WAV path directly to the worker. CED then fails with failed to read wav when the worker cannot access that path. Transcription succeeds because its RPC already stages input files.

Stage sound-detection audio through the existing FileStager before 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 SoundDetection on the client returned by SmartRouter.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 the auth tag.

Validation:

  • go test ./core/services/nodes -run TestNodes -ginkgo.focus='FileStagingClient' -ginkgo.no-color -ginkgo.succinct -count=1
  • go test -race ./core/services/nodes -run TestNodes -ginkgo.focus='FileStagingClient' -ginkgo.no-color -ginkgo.succinct -count=1
  • golangci-lint run ./core/services/nodes/...
  • go build -tags auth -o /tmp/local-ai-sound-staging-fix ./cmd/local-ai

The 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

  • Human DCO sign-off pending; AI assistance is recorded with Assisted-by.
  • Documentation updated in docs/content/features/audio-classification.md.

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
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
@mudler
mudler marked this pull request as ready for review September 7, 2026 15:12
@mudler
mudler merged commit fb8b7a3 into master Sep 7, 2026
64 of 66 checks passed
@mudler
mudler deleted the fix/distributed-sound-staging branch September 7, 2026 15:12
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