llm: a key by any name, so a second cloud account needs no code
`_resolve_secret` knew exactly two variables: `OLLAMA_API_KEY` and
`EMBEDDING_OLLAMA_API_KEY`, because those were the only ones with a Settings
field to bridge to. Any other name — a second Ollama Cloud account on the
backup chain — was looked for in `os.environ` only, and pydantic-settings does
not export `.env` there, so the target silently received an empty key and
every call to it would 401.

The lookup now reads the `.env` file itself for the name it was given, in the
same CWD-relative way pydantic-settings resolves it, with `os.environ` first
and the two known Settings fields last. `python-dotenv` was already a
dependency; a malformed line in the file (production has one) does not stop
the variables below it from being found, and that is a test.

`llm.json` stays secret-free: each target keeps naming its variable, several
accounts are just several targets, and the docs spell out the chain.
1 parent 4cb27d3 commit 7d7615db1824bad750838dc1762764a62fa852e1
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 17 hours ago
Showing 5 changed files
View
.env.example
View
.env.navi_code.example
View
docs/config.md
View
navi/llm/config.py
View
tests/unit/llm/test_config.py