Skip to content

Commit a01d7ea

Browse files
Merge pull request #146 from smokeyScraper/bug_fixes
fix: deprecation warnings and bug fixes
2 parents 0fa57ec + 78c0318 commit a01d7ea

File tree

11 files changed

+2113
-2088
lines changed

11 files changed

+2113
-2088
lines changed

backend/app/api/v1/integrations.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
IntegrationListResponse,
88
IntegrationStatusResponse
99
)
10-
from app.services.integration_service import integration_service, NotFoundError
10+
from app.services.integration_service import integration_service, IntegrationNotFoundError
1111
from app.core.dependencies import get_current_user
1212

1313
router = APIRouter()
@@ -76,8 +76,10 @@ async def update_integration(
7676
"""Update an existing integration."""
7777
try:
7878
return await integration_service.update_integration(user_id, integration_id, request)
79-
except NotFoundError as e:
79+
except IntegrationNotFoundError as e:
8080
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(e)) from e
81+
except ValueError as e:
82+
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e)) from e
8183
except HTTPException:
8284
raise
8385
except Exception as e:
@@ -94,8 +96,10 @@ async def delete_integration(
9496
"""Delete an integration."""
9597
try:
9698
await integration_service.delete_integration(user_id, integration_id)
97-
except NotFoundError as e:
99+
except IntegrationNotFoundError as e:
98100
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(e)) from e
101+
except ValueError as e:
102+
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e)) from e
99103
except HTTPException:
100104
raise
101105
except Exception as e:

backend/app/database/falkor/code-graph-backend/poetry.lock

Lines changed: 2066 additions & 2057 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/app/database/falkor/code-graph-backend/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ readme = "README.md"
77
package-mode = false
88

99
[tool.poetry.dependencies]
10-
python = "^3.10"
11-
graphrag-sdk = { version = "^0.5.0", extras = ["litellm"] }
10+
python = ">=3.10,<3.14"
11+
graphrag-sdk = "^0.8.1"
1212
tree-sitter = "^0.24.0"
1313
validators = "^0.34.0"
1414
falkordb = "^1.0.10"

backend/app/models/database/supabase.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pydantic import BaseModel, Field
1+
from pydantic import BaseModel, Field, ConfigDict
22
from uuid import UUID
33
from typing import Optional, List
44
from datetime import datetime
@@ -225,5 +225,4 @@ class IndexedRepository(BaseModel):
225225
edge_count: int = 0
226226
last_error: Optional[str] = None
227227

228-
class Config:
229-
orm_mode = True
228+
model_config = ConfigDict(from_attributes=True)

backend/app/services/integration_service.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
IntegrationCreateRequest,
88
IntegrationUpdateRequest,
99
IntegrationResponse,
10-
IntegrationStatusResponse,
11-
NotFoundError
10+
IntegrationStatusResponse
1211
)
1312

1413
logger = logging.getLogger(__name__)
1514

1615

16+
class IntegrationNotFoundError(Exception):
17+
"""Raised when an integration is not found."""
18+
pass
19+
20+
1721
class IntegrationService:
1822
"""Service for registering organizations (stores org info only)."""
1923

@@ -143,7 +147,7 @@ async def update_integration(
143147

144148
existing = await self.get_integration(user_id, integration_id)
145149
if not existing:
146-
raise NotFoundError("Integration not found")
150+
raise IntegrationNotFoundError("Integration not found")
147151

148152
if request.organization_link is not None:
149153
base_config = (update_data.get("config") or existing.config or {}).copy()
@@ -170,6 +174,11 @@ async def update_integration(
170174
async def delete_integration(self, user_id: UUID, integration_id: UUID) -> bool:
171175
"""Delete an integration."""
172176
try:
177+
# Check if integration exists before deleting
178+
existing = await self.get_integration(user_id, integration_id)
179+
if not existing:
180+
raise IntegrationNotFoundError("Integration not found")
181+
173182
await self.supabase.table("organization_integrations")\
174183
.delete()\
175184
.eq("id", str(integration_id))\

backend/integrations/discord/bot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def __init__(self, queue_manager: AsyncQueueManager, **kwargs):
2020
super().__init__(
2121
command_prefix=None,
2222
intents=intents,
23+
heartbeat_timeout=60.0,
2324
**kwargs
2425
)
2526

backend/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,7 @@ async def favicon():
141141
"__main__:api",
142142
host="0.0.0.0",
143143
port=8000,
144-
reload=True
144+
reload=True,
145+
ws_ping_interval=20,
146+
ws_ping_timeout=20
145147
)

backend/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ proto-plus==1.26.1
153153
protobuf>=3.20.2,<4.0
154154
ptyprocess==0.7.0
155155
pure_eval==0.2.3
156-
py-cord==2.6.1
156+
py-cord==2.6.2 # Latest version to minimize deprecation warnings
157157
pyasn1==0.6.1
158158
pyasn1_modules==0.4.2
159159
pycodestyle==2.13.0
@@ -224,7 +224,7 @@ watchfiles==1.0.5
224224
wcwidth==0.2.13
225225
weaviate-client==4.15.4
226226
websocket-client==1.8.0
227-
websockets==14.2
227+
websockets>=15.0.1,<16.0.0
228228
wrapt==1.17.2
229229
xxhash==3.5.0
230230
yarl==1.20.1

backend/start_github_mcp_server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
try:
1212
from app.agents.devrel.github.services.github_mcp_server import app
1313
import uvicorn
14-
14+
1515
print("Starting GitHub MCP Server...")
1616
print("Server will be available at: http://localhost:8001")
1717
print("Health check: http://localhost:8001/health")
1818
print("Press Ctrl+C to stop the server")
19-
20-
uvicorn.run(app, host="0.0.0.0", port=8001)
21-
19+
20+
uvicorn.run(app, host="0.0.0.0", port=8001, ws_ping_interval=20, ws_ping_timeout=20)
21+
2222
except ImportError as e:
2323
print(f"Import error: {e}")
2424
print("Make sure you're running this from the backend directory")

poetry.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)