aibroker: fail-fast at startup when configured providers have no usable API key #55
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_aibroker#55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
hero_aibroker_serverboots successfully even when none of the configured providers have a usable API key in the environment. The first user request then fails at request time with a 5xx and a confusing error chain — the operator only finds out the deploy was misconfigured when an end user hits the AI Assistant.This is the failure mode an integrator (freezone) hit on a fresh VM deploy: aibroker started healthy, the unix socket bound, the backend poller connected — but every chat request returned an "instance arm requires aibroker_endpoint" / "no providers available" error. The root cause was a missing
ALIBABA_MODELSTUDIO_API_KEYenv var that aibroker silently passed through as an empty string.Proposal
At
hero_aibroker_serverstartup, after provider registration, count the providers that have a non-empty API key (or whatever credential the provider needs). If the count is zero AND the config registers at least one provider, abort with a non-zero exit code and a clear error message naming each unconfigured provider.Suggested error format:
Why this matters
depends_on: condition: service_healthy, k8s liveness probes, systemd) can react correctly — today the container is "healthy" but functionally broken.hero_indexeralready enforces (refuses to bind its socket when its config is invalid).Out of scope
--allow-zero-providersflag or env opt-out would preserve those paths if the team wants to keep them.