zeroclaw/src/memory
Aleksandr Prilipko 39353748fa
fix(memory): resolve embedding api_key from embedding_provider env var, not default_provider key (#3184)
When embedding_provider differs from default_provider (e.g. default=gemini,
embedding=openai), the caller-supplied api_key belongs to the chat provider.
Passing it to the embedding endpoint causes 401 Unauthorized (gemini key
sent to api.openai.com/v1/embeddings).

Add embedding_provider_env_key() which looks up OPENAI_API_KEY,
OPENROUTER_API_KEY, or COHERE_API_KEY before falling back to the
caller-supplied key. This matches the provider-specific env var resolution
in providers/mod.rs without introducing cross-module coupling.

Also add config_secrets_survive_save_load_roundtrip test: full save→load
cycle with channel credentials (telegram, discord, slack bot_token,
slack app_token) and gateway paired_tokens, verifying that enc2: values
are correctly decrypted by Config::load_or_init(). Regression guard for
issues #3173 and #3175.

Closes #3083

Co-authored-by: ZeroClaw Bot <zeroclaw_bot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Argenis <theonlyhennygod@gmail.com>
2026-03-11 15:39:54 -04:00
..
backend.rs fix(channels,memory): Docker workspace path remapping, vision support, and Qdrant backend restore (#1) 2026-02-24 16:03:01 +08:00
chunker.rs perf: eliminate unnecessary heap allocations across agent loop, memory, and channels 2026-02-19 07:06:27 -08:00
cli.rs chore(fmt): apply rustfmt after main rebase 2026-02-21 12:09:06 +08:00
embeddings.rs fix(memory): add openrouter as recognized embedding provider 2026-02-19 15:10:25 -05:00
hygiene.rs Addressed clippy lint issues 2026-03-10 01:48:19 -04:00
lucid.rs fix(tests): increase lucid memory test timeouts to prevent flakiness 2026-02-21 12:01:38 +08:00
markdown.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
mod.rs fix(memory): resolve embedding api_key from embedding_provider env var, not default_provider key (#3184) 2026-03-11 15:39:54 -04:00
none.rs feat(memory): add session_id isolation to Memory trait (#530) 2026-02-17 07:44:05 -05:00
postgres.rs fix(memory): avoid tokio runtime panic when initializing postgres backend 2026-02-20 16:21:25 +08:00
qdrant.rs fix(channels,memory): Docker workspace path remapping, vision support, and Qdrant backend restore (#1) 2026-02-24 16:03:01 +08:00
response_cache.rs readd tests, remove markdown files 2026-02-18 14:42:39 +08:00
snapshot.rs fix(build): complete strict lint and test cleanup (replacement for #476) 2026-02-18 00:18:54 +08:00
sqlite.rs fix(security): prevent cleartext logging of sensitive data 2026-02-18 20:12:45 -08:00
traits.rs fix(security): remove sensitive fields from Debug impls 2026-02-20 22:06:21 -08:00
vector.rs fix: resolve all clippy --all-targets warnings across 15 files 2026-02-14 03:52:57 -05:00