Skip to content

Fix CLI config discovery: ./config.yaml beats user config#42

Merged
rajeeja merged 1 commit into
mainfrom
rajeeja/cli-config-cwd
May 9, 2026
Merged

Fix CLI config discovery: ./config.yaml beats user config#42
rajeeja merged 1 commit into
mainfrom
rajeeja/cli-config-cwd

Conversation

@rajeeja
Copy link
Copy Markdown
Collaborator

@rajeeja rajeeja commented May 9, 2026

Summary

  • uxarray-mcp setup writes an empty ~/.config/uxarray-mcp/config.yaml that silently shadowed any project-local ./config.yaml. From inside a repo checkout, uxarray-mcp endpoints list reported "No endpoints configured" even when config.yaml was sitting right there with improv + ucar defined.
  • New discovery chain: $UXARRAY_MCP_CONFIG./config.yaml~/.config/uxarray-mcp/config.yaml<pkg_root>/config.yaml. Matches git/ruff/pytest convention (project-local wins).
  • endpoints list now 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 pass
  • Manual: uv run uxarray-mcp endpoints list from repo root now prints both endpoints
  • Manual: same from /tmp (no ./config.yaml) falls back to ~/.config/... as expected

`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.
@rajeeja rajeeja merged commit f30cac5 into main May 9, 2026
8 checks passed
@rajeeja rajeeja deleted the rajeeja/cli-config-cwd branch May 9, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant