Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/app/core/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def get_current_user(authorization: str = Header(None)) -> UUID:
try:
supabase = get_supabase_client()
# Verify the token and get user
user_response = supabase.auth.get_user(token)
user_response = await supabase.auth.get_user(token)

if not user_response or not user_response.user:
raise HTTPException(
Expand Down
5 changes: 3 additions & 2 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ async def test_weaviate_connection(self):
if await client.is_ready():
logger.info("Weaviate connection successful and ready")
except Exception as e:
logger.error(f"Failed to connect to Weaviate: {e}")
raise
logger.warning(f"Failed to connect to Weaviate during startup: {e}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should let the backend start without all the services running before using the bot.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done as requested sir

logger.warning("Continuing without Weaviate - some features may not work")
# Don't raise - allow backend to start even if Weaviate is unavailable
Copy link

Copilot AI Jan 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change to allow startup without Weaviate is good for availability, but creates an inconsistency with the health check endpoints. Currently, if Weaviate fails to connect during startup, the backend continues running (as intended), but the /health endpoint will return 503 (unhealthy) whenever called because it doesn't handle the case where Weaviate is unavailable.

Consider updating the health check endpoints to gracefully handle Weaviate being unavailable, similar to how the startup now handles it. The /health endpoint could return 200 with weaviate: "unavailable" instead of raising a 503 exception. This would be more consistent with the graceful degradation approach.

Copilot uses AI. Check for mistakes.

async def stop_background_tasks(self):
"""Stops all background tasks and connections gracefully."""
Expand Down