Providers: New page to manage provider connections #33
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_aibroker#33
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
There is no Providers page. Users cannot add, view, or update their connected AI providers (OpenRouter, Groq, etc.) or their API keys.
Expected Behavior
A Providers tab/page that:
Acceptance Criteria
Implementation Spec for Issue #33 — Providers CRUD
Objective
Make the existing read-only Providers page fully functional with runtime add/edit/remove of provider API keys, .env persistence, and hot-reload of provider instances.
Approach
Configand services mutable at runtime (wrap inRwLock)providers.list,providers.add_key,providers.remove_keyFiles to Modify
crates/hero_aibroker/src/config/mod.rs— AddKNOWN_PROVIDERS,set_provider_keys(),save_env_file(),env_file_path()crates/hero_aibroker_ui/src/api/mod.rs— Wrap config/services in RwLock, add 3 RPC handlers + rebuild_providers()crates/hero_aibroker_ui/src/api/chat.rs— Read lock on chat_servicecrates/hero_aibroker_ui/src/api/tts.rs— Read lock on tts_servicecrates/hero_aibroker_ui/src/api/stt.rs— Read lock on stt_servicecrates/hero_aibroker_ui/src/api/embedding.rs— Read lock on embedding_servicecrates/hero_aibroker_ui/src/main.rs— Wrap config/services in RwLockcrates/hero_aibroker_ui/templates/fragments/providers_pane.html— Interactive provider management UIImplementation Steps
Acceptance Criteria
🤖 Generated with Claude Code
Test Results
All tests pass after implementing Providers CRUD (RwLock wrapping, RPC handlers, UI rewrite).
🤖 Generated with Claude Code
Implementation Summary
Changes Made
Backend — Config helpers (
config/mod.rs)KNOWN_PROVIDERSconstant (openai, openrouter, groq, sambanova)set_provider_keys(),save_env_file(),env_file_path()methods.envpersistence: reads existing file, updates API key lines, preserves everything elseBackend — Runtime mutability (
api/mod.rs,main.rs)ConfiginArc<RwLock<Config>>on AppStateArc<RwLock<...>>Arc<RwLock<Arc<Registry>>>Backend — Provider CRUD (
api/mod.rs)rebuild_providers()— hot-reloads providers + registry + all services when keys changeproviders.listRPC — returns all 4 known providers with status, key count, masked keysproviders.add_keyRPC — adds a key, saves .env, rebuilds providersproviders.remove_keyRPC — removes key by index, saves .env, rebuilds providersFrontend — Providers pane (
providers_pane.html)Test Results
Acceptance Criteria
🤖 Generated with Claude Code
Implementation committed:
0bfd710Browse:
0bfd710