Bug Description
All 5 functions in analysis_tools.py crash with 'str' object has no attribute 'resolve' because they pass a raw str to _validate_repo_root(), which expects a Path object.
When repo_root is omitted (defaults to ""), the error becomes 'NoneType' object has no attribute 'resolve' — there's no fallback to find_project_root().
Affected Tools
get_hub_nodes_func
get_bridge_nodes_func
get_knowledge_gaps_func
get_surprising_connections_func
get_suggested_questions_func
Version
code-review-graph 2.3.2
Python 3.12
Steps to Reproduce
Via MCP:
{ "tool": "get_hub_nodes_tool", "arguments": { "repo_root": "/path/to/repo", "top_n": 10 } }
Or:
{ "tool": "get_knowledge_gaps_tool", "arguments": {} }
Both fail. The first with 'str' object has no attribute 'resolve', the second with empty string also failing.
Root Cause
In tools/analysis_tools.py (all 5 functions):
# BUG — repo_root is str, _validate_repo_root expects Path
root = _validate_repo_root(repo_root)
store = _get_store(str(root))
Compare with the correct pattern in tools/_common.py (_get_store) and tools/refactor_tools.py:
# CORRECT — wraps in Path() and handles empty/None fallback
root = _validate_repo_root(Path(repo_root)) if repo_root else find_project_root()
_validate_repo_root is defined as:
def _validate_repo_root(path: Path) -> Path:
resolved = path.resolve() # <-- str has no .resolve()
Suggested Fix
In tools/analysis_tools.py, change all 5 occurrences from:
root = _validate_repo_root(repo_root)
store = _get_store(str(root))
To:
root = _validate_repo_root(Path(repo_root)) if repo_root else find_project_root()
store = _get_store(str(root))
Or, simplify by just using _get_store() directly (which already handles the conversion):
store, root = _get_store(repo_root or None)
This is a one-line fix per function (5 lines total).
Bug Description
All 5 functions in
analysis_tools.pycrash with'str' object has no attribute 'resolve'because they pass a rawstrto_validate_repo_root(), which expects aPathobject.When
repo_rootis omitted (defaults to""), the error becomes'NoneType' object has no attribute 'resolve'— there's no fallback tofind_project_root().Affected Tools
get_hub_nodes_funcget_bridge_nodes_funcget_knowledge_gaps_funcget_surprising_connections_funcget_suggested_questions_funcVersion
Steps to Reproduce
Via MCP:
{ "tool": "get_hub_nodes_tool", "arguments": { "repo_root": "/path/to/repo", "top_n": 10 } }Or:
{ "tool": "get_knowledge_gaps_tool", "arguments": {} }Both fail. The first with
'str' object has no attribute 'resolve', the second with empty string also failing.Root Cause
In
tools/analysis_tools.py(all 5 functions):Compare with the correct pattern in
tools/_common.py(_get_store) andtools/refactor_tools.py:_validate_repo_rootis defined as:Suggested Fix
In
tools/analysis_tools.py, change all 5 occurrences from:To:
Or, simplify by just using
_get_store()directly (which already handles the conversion):This is a one-line fix per function (5 lines total).