fix: add --repo to serve so get_docs_section works via uvx#24
Open
lbzepoqo wants to merge 1 commit intotirth8205:mainfrom
Open
fix: add --repo to serve so get_docs_section works via uvx#24lbzepoqo wants to merge 1 commit intotirth8205:mainfrom
lbzepoqo wants to merge 1 commit intotirth8205:mainfrom
Conversation
When running via uvx, the working directory is not the repo root, so
the existing auto-detection via _get_store() fails and get_docs_section_tool
always returns {"status": "not_found"}.
Add --repo to the serve subcommand (consistent with all other subcommands),
thread it through main() using a module-level default, and pass it to
get_docs_section so the tool can locate docs/LLM-OPTIMIZED-REFERENCE.md
from an explicitly provided path.
Usage: uvx code-review-graph serve --repo /path/to/repo
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e989bd6 to
1b7595a
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.
Problem
get_docs_section_toolalways returns{"status": "not_found"}when the MCP server runs viauvx. The root cause is that the existing auto-detection relies on the current working directory being inside the repo, which is not the case underuvx.The
servesubcommand was also the only one without a--repoargument — every other subcommand (build,update,watch,status,visualize,install,init) accepts--repofor explicit repo root specification.Solution
Add
--repoto theservesubcommand, consistent with all other subcommands. Thread the value throughmain()via a module-level default, then pass it toget_docs_sectionso the tool can locatedocs/LLM-OPTIMIZED-REFERENCE.md.No files are bundled into the wheel — docs stay in
docs/in the source tree.Usage
# Standard install via uvx — now works correctly: uvx code-review-graph serve --repo /path/to/your/repoIn
.mcp.json:{ "mcpServers": { "code-review-graph": { "command": "uvx", "args": ["code-review-graph", "serve", "--repo", "/path/to/your/repo"] } } }Changes
code_review_graph/cli.py--repotoservesubparser; pass toserve_main()code_review_graph/main.pyrepo_rootinmain(); store as module-level default; pass toget_docs_sectioncode_review_graph/tools.pyrepo_rootparam toget_docs_section; use explicit path first, then auto-detectTest Plan
uv run --with pytest pytest— 111 passedget_docs_section('troubleshooting', repo_root='.')returns section contentcode-review-graph serve --helpshows--repooption🤖 Generated with Claude Code