fix(config): preserve file overrides on startup - #1167
Conversation
Greptile SummaryThis PR changes startup persistence to merge the active configuration file with process-environment overrides, normalizes key casing, and removes stale sibling aliases.
Confidence Score: 4/5The PR should not merge until startup persistence stops deleting valid non-string configuration overrides. Normal startup rewrites the configuration after filtering its existing environment block to strings, even though the loader accepts typed boolean, integer, and object values from that same block. Files Needing Attention: strix/config/loader.py and tests/test_config_loader.py Important Files Changed
Prompt To Fix All With AI### Issue 1
strix/config/loader.py:62-66
**Typed overrides are discarded**
When the config contains a valid typed override such as `"STRIX_TELEMETRY": false`, `"LLM_TIMEOUT": 600`, or an object-valued `LLM_EXTRA_HEADERS`, this filter drops it before rewriting the file, causing the override to disappear and subsequent runs to use the default.
```suggestion
env_block = _read_env_block(target)
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(config): preserve file overrides on ..." | Re-trigger Greptile |
| env_block = { | ||
| key: value | ||
| for key, value in _read_env_block(target).items() | ||
| if isinstance(value, str) | ||
| } |
There was a problem hiding this comment.
When the config contains a valid typed override such as "STRIX_TELEMETRY": false, "LLM_TIMEOUT": 600, or an object-valued LLM_EXTRA_HEADERS, this filter drops it before rewriting the file, causing the override to disappear and subsequent runs to use the default.
| env_block = { | |
| key: value | |
| for key, value in _read_env_block(target).items() | |
| if isinstance(value, str) | |
| } | |
| env_block = _read_env_block(target) |
Knowledge Base Used: Configuration and provider settings
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/config/loader.py
Line: 62-66
Comment:
**Typed overrides are discarded**
When the config contains a valid typed override such as `"STRIX_TELEMETRY": false`, `"LLM_TIMEOUT": 600`, or an object-valued `LLM_EXTRA_HEADERS`, this filter drops it before rewriting the file, causing the override to disappear and subsequent runs to use the default.
```suggestion
env_block = _read_env_block(target)
```
**Knowledge Base Used:** [Configuration and provider settings](https://app.greptile.com/strix-org-3/-/custom-context/knowledge-base/usestrix/strix/-/docs/configuration-and-provider-settings.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
cli-config.jsonwhen persisting startup configurationBug
load_settings()reads file-only overrides, butpersist_current()rebuilt the file solely fromos.environ. A normal scan therefore deleted values such asSTRIX_LLMandLLM_API_KEYwhen they existed only in~/.strix/cli-config.json.Tests
pytest tests/test_config_loader.py -q(20 passed)ruff check strix/config/loader.py tests/test_config_loader.pymypy strix/config/loader.py