feat: admin settings API for AI key configuration #57

Closed
mik-tf wants to merge 0 commits from development_books_settings_api into development
Owner

Summary

Adds persistent AI settings with two admin RPC endpoints for runtime key management.

Closes #56

Changes

  • New src/admin/settings.rs: AiSettings struct with load/save/apply_to_env, masked key status, TOML persistence
  • admin.settings.get: returns per-provider status (configured, masked_key, source: settings|env)
  • admin.settings.set: updates keys, persists to disk, applies to process env immediately
  • Settings loaded on startup in main.rs before any AI calls
  • Stored at ~/hero/var/hero_books/settings.toml

Testing

  • cargo check passes
  • admin.settings.get returns correct status when keys are in env
  • admin.settings.set persists and applies keys
  • AI summary works after setting keys via API
## Summary Adds persistent AI settings with two admin RPC endpoints for runtime key management. Closes #56 ## Changes - New `src/admin/settings.rs`: `AiSettings` struct with load/save/apply_to_env, masked key status, TOML persistence - `admin.settings.get`: returns per-provider status (configured, masked_key, source: settings|env) - `admin.settings.set`: updates keys, persists to disk, applies to process env immediately - Settings loaded on startup in `main.rs` before any AI calls - Stored at `~/hero/var/hero_books/settings.toml` ## Testing - [ ] `cargo check` passes - [ ] `admin.settings.get` returns correct status when keys are in env - [ ] `admin.settings.set` persists and applies keys - [ ] AI summary works after setting keys via API
feat: add admin.settings.get/set RPC for AI key configuration
Some checks failed
Test / test (pull_request) Failing after 1m44s
Test / integration (pull_request) Has been skipped
a23e321c5e
Adds persistent AI settings store at ~/hero/var/hero_books/settings.toml
with two new admin RPC endpoints:
- admin.settings.get: returns masked key status per provider (Groq, OpenRouter, SambaNova) + embedder URL
- admin.settings.set: updates keys, persists to disk, applies to process env

Settings are loaded and applied to env on startup (before AiClient::from_env),
with env vars as fallback when no saved setting exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mik-tf changed title from feat: admin settings API for AI key configuration to WIP: feat: admin settings API for AI key configuration 2026-02-17 16:22:59 +00:00
fix: update CI deps.txt for hero_rpc_osis migration
Some checks failed
Test / test (pull_request) Failing after 1m49s
Test / integration (pull_request) Has been skipped
0f929f4a76
After the herolib_osis → hero_rpc_osis migration (development),
deps.txt was not updated. CI failed because the patching system
could not resolve hero_rpc_osis without hero_rpc.git listed.

- Add hero_rpc.git with hero_rpc_osis=packages/osis
- Remove stale herolib_osis entry from hero_lib.git line

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: complete herolib_osis → hero_rpc_osis migration in generated code
All checks were successful
Test / test (pull_request) Successful in 3m33s
Test / integration (pull_request) Successful in 8m40s
64d7417bde
The migration commit left 13 herolib_osis references in generated files:
- types_generated.rs: 2 import statements
- osis_server_generated.rs: 11 references (imports, trait impls, types)

Also fix 4 clippy collapsible_if warnings in settings.rs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mik-tf changed title from WIP: feat: admin settings API for AI key configuration to feat: admin settings API for AI key configuration 2026-02-17 19:21:00 +00:00
Author
Owner

Closing: work consolidated into PR #60. Settings API commits merged into the new branch.

Closing: work consolidated into PR #60. Settings API commits merged into the new branch.
mik-tf closed this pull request 2026-02-19 01:21:22 +00:00
Author
Owner

Closing: work consolidated into PR #60. Settings API commits merged into the new branch.

Closing: work consolidated into PR #60. Settings API commits merged into the new branch.
All checks were successful
Test / test (pull_request) Successful in 3m33s
Test / integration (pull_request) Successful in 8m40s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_books!57
No description provided.