fix: Address critical PR review issues
- Fix KuzuDB compatibility: Replace verify_connectivity() with universal query - Fix boolean env var expansion: Properly convert "true"/"false" strings to booleans - Fix Docker command paths: Update all docker-compose files to use src/graphiti_mcp_server.py These fixes address the critical runtime issues identified in PR review: 1. KuzuDB crash when calling non-existent verify_connectivity() method 2. Boolean environment variables being treated as truthy strings 3. Docker containers failing to start due to incorrect script path 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
36c73ee43d
commit
0b2b0b38e9
5 changed files with 32 additions and 7 deletions
|
|
@ -51,7 +51,7 @@ services:
|
||||||
- ../config/config-docker-falkordb.yaml:/app/config/config.yaml:ro
|
- ../config/config-docker-falkordb.yaml:/app/config/config.yaml:ro
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000" # Expose the MCP server via HTTP for SSE transport
|
- "8000:8000" # Expose the MCP server via HTTP for SSE transport
|
||||||
command: ["uv", "run", "graphiti_mcp_server.py", "--transport", "sse", "--config", "/app/config/config.yaml"]
|
command: ["uv", "run", "src/graphiti_mcp_server.py", "--transport", "sse", "--config", "/app/config/config.yaml"]
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
falkordb_data:
|
falkordb_data:
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ services:
|
||||||
- ../config/config-docker-neo4j.yaml:/app/config/config.yaml:ro
|
- ../config/config-docker-neo4j.yaml:/app/config/config.yaml:ro
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000" # Expose the MCP server via HTTP for SSE transport
|
- "8000:8000" # Expose the MCP server via HTTP for SSE transport
|
||||||
command: ["uv", "run", "graphiti_mcp_server.py", "--transport", "sse", "--config", "/app/config/config.yaml"]
|
command: ["uv", "run", "src/graphiti_mcp_server.py", "--transport", "sse", "--config", "/app/config/config.yaml"]
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
neo4j_data:
|
neo4j_data:
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ services:
|
||||||
- kuzu_data:/data
|
- kuzu_data:/data
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000" # Expose the MCP server via HTTP for SSE transport
|
- "8000:8000" # Expose the MCP server via HTTP for SSE transport
|
||||||
command: ["uv", "run", "graphiti_mcp_server.py", "--transport", "sse", "--config", "/app/config/config.yaml"]
|
command: ["uv", "run", "src/graphiti_mcp_server.py", "--transport", "sse", "--config", "/app/config/config.yaml"]
|
||||||
|
|
||||||
# Volume for persistent KuzuDB storage
|
# Volume for persistent KuzuDB storage
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,31 @@ class YamlSettingsSource(PydanticBaseSettingsSource):
|
||||||
def replacer(match):
|
def replacer(match):
|
||||||
var_name = match.group(1)
|
var_name = match.group(1)
|
||||||
default_value = match.group(3) if match.group(3) is not None else ''
|
default_value = match.group(3) if match.group(3) is not None else ''
|
||||||
return os.environ.get(var_name, default_value)
|
result = os.environ.get(var_name, default_value)
|
||||||
|
|
||||||
|
# Convert string booleans to actual booleans
|
||||||
|
if result.lower() == 'true':
|
||||||
|
return 'true' # Keep as string, let Pydantic handle conversion
|
||||||
|
elif result.lower() == 'false':
|
||||||
|
return 'false' # Keep as string, let Pydantic handle conversion
|
||||||
|
return result
|
||||||
|
|
||||||
pattern = r'\$\{([^:}]+)(:([^}]*))?\}'
|
pattern = r'\$\{([^:}]+)(:([^}]*))?\}'
|
||||||
return re.sub(pattern, replacer, value)
|
|
||||||
|
# Check if the entire value is a single env var expression with boolean default
|
||||||
|
full_match = re.fullmatch(pattern, value)
|
||||||
|
if full_match:
|
||||||
|
result = replacer(full_match)
|
||||||
|
# If the result is a boolean string and the whole value was the env var,
|
||||||
|
# return the actual boolean
|
||||||
|
if result == 'true':
|
||||||
|
return True
|
||||||
|
elif result == 'false':
|
||||||
|
return False
|
||||||
|
return result
|
||||||
|
else:
|
||||||
|
# Otherwise, do string substitution
|
||||||
|
return re.sub(pattern, replacer, value)
|
||||||
elif isinstance(value, dict):
|
elif isinstance(value, dict):
|
||||||
return {k: self._expand_env_vars(v) for k, v in value.items()}
|
return {k: self._expand_env_vars(v) for k, v in value.items()}
|
||||||
elif isinstance(value, list):
|
elif isinstance(value, list):
|
||||||
|
|
|
||||||
|
|
@ -641,8 +641,12 @@ async def get_status() -> StatusResponse:
|
||||||
try:
|
try:
|
||||||
client = await graphiti_service.get_client()
|
client = await graphiti_service.get_client()
|
||||||
|
|
||||||
# Test database connection
|
# Test database connection with a simple query
|
||||||
await client.driver.client.verify_connectivity() # type: ignore
|
# This works for all supported databases (Neo4j, FalkorDB, KuzuDB)
|
||||||
|
async with client.driver.session() as session:
|
||||||
|
result = await session.run('MATCH (n) RETURN count(n) as count')
|
||||||
|
# Consume the result to verify query execution
|
||||||
|
_ = [record async for record in result]
|
||||||
|
|
||||||
provider_info = f'{config.database.provider} database'
|
provider_info = f'{config.database.provider} database'
|
||||||
return StatusResponse(
|
return StatusResponse(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue