Repository navigation
fix(agent-discovery): match nested config files on Windows - #4325
Open
Anish Mehta (anishmehta24) wants to merge 2 commits into
Open
Anish Mehta (anishmehta24) wants to merge 2 commits into
Anish Mehta (anishmehta24) wants to merge 2 commits into
Conversation
ConfigScanner built the relative path with str(), which uses backslashes on Windows, so the .agentmesh/config.yaml and .mcp/config.json patterns never matched there. Use as_posix() so the patterns match on every platform. Signed-off-by: Anish Mehta <mehtaanish111@gmail.com>
Anish Mehta (anishmehta24)
requested review from
MohammadHaroonAbuomar,
liamcrumm and
Prayag (prayagupa)
as code owners
October 15, 2026 11:56
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
PR Review Summary
Verdict: AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims. |
|
🔴 Contributor Check: HIGH
Automated check by AGT Contributor Check. |
MohammadHaroonAbuomar
requested changes
Oct 15, 2026
MohammadHaroonAbuomar
left a comment
Collaborator
There was a problem hiding this comment.
- Verified by simulation with PureWindowsPath:
str(rel_dir / filename)yields.agentmesh\config.yaml, which never matches the.agentmesh/config.yamlpatterns, and.as_posix()does; stored fingerprints are unchanged because they use the full path. 58 tests pass, lint and spelling clean, template complete. One sibling to bring along. - agent-governance-python/agent-discovery/src/agent_discovery/scanners/config.py:208 The
docker_filetag still usesstr(rel_dir / filename), so on Windows it keeps backslashes whileconfig_fileis now POSIX. Please switch it to.as_posix()too so the two tags stay consistent.
Signed-off-by: Anish Mehta <mehtaanish111@gmail.com>
18 tasks done
This branch has not been deployed
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.
Related Issue
None. Problem & Solution, Impact and Alternatives are filled in below.
Problem & Solution
Problem:
ConfigScannerbuilds the relative path withstr(rel_dir / filename)and compares it with patterns like.agentmesh/config.yamland.mcp/config.json. On Windows that path uses backslashes, so those two patterns never match and the configs are not reported. Only the bare-filename patterns work there.Solution: build the path with
as_posix(), so the patterns and theconfig_filetag use/on every platform.Impact on Your Work
Running
agent-discovery scan -s configon Windows over a project with.agentmesh/config.yamland.mcp/config.jsonfound onlycrewai.yaml.Timeline
None
Alternatives Considered
Normalizing the patterns to
os.sepinstead.as_posix()is simpler and keeps the tag the same across platforms.Type of Change
Package(s) Affected
Governance & security:
Testing
Unit Testing
Added
TestConfigScanner.test_finds_config_files_in_subdirectories(there were no ConfigScanner tests). It fails on Windows before the change and passes after. On Linux it passes either way, so it only guards Windows (#3896 adds a Windows CI job). The agent-discovery suite passes (58 tests).Manual Testing
Ran the scanner on Windows over a folder with
.agentmesh/config.yaml,.mcp/config.jsonandcrewai.yaml. Before: onlycrewai.yaml. After: all three.Checklist
Attribution & Prior Art
Prior art / related projects (if any):
AI Assistance
If AI tools materially shaped this change, briefly note what was used:
Claude Code helped find the bug and draft the fix and test. I reviewed the change and ran the tests.
IP, Patents, and Licensing