Files
LocalAI/backend/go
Som Samantray d27fb3202c fix(whisper): honour positional listen address argument (#11652)
* fix(whisper): honour positional listen address argument

The whisper backend parsed its gRPC listen address exclusively through
Go's flag package, while run.sh forwards launcher arguments verbatim.
A bare positional address was silently dropped by flag.Parse(), so the
server always bound the default localhost:50051 instead of the port its
caller allocated — LocalAI then failed to reach it with a misleading
'error reading from server: EOF'.

Fall back to the first positional argument when no explicit -addr value
was given, keeping the default for no-argument launches.

Fixes #11623

Assisted-by: ox-alpha:ox-alpha [go test]

Signed-off-by: Som Samantray <som.samantray@gmail.com>

* fix(whisper): track explicit -addr via flag.Visit and adopt Ginkgo test style

Review follow-up:
- Detect an explicitly set -addr with flag.FlagSet.Visit instead of
  comparing against the default sentinel, so '-addr localhost:50051'
  plus a positional argument keeps the flag value.
- Treat an explicitly empty -addr as unset rather than binding the
  empty address (OS-chosen port on all interfaces).
- Rewrite addr_test.go as Ginkgo v2 specs per .agents/coding-style.md;
  stdlib t.Run/t.Errorf are forbidden by .golangci.yml forbidigo.

Assisted-by: ox-alpha:ox-alpha [go test]

Signed-off-by: Som Samantray <som.samantray@gmail.com>

---------

Signed-off-by: Som Samantray <som.samantray@gmail.com>
2026-09-11 17:31:43 +02:00
..