Generic API_KEY, BASE_URL and RAG_WORKSPACE env vars are read and reported as "default"
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 69/100
Research direction
Start with src/chatty/config.py, especially the Config fields and source tracking around lines 119, 127, and 200. Check how validation_alias and populate_by_name=True affect environment and TOML loading, then run the relevant config tests. Done means TOML values still load by field name, the documented environment aliases still work, and bare API_KEY, BASE_URL, and RAG_WORKSPACE are not read from the environment or reported as defaults.
Written by the indexing model from the issue text.
Description
Config reads three fields through validation_alias=AliasChoices(...):
base_url:OPENAI_BASE_URL,CHATTY_BASE_URL,base_url(src/chatty/config.py:119)api_key:OPENAI_API_KEY,CHATTY_API_KEY,api_key(line 127)rag_workspace:CHATTY_RAG_WORKSPACE,LITKIT_WORKSPACE,rag_workspace(line 200)
pydantic-settings looks up every alias as an environment variable, case-insensitively, so the TOML key names are also read from the environment as BASE_URL, API_KEY and RAG_WORKSPACE. chatty's source tracking doesn't know about these, so it reports them as default.
Effect: a shell with API_KEY set for some other tool, and no OPENAI_API_KEY, makes chatty send that key as the Bearer token to its endpoint. chatty print-config and chatty doctor then hide where it came from:
base_url: https://other.example.com/v1 (from: default)
api_key: ******** (from: default)
RAG_WORKSPACE likewise changes the RAG workspace and is reported as default.
Fix: keep the env aliases in validation_alias and pass TOML values by field name only (populate_by_name=True), or load TOML through a pydantic-settings source, so bare API_KEY, BASE_URL and RAG_WORKSPACE are never read from the environment.
- Dominant language
- Python
- Stars
- 0
- Forks
- 2
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lanl/chatty
-
area: rag bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
area: client bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area: ui bug wrong-result
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area: config bug wrong-result
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
area: config bug wrong-result
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day