Fix CLI config discovery: ./config.yaml beats user config#42
Merged
Conversation
`uxarray-mcp setup` writes an empty user config to `~/.config/uxarray-mcp/config.yaml`, which then permanently shadowed any project-local `./config.yaml`. From inside the repo, `uxarray-mcp endpoints list` reported "No endpoints configured" even though the project had improv + ucar defined. Add cwd to the discovery chain at priority 2 (above the user config), matching git/ruff/pytest convention. The fallback chain is now: $UXARRAY_MCP_CONFIG -> ./config.yaml -> ~/.config/... -> <pkg_root> Also surface `discover_config_search_paths()` and have `endpoints list` print which file was loaded (or all searched paths when none found) so the discovery is no longer invisible. Replaces the `user_home_beats_repo` test with two tests covering the new precedence and the user-home fallback when no cwd config exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uxarray-mcp setupwrites an empty~/.config/uxarray-mcp/config.yamlthat silently shadowed any project-local./config.yaml. From inside a repo checkout,uxarray-mcp endpoints listreported "No endpoints configured" even whenconfig.yamlwas sitting right there withimprov+ucardefined.$UXARRAY_MCP_CONFIG→./config.yaml→~/.config/uxarray-mcp/config.yaml→<pkg_root>/config.yaml. Matches git/ruff/pytest convention (project-local wins).endpoints listnow prints which file was loaded (or all searched paths when none was found), so discovery is no longer invisible.Test plan
uv run pytest tests/ --ignore=tests/test_remote_agent.py→ 248 passed (was 247; one new test for cwd precedence, one for the user-home fallback)uv run pre-commit run --all-files→ all 10 hooks passuv run uxarray-mcp endpoints listfrom repo root now prints both endpoints/tmp(no./config.yaml) falls back to~/.config/...as expected