fix walk-up discovery to also detect index directory#285
Merged
Conversation
discover_project_root() only looked for .java-codebase-rag.yml config files, missing .java-codebase-rag/ index directories. This caused MCP tools to fail when started from a microservice subdirectory because walk-up returned None and fell back to cwd (no index there). Empty index directories are skipped to avoid stale artifacts from falsely anchoring discovery. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
microservice_for_path walks _bounded_parents which excludes the path itself. When cwd is exactly the microservice root directory (the most common case), it was never checked for a build marker and auto-scope returned None. Pass a synthetic child path so cwd appears in the parent walk. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
41badbe to
de552a0
Compare
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
discover_project_root()walk-up only looked for.java-codebase-rag.ymlconfig files, missing.java-codebase-rag/index directoriesNone, fell back to cwd, found no index.java-codebase-rag/directories are skipped to avoid stale artifacts from falsely anchoring discoveryTest plan
pytest-asyncio)tests/bank-chat-system/chat-core/and verify tools work🤖 Generated with Claude Code