|
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. |
|---|
|
|
| .env.example |
|---|
| .env.navi_code.example |
|---|
| docs/config.md |
|---|
| navi/llm/config.py |
|---|
| tests/unit/llm/test_config.py |
|---|