-
Notifications
You must be signed in to change notification settings - Fork 72
[chore]: update poetry modules #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…-genai and remove dotenv
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. 💤 Files selected but had no reviewable changes (1)
You can disable this status message by setting the WalkthroughThis update introduces significant refactoring and modularization across the backend. It reorganizes imports, removes deprecated endpoints and models, introduces new health check endpoints and API routers, and migrates user management functionality into dedicated service modules. Several files and SQL scripts related to repository statistics and vector database management are removed. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant FastAPI
participant HealthRouter
participant WeaviateClient
participant DiscordBot
Client->>FastAPI: GET /v1/health
FastAPI->>HealthRouter: health_check()
HealthRouter->>WeaviateClient: is_ready()
HealthRouter->>DiscordBot: check status
HealthRouter-->>FastAPI: JSON health status
FastAPI-->>Client: 200 OK / 503 Error
Possibly related PRs
Suggested labels
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🔭 Outside diff range comments (6)
backend/app/agents/devrel/nodes/handlers/technical_support.py (1)
6-17: Return-type mismatch: function promisesAgentStatebut returnsdict
handle_technical_support_nodeis annotated to returnAgentState, yet the body returns a plaindict.
Either wrap the update instate.copy(update=...)and return the newAgentState, or change the annotation todict. Example fix:-async def handle_technical_support_node(state: AgentState) -> AgentState: +async def handle_technical_support_node(state: AgentState) -> AgentState: @@ - return { + return state.copy( + update={ "task_result": { "type": "technical_support", "action": "provide_guidance", "requires_human_review": False }, "current_task": "technical_support_handled" - } + } + )backend/app/agents/devrel/nodes/handlers/onboarding.py (1)
6-17: Return-type annotation is wrong – function returnsdict, notAgentState
handle_onboarding_nodeadvertises-> AgentState, yet it builds and returns a plaindict.
Either mutate and return the incomingstate, or update the annotation:-async def handle_onboarding_node(state: AgentState) -> AgentState: +async def handle_onboarding_node(state: AgentState) -> dict:backend/app/services/auth/supabase.py (1)
44-45: Refresh-token must not be an empty string
supabase-pyrejects an emptyrefresh_token; passNoneinstead.- await supabase.auth.set_session(access_token, refresh_token="") + await supabase.auth.set_session(access_token, refresh_token=None)backend/integrations/discord/bot.py (1)
26-28: Avoid spawning a new LLM client per bot instance
ClassificationRouter()internally spins up a Gemini client; creating one per bot increases memory and API-quota usage.- self.classifier = ClassificationRouter() + # Share classifier across all bot instances + self.classifier = kwargs.get("classifier") or ClassificationRouter()Consider injecting a shared
ClassificationRouterfrom your composition root.backend/app/database/weaviate/scripts/populate_db.py (1)
291-297:async withon a plain async-generator will raiseTypeErrorat runtime
get_weaviate_client()returns an async generator (seeclient.py), but it is not decorated with@asynccontextmanager.
Using it in anasync withblock therefore produces:TypeError: 'async_generator' object does not support the async context manager protocolEither wrap the generator with
contextlib.asynccontextmanageror change the call site:-from app.database.weaviate.client import get_weaviate_client +from contextlib import asynccontextmanager +from app.database.weaviate.client import get_weaviate_client # unchanged -async with get_weaviate_client() as client: +async for client in get_weaviate_client(): ...Alternatively, update
get_weaviate_clientitself:-from async def get_weaviate_client() -> AsyncGenerator[…]: - ... +@asynccontextmanager +async def get_weaviate_client() -> AsyncGenerator[…]: + ...backend/app/agents/devrel/nodes/gather_context.py (1)
3-35: Return type annotation mismatches actual return value
gather_context_nodeis annotated to returnAgentState, yet it returns a partial-state dict.
Either:
- Change the annotation to
dict[str, Any](or aTypedDict), or- Instantiate and return a full
AgentStateobject.This avoids confusing static analysers and IDEs during future maintenance.
-async def gather_context_node(state: AgentState) -> AgentState: +from typing import Dict, Any + +async def gather_context_node(state: AgentState) -> Dict[str, Any]:
🧹 Nitpick comments (7)
backend/routes.py (2)
13-17:RepoRequestis now orphaned—consider deleting it.With the
/repo-statsendpoint removed, this Pydantic model is no longer referenced anywhere in the codebase. Keeping unused models increases cognitive load and risks future confusion.-class RepoRequest(BaseModel): - repo_url: str - -
70-75: Guard-clause here would simplify control flow.Instead of letting execution fall through and reach the generic “no matching event” branch, you could return early when a PR is closed without merge. This prevents unnecessary checks below and makes intent explicit.
elif action == "closed": # Determine if the PR was merged or simply closed if payload.get("pull_request", {}).get("merged"): event_type = EventType.PR_MERGED else: - logging.info("Pull request closed without merge; no event dispatched.") + logging.info("Pull request closed without merge; no event dispatched.") + return {"status": "ignored"}backend/app/agents/devrel/nodes/handlers/faq.py (1)
10-17: Guard against emptylatest_messagebefore hitting the FAQ toolIf neither
state.messagesnorstate.context["original_message"]is populated, an empty string reachesfaq_tool.get_response(""), which may return irrelevant or expensive results.- # faq_tool will be passed from the agent, similar to llm for classify_intent - faq_response = await faq_tool.get_response(latest_message) + # Abort early when there is nothing to answer + if not latest_message.strip(): + logger.warning("FAQ node invoked with no message content") + return {"current_task": "faq_skipped"} + + faq_response = await faq_tool.get_response(latest_message)backend/app/database/weaviate/scripts/create_schemas.py (1)
40-49: Leverage an async context manager for the Weaviate clientManual
connect/closepairs leave room for leaks on exceptions. If the client supportsasync with, refactor:- client = get_client() - try: - await client.connect() + async with get_client() as client: await create_user_profile_schema(client) print("✅ User profile schema created successfully.") - except Exception as e: - print(f"❌ Error creating schema: {str(e)}") - raise - finally: - await client.close()backend/app/database/weaviate/operations.py (1)
5-6: Import-path switch OK, but consider a quick sweep for lingering old pathsThe switch to
app.models.database.weaviate/app.database.weaviate.clientis correct.
To avoid stray references, you might run a one-off grep:rg -n "app\.db\.weaviate\." || echo "✅ no old paths"Purely a housekeeping note; implementation itself is fine.
backend/app/core/config/__init__.py (1)
1-3: Good lightweight re-export – minor style nitTiny nit:
__all__is typically a tuple rather than a list in std-lib style guides, although both work.-__all__ = ["settings"] +__all__ = ("settings",)Totally optional.
backend/app/services/auth/management.py (1)
10-41: Well-structured user creation function with minor error handling improvement needed.The function properly handles the get-or-create pattern with good logging and error handling.
Consider improving the error message specificity:
- if not insert_res.data: - raise Exception("Failed to create new user in database.") + if not insert_res.data: + raise Exception(f"Failed to create new user in database for Discord ID: {discord_id}")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
poetry.lockis excluded by!**/*.lock
📒 Files selected for processing (36)
backend/app/agents/__init__.py(1 hunks)backend/app/agents/devrel/__init__.py(1 hunks)backend/app/agents/devrel/agent.py(1 hunks)backend/app/agents/devrel/generate_response_node.py(2 hunks)backend/app/agents/devrel/nodes/gather_context.py(1 hunks)backend/app/agents/devrel/nodes/handlers/faq.py(1 hunks)backend/app/agents/devrel/nodes/handlers/onboarding.py(1 hunks)backend/app/agents/devrel/nodes/handlers/technical_support.py(1 hunks)backend/app/agents/devrel/nodes/handlers/web_search.py(3 hunks)backend/app/agents/devrel/nodes/summarization.py(3 hunks)backend/app/api/__init__.py(1 hunks)backend/app/api/router.py(1 hunks)backend/app/api/v1/__init__.py(1 hunks)backend/app/api/v1/auth.py(1 hunks)backend/app/api/v1/health.py(1 hunks)backend/app/core/config/__init__.py(1 hunks)backend/app/core/dependencies.py(1 hunks)backend/app/core/orchestration/agent_coordinator.py(1 hunks)backend/app/database/weaviate/operations.py(1 hunks)backend/app/database/weaviate/scripts/create_schemas.py(1 hunks)backend/app/database/weaviate/scripts/populate_db.py(1 hunks)backend/app/models.py(0 hunks)backend/app/models/__init__.py(1 hunks)backend/app/routes.py(0 hunks)backend/app/services/auth/management.py(1 hunks)backend/app/services/auth/supabase.py(1 hunks)backend/app/services/auth/verification.py(2 hunks)backend/app/services/user/profiling.py(1 hunks)backend/app/services/vector_db/sql.txt(0 hunks)backend/app/utils/github_api.py(0 hunks)backend/integrations/discord/bot.py(1 hunks)backend/integrations/discord/cogs.py(1 hunks)backend/main.py(3 hunks)backend/routes.py(2 hunks)pyproject.toml(1 hunks)tests/test_supabase.py(1 hunks)
💤 Files with no reviewable changes (4)
- backend/app/models.py
- backend/app/routes.py
- backend/app/utils/github_api.py
- backend/app/services/vector_db/sql.txt
🧰 Additional context used
🧠 Learnings (15)
📓 Common learnings
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#85
File: tests/test_supabase.py:1-3
Timestamp: 2025-06-28T14:45:55.201Z
Learning: In the Devr.AI project, smokeyScraper prefers to defer comprehensive test refactoring to separate PRs/efforts when doing major backend restructuring, rather than expanding the scope of the current refactoring PR to include test updates.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#85
File: backend/app/services/auth/management.py:32-33
Timestamp: 2025-06-28T14:44:36.801Z
Learning: In the Devr.AI project, smokeyScraper prefers using machine timezone (IST) for datetime operations during development and testing for easier debugging, with plans to switch to UTC for deployment later.
backend/app/agents/devrel/__init__.py (1)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/devrel/nodes/handle_technical_support_node.py:6-17
Timestamp: 2025-06-08T13:15:40.536Z
Learning: The handle_technical_support_node function in backend/app/agents/devrel/nodes/handle_technical_support_node.py is intentionally minimal and will be extended after database configuration is completed.
backend/app/agents/devrel/nodes/handlers/faq.py (1)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/__init__.py:2-2
Timestamp: 2025-06-08T13:15:11.074Z
Learning: In backend/app/agents/shared/base_agent.py, the BaseAgent class internally imports and re-exports AgentState, making it valid to import AgentState from shared.base_agent in addition to shared.state.
backend/app/agents/devrel/nodes/handlers/technical_support.py (2)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/__init__.py:2-2
Timestamp: 2025-06-08T13:15:11.074Z
Learning: In backend/app/agents/shared/base_agent.py, the BaseAgent class internally imports and re-exports AgentState, making it valid to import AgentState from shared.base_agent in addition to shared.state.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/devrel/nodes/handle_technical_support_node.py:6-17
Timestamp: 2025-06-08T13:15:40.536Z
Learning: The handle_technical_support_node function in backend/app/agents/devrel/nodes/handle_technical_support_node.py is intentionally minimal and will be extended after database configuration is completed.
backend/app/agents/devrel/nodes/handlers/onboarding.py (1)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/__init__.py:2-2
Timestamp: 2025-06-08T13:15:11.074Z
Learning: In backend/app/agents/shared/base_agent.py, the BaseAgent class internally imports and re-exports AgentState, making it valid to import AgentState from shared.base_agent in addition to shared.state.
backend/app/agents/__init__.py (2)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/__init__.py:2-2
Timestamp: 2025-06-08T13:15:11.074Z
Learning: In backend/app/agents/shared/base_agent.py, the BaseAgent class internally imports and re-exports AgentState, making it valid to import AgentState from shared.base_agent in addition to shared.state.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#75
File: backend/app/agents/devrel/agent.py:34-35
Timestamp: 2025-06-13T21:56:19.183Z
Learning: In the Devr.AI backend, the DevRelAgent follows a singleton pattern where only one instance exists for the entire application lifetime, using InMemorySaver with thread-based conversation management to persist user conversations across sessions.
backend/integrations/discord/bot.py (2)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/shared/classification_router.py:0-0
Timestamp: 2025-06-08T13:08:48.469Z
Learning: The user plans to migrate the JSON parsing in backend/app/agents/shared/classification_router.py from manual JSON extraction to using Pydantic parser for better validation and type safety.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/core/orchestration/queue_manager.py:48-66
Timestamp: 2025-06-08T13:27:45.522Z
Learning: The queue manager implementation in backend/app/core/orchestration/queue_manager.py is temporary and will be replaced with RabbitMQ in the future.
backend/app/agents/devrel/nodes/gather_context.py (1)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/__init__.py:2-2
Timestamp: 2025-06-08T13:15:11.074Z
Learning: In backend/app/agents/shared/base_agent.py, the BaseAgent class internally imports and re-exports AgentState, making it valid to import AgentState from shared.base_agent in addition to shared.state.
backend/app/core/orchestration/agent_coordinator.py (3)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/__init__.py:2-2
Timestamp: 2025-06-08T13:15:11.074Z
Learning: In backend/app/agents/shared/base_agent.py, the BaseAgent class internally imports and re-exports AgentState, making it valid to import AgentState from shared.base_agent in addition to shared.state.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#75
File: backend/app/agents/devrel/agent.py:34-35
Timestamp: 2025-06-13T21:56:19.183Z
Learning: In the Devr.AI backend, the DevRelAgent follows a singleton pattern where only one instance exists for the entire application lifetime, using InMemorySaver with thread-based conversation management to persist user conversations across sessions.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/devrel/nodes/handle_technical_support_node.py:6-17
Timestamp: 2025-06-08T13:15:40.536Z
Learning: The handle_technical_support_node function in backend/app/agents/devrel/nodes/handle_technical_support_node.py is intentionally minimal and will be extended after database configuration is completed.
tests/test_supabase.py (1)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#85
File: backend/app/services/auth/management.py:83-83
Timestamp: 2025-06-28T14:44:34.375Z
Learning: In the backend/app/services/auth/management.py file, the team prefers to use datetime.now() (local timezone/IST) during development and testing for easier debugging, with plans to change to UTC timezone-aware datetime (datetime.now(timezone.utc)) during deployment.
backend/app/agents/devrel/nodes/summarization.py (1)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/__init__.py:2-2
Timestamp: 2025-06-08T13:15:11.074Z
Learning: In backend/app/agents/shared/base_agent.py, the BaseAgent class internally imports and re-exports AgentState, making it valid to import AgentState from shared.base_agent in addition to shared.state.
backend/app/agents/devrel/agent.py (4)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/__init__.py:2-2
Timestamp: 2025-06-08T13:15:11.074Z
Learning: In backend/app/agents/shared/base_agent.py, the BaseAgent class internally imports and re-exports AgentState, making it valid to import AgentState from shared.base_agent in addition to shared.state.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/devrel/nodes/handle_technical_support_node.py:6-17
Timestamp: 2025-06-08T13:15:40.536Z
Learning: The handle_technical_support_node function in backend/app/agents/devrel/nodes/handle_technical_support_node.py is intentionally minimal and will be extended after database configuration is completed.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#75
File: backend/app/agents/devrel/agent.py:34-35
Timestamp: 2025-06-13T21:56:19.183Z
Learning: In the Devr.AI backend, the DevRelAgent follows a singleton pattern where only one instance exists for the entire application lifetime, using InMemorySaver with thread-based conversation management to persist user conversations across sessions.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/shared/classification_router.py:0-0
Timestamp: 2025-06-08T13:08:48.469Z
Learning: The user plans to migrate the JSON parsing in backend/app/agents/shared/classification_router.py from manual JSON extraction to using Pydantic parser for better validation and type safety.
backend/app/agents/devrel/generate_response_node.py (2)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/__init__.py:2-2
Timestamp: 2025-06-08T13:15:11.074Z
Learning: In backend/app/agents/shared/base_agent.py, the BaseAgent class internally imports and re-exports AgentState, making it valid to import AgentState from shared.base_agent in addition to shared.state.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/devrel/nodes/handle_technical_support_node.py:6-17
Timestamp: 2025-06-08T13:15:40.536Z
Learning: The handle_technical_support_node function in backend/app/agents/devrel/nodes/handle_technical_support_node.py is intentionally minimal and will be extended after database configuration is completed.
backend/app/agents/devrel/nodes/handlers/web_search.py (1)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/devrel/nodes/handle_web_search_node.py:31-42
Timestamp: 2025-06-08T13:31:11.572Z
Learning: In backend/app/agents/devrel/tools/search_tool.py, the TavilySearchTool.search() method has partial error handling for missing API key, AttributeError, ConnectionError, and TimeoutError, but lacks a comprehensive Exception catch-all block, so calling functions may still need additional error handling for other potential exceptions.
backend/app/services/auth/management.py (1)
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#85
File: backend/app/services/auth/management.py:83-83
Timestamp: 2025-06-28T14:44:34.375Z
Learning: In the backend/app/services/auth/management.py file, the team prefers to use datetime.now() (local timezone/IST) during development and testing for easier debugging, with plans to change to UTC timezone-aware datetime (datetime.now(timezone.utc)) during deployment.
🧬 Code Graph Analysis (19)
backend/app/agents/devrel/nodes/handlers/faq.py (1)
backend/app/agents/state.py (1)
AgentState(18-73)
backend/app/services/auth/supabase.py (1)
backend/app/database/supabase/client.py (1)
get_supabase_client(9-13)
backend/app/database/weaviate/scripts/create_schemas.py (1)
backend/app/database/weaviate/client.py (1)
get_client(11-16)
backend/app/agents/devrel/nodes/handlers/technical_support.py (1)
backend/app/agents/state.py (1)
AgentState(18-73)
backend/app/agents/devrel/nodes/handlers/onboarding.py (1)
backend/app/agents/state.py (1)
AgentState(18-73)
backend/app/database/weaviate/scripts/populate_db.py (1)
backend/app/database/weaviate/client.py (1)
get_weaviate_client(19-32)
backend/integrations/discord/bot.py (1)
backend/app/agents/classification_router.py (1)
ClassificationRouter(30-208)
backend/app/agents/devrel/nodes/gather_context.py (1)
backend/app/agents/state.py (1)
AgentState(18-73)
backend/app/services/user/profiling.py (2)
backend/app/models/database/weaviate.py (3)
WeaviateUserProfile(32-129)WeaviateRepository(5-15)WeaviatePullRequest(17-30)backend/app/database/weaviate/operations.py (1)
store_user_profile(131-136)
backend/app/database/weaviate/operations.py (2)
backend/app/models/database/weaviate.py (1)
WeaviateUserProfile(32-129)backend/app/database/weaviate/client.py (1)
get_weaviate_client(19-32)
tests/test_supabase.py (2)
backend/app/models/database/supabase.py (3)
User(7-69)Interaction(118-156)Repository(72-115)backend/app/database/supabase/client.py (1)
get_supabase_client(9-13)
backend/app/core/dependencies.py (1)
backend/main.py (1)
DevRAIApplication(24-81)
backend/app/agents/devrel/nodes/summarization.py (1)
backend/app/agents/state.py (1)
AgentState(18-73)
backend/app/api/v1/auth.py (3)
backend/app/database/supabase/client.py (1)
get_supabase_client(9-13)backend/app/services/auth/verification.py (2)
find_user_by_session_and_verify(63-135)get_verification_session_info(156-176)backend/app/services/user/profiling.py (1)
profile_user_from_github(296-310)
backend/app/services/auth/verification.py (2)
backend/app/database/supabase/client.py (1)
get_supabase_client(9-13)backend/app/models/database/supabase.py (1)
User(7-69)
backend/app/agents/devrel/generate_response_node.py (2)
backend/app/agents/state.py (1)
AgentState(18-73)backend/app/agents/devrel/nodes/handlers/web_search.py (1)
create_search_response(51-71)
backend/app/agents/devrel/nodes/handlers/web_search.py (1)
backend/app/agents/state.py (1)
AgentState(18-73)
backend/app/api/v1/health.py (3)
backend/app/database/weaviate/client.py (1)
get_weaviate_client(19-32)backend/app/core/dependencies.py (1)
get_app_instance(7-12)backend/main.py (1)
DevRAIApplication(24-81)
backend/app/services/auth/management.py (2)
backend/app/database/supabase/client.py (1)
get_supabase_client(9-13)backend/app/models/database/supabase.py (1)
User(7-69)
🪛 Pylint (3.3.7)
tests/test_supabase.py
[error] 1-1: No name 'CodeChunk' in module 'backend.app.models.database.supabase'
(E0611)
🪛 Ruff (0.11.9)
backend/app/api/v1/health.py
15-15: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
68-68: Do not perform function call Depends in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
(B008)
🔇 Additional comments (37)
backend/app/models/__init__.py (1)
1-1: No functional change – safe to ignoreOnly a blank line was added; nothing to review.
backend/app/agents/devrel/__init__.py (1)
1-1: No-op diffThe added newline has no behavioural impact.
backend/app/api/v1/__init__.py (1)
1-1: Trivial changeSolely introduces a blank line – no action required.
backend/app/agents/devrel/nodes/handlers/technical_support.py (1)
2-2: Import path update looks correct
AgentStatenow lives inapp.agents.state, so the new import resolves the previous mismatch.pyproject.toml (1)
23-24: Dependency swap confirmed; no legacy imports remainAll references to
langchain[google-genai]have been replaced withlangchain_google_genai, and no directimport dotenvusages were found.• backend/app/agents/classification_router.py: now imports
from langchain_google_genai import ChatGoogleGenerativeAI
• backend/app/agents/devrel/agent.py: now importsfrom langchain_google_genai import ChatGoogleGenerativeAINo further action required.
backend/app/agents/devrel/nodes/handlers/faq.py (1)
2-2: Import path looks fine after refactorThe new location
app.agents.statematches the reorganised package structure – no action needed.backend/app/agents/devrel/nodes/handlers/onboarding.py (1)
2-2: Import path update LGTM
app.agents.stateresolves cleanly after the package flattening.backend/app/services/auth/supabase.py (1)
2-2: All Supabase client imports are updated and verified
- No occurrences of the old path
app.db.supabase.supabase_clientremain.- The function
get_supabase_clientis defined inbackend/app/database/supabase/client.py:9.backend/integrations/discord/bot.py (1)
6-6: Import path aligned with agent package flatteningGood catch –
app.agents.classification_routeris the correct new location.backend/app/database/weaviate/scripts/populate_db.py (1)
4-4: Import path looks good; double-check install locationThe move from
app.db.weaviate.weaviate_clienttoapp.database.weaviate.clientaligns with the new package layout. Verify that the old module has indeed been removed to avoid stray duplicates on PYTHONPATH.backend/app/agents/__init__.py (1)
2-3: Re-exports are clear and explicit – good improvementSwitching to package-level imports removes the now-obsolete
sharednamespace and keeps consumers’ import paths stable via__all__.
No further action needed.backend/app/core/orchestration/agent_coordinator.py (1)
8-11: Imports VerifiedBoth imports resolve correctly and exist in the codebase:
- backend/app/agents/state.py defines
class AgentState- backend/app/agents/devrel/nodes/summarization.py defines
async def store_summary_to_database(state: AgentState)No import errors expected at runtime.
backend/app/api/__init__.py (1)
1-11: Nice evergreen package docstring and explicit exportAdding a descriptive module-level docstring and consolidating the router export improves discoverability of the API package. 👍
backend/app/services/user/profiling.py (1)
7-8: Updated imports align with new module layout – looks goodThe new paths (
app.models.database.weaviate,app.database.weaviate.operations) reflect the project-wide refactor and resolve the formerapp.model.*/app.db.*split. No issues spotted.backend/app/api/router.py (1)
1-19: Centralised router looks solidRouter aggregation is clear and versioned; prefixes & tags follow FastAPI conventions. Nice touch exporting only
api_router.backend/integrations/discord/cogs.py (1)
5-9: Imports Verified and AccessibleAll referenced modules and functions exist under
app.services.authandintegrations.discord. The import reorganization is valid and preserves functionality. No further changes required.backend/app/api/v1/auth.py (1)
3-5: Import reorganization successfully separates concerns.The updated import paths correctly reflect the new modular structure:
- Database clients moved to
app.database.supabase.client- Authentication services consolidated in
app.services.auth.verification- User profiling services in
app.services.user.profilingThis aligns well with the broader refactoring effort and improves code organization.
backend/app/core/dependencies.py (1)
1-12: Well-implemented FastAPI dependency injection pattern.This dependency function properly:
- Uses
TYPE_CHECKINGto avoid circular imports with the main application- Follows FastAPI conventions for accessing application state
- Provides clean access to the
DevRAIApplicationinstance for health checks and other endpointsThe implementation aligns with FastAPI best practices and supports the modular architecture improvements.
backend/app/agents/devrel/nodes/summarization.py (2)
4-4: Import path update aligns with agent module reorganization.The change from
app.agents.shared.statetoapp.agents.stateis consistent with the broader refactoring effort and maintains access to theAgentStateclass.
15-17: Improved docstring formatting for better readability.Converting single-line docstrings to multi-line format follows Python conventions and improves code documentation clarity.
Also applies to: 51-53
backend/app/agents/devrel/generate_response_node.py (3)
3-3: Import path consolidation aligns with agent module reorganization.The change from
app.agents.shared.statetoapp.agents.stateis consistent with the broader agent module refactoring.
5-6: Good refactoring to use relative imports and centralized handlers.The changes improve code organization by:
- Using relative imports for better maintainability
- Moving search response creation to dedicated handler modules
- Centralizing response formatting logic
76-76: Successfully replaced internal function with handler module function.The replacement of the internal
_create_search_responsewithcreate_search_responsefrom handlers centralizes search response formatting and eliminates code duplication.backend/app/agents/devrel/nodes/handlers/web_search.py (2)
2-5: LGTM! Import path updates align with module reorganization.The import updates correctly reflect the new module structure, moving from shared subpackages to the base package level.
51-71: Well-implemented search response formatter.The new
create_search_responsefunction provides clean, user-friendly formatting of search results with proper error handling for empty results. The synchronous nature is appropriate for response formatting, and limiting to 5 results prevents overly long responses.backend/app/services/auth/verification.py (2)
4-5: Import path updates look correct.The updated import paths align with the new module structure, correctly pointing to the reorganized Supabase client and User model locations.
68-68: Good docstring improvement.The clarification about linking GitHub account to Discord user improves code documentation.
backend/app/agents/devrel/agent.py (1)
7-18: Import reorganization improves module structure.The updated import paths create a cleaner, more logical module hierarchy by moving core classes to the base package level and organizing handlers under dedicated submodules.
backend/main.py (3)
9-15: Import path updates support improved modularity.The updated import paths reflect the new module organization, consolidating API routing and moving Discord integrations to a dedicated namespace.
94-94: Good addition for dependency injection support.Assigning the application instance to
app.state.app_instanceenables proper dependency injection patterns in the FastAPI application.
108-108: Simplified API router inclusion.The consolidation to a single
api_routerimproves maintainability by centralizing route management in the dedicated router module.backend/app/services/auth/management.py (3)
43-57: Clean implementation with proper error handling.The function follows a consistent pattern with appropriate exception handling and Optional return type.
59-73: Consistent implementation pattern.Good consistency with the
get_user_by_idfunction pattern and proper error handling.
75-93: Flexible update function with automatic timestamp management.The use of
**updatesprovides good flexibility, and automatically adding theupdated_attimestamp is a nice touch that ensures data consistency.backend/app/api/v1/health.py (3)
14-42: LGTM! Well-implemented general health check endpoint.The implementation correctly:
- Uses proper async/await patterns with Weaviate client context manager
- Implements comprehensive error handling with logging
- Returns structured JSON responses with appropriate HTTP status codes
- Checks both critical services (Weaviate and Discord bot)
44-65: LGTM! Service-specific health check follows good patterns.The Weaviate-specific health check maintains consistency with the general health check while providing focused service monitoring.
67-87: LGTM! Discord bot health check is properly implemented.The bot status logic correctly checks both existence and connection state using
is_closed(). The error handling and response structure remain consistent with other endpoints.
| import logging | ||
| from fastapi import APIRouter, HTTPException, Depends | ||
| from app.database.weaviate.client import get_weaviate_client | ||
| from app.core.dependencies import get_app_instance | ||
| from typing import TYPE_CHECKING | ||
|
|
||
| if TYPE_CHECKING: | ||
| from main import DevRAIApplication | ||
|
|
||
| router = APIRouter() | ||
| logger = logging.getLogger(__name__) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the import path for DevRAIApplication.
The import path in the TYPE_CHECKING block appears incorrect. Based on the file structure, it should reference the full module path.
if TYPE_CHECKING:
- from main import DevRAIApplication
+ from backend.main import DevRAIApplicationNote: The static analysis warnings about Depends() in function parameters are false positives - this is the correct FastAPI pattern for dependency injection.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import logging | |
| from fastapi import APIRouter, HTTPException, Depends | |
| from app.database.weaviate.client import get_weaviate_client | |
| from app.core.dependencies import get_app_instance | |
| from typing import TYPE_CHECKING | |
| if TYPE_CHECKING: | |
| from main import DevRAIApplication | |
| router = APIRouter() | |
| logger = logging.getLogger(__name__) | |
| import logging | |
| from fastapi import APIRouter, HTTPException, Depends | |
| from app.database.weaviate.client import get_weaviate_client | |
| from app.core.dependencies import get_app_instance | |
| from typing import TYPE_CHECKING | |
| if TYPE_CHECKING: | |
| from backend.main import DevRAIApplication | |
| router = APIRouter() | |
| logger = logging.getLogger(__name__) |
🤖 Prompt for AI Agents
In backend/app/api/v1/health.py lines 1 to 12, the import path for
DevRAIApplication inside the TYPE_CHECKING block is incorrect. Update the import
statement to use the full module path that matches the project's file structure
to correctly reference DevRAIApplication. Leave the Depends() usage as is since
it is the correct FastAPI pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, the application is designed to run from the backend directory, so it's not a problem. can be configured later at the time of deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smokeyScraper Thanks for the clarification! That makes perfect sense - if the application is designed to run from the backend directory, then the import path from main import DevRAIApplication is indeed correct for your current setup. I appreciate you providing that context about the deployment architecture.
✏️ Learnings added
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#87
File: backend/app/api/v1/health.py:1-12
Timestamp: 2025-06-28T23:14:21.068Z
Learning: In the Devr.AI project, the application is designed to run from the backend directory, making import paths like `from main import DevRAIApplication` correct for the current setup. Import path adjustments for deployment will be configured later during the deployment process.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#85
File: tests/test_supabase.py:1-3
Timestamp: 2025-06-28T14:45:55.201Z
Learning: In the Devr.AI project, smokeyScraper prefers to defer comprehensive test refactoring to separate PRs/efforts when doing major backend restructuring, rather than expanding the scope of the current refactoring PR to include test updates.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#75
File: backend/app/agents/devrel/agent.py:34-35
Timestamp: 2025-06-13T21:56:19.183Z
Learning: In the Devr.AI backend, the DevRelAgent follows a singleton pattern where only one instance exists for the entire application lifetime, using InMemorySaver with thread-based conversation management to persist user conversations across sessions.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#85
File: backend/app/services/auth/management.py:32-33
Timestamp: 2025-06-28T14:44:36.801Z
Learning: In the Devr.AI project, smokeyScraper prefers using machine timezone (IST) for datetime operations during development and testing for easier debugging, with plans to switch to UTC for deployment later.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#85
File: backend/app/services/auth/management.py:83-83
Timestamp: 2025-06-28T14:44:34.375Z
Learning: In the backend/app/services/auth/management.py file, the team prefers to use datetime.now() (local timezone/IST) during development and testing for easier debugging, with plans to change to UTC timezone-aware datetime (datetime.now(timezone.utc)) during deployment.
Learnt from: smokeyScraper
PR: AOSSIE-Org/Devr.AI#72
File: backend/app/agents/devrel/nodes/handle_technical_support_node.py:6-17
Timestamp: 2025-06-08T13:15:40.536Z
Learning: The handle_technical_support_node function in backend/app/agents/devrel/nodes/handle_technical_support_node.py is intentionally minimal and will be extended after database configuration is completed.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Documentation
Chores