-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: added missed migration #394
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughAdds a new Alembic migration to introduce a nullable language column to llm_configs with default 'English' and backfill. Injects optional language instructions into researcher prompts via a new helper. Tightens guarded access and iteration for language selection in chats routes. Several files receive header/formatting-only updates. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant R as chats_routes
participant DB as Database
participant P as Researcher Prompts
participant L as LLM
U->>R: Create/continue chat
R->>DB: Load user preference + search space + LLM configs
DB-->>R: LLM configs (fast/long_context/strategic, language)
rect rgba(200,235,255,0.3)
note right of R: New/modified
R->>R: Select language (guarded checks, fallback to first config)
end
R->>P: Build system prompt (language passed)
rect rgba(220,255,220,0.4)
note right of P: New helper injects language instruction
P-->>R: System prompt with optional language directive
end
R->>L: Send prompt + user input
L-->>R: Response
R-->>U: Answer
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (11)
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. Comment |
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.
Review by RecurseML
🔍 Review performed on 9429c2b..a3f50eb
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (11)
• surfsense_backend/alembic/versions/23_associate_connectors_with_search_spaces.py
• surfsense_backend/alembic/versions/24_fix_null_chat_types.py
• surfsense_backend/alembic/versions/25_migrate_llm_configs_to_search_spaces.py
• surfsense_backend/alembic/versions/26_add_language_column_to_llm_configs.py
• surfsense_backend/app/agents/researcher/configuration.py
• surfsense_backend/app/agents/researcher/prompts.py
• surfsense_backend/app/agents/researcher/qna_agent/nodes.py
• surfsense_backend/app/agents/researcher/qna_agent/prompts.py
• surfsense_backend/app/agents/researcher/sub_section_writer/prompts.py
• surfsense_backend/app/routes/chats_routes.py
• surfsense_backend/app/routes/llm_config_routes.py
|
Thank you! |
feat: added missed migration
Description
Added missed migration for #390
High-level PR Summary
This PR adds a missed database migration (revision 26) that introduces a
languagecolumn to thellm_configstable with a default value of 'English'. The migration includes both upgrade and downgrade logic with safety checks to prevent duplicate column additions. Additionally, this PR includes code formatting cleanup across multiple files, removing timestamps from previous migration headers and standardizing whitespace and formatting in agent prompt files.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
surfsense_backend/alembic/versions/26_add_language_column_to_llm_configs.pysurfsense_backend/app/routes/llm_config_routes.pysurfsense_backend/app/routes/chats_routes.pysurfsense_backend/app/agents/researcher/configuration.pysurfsense_backend/app/agents/researcher/prompts.pysurfsense_backend/app/agents/researcher/qna_agent/prompts.pysurfsense_backend/app/agents/researcher/sub_section_writer/prompts.pysurfsense_backend/app/agents/researcher/qna_agent/nodes.pysurfsense_backend/alembic/versions/23_associate_connectors_with_search_spaces.pysurfsense_backend/alembic/versions/24_fix_null_chat_types.pysurfsense_backend/alembic/versions/25_migrate_llm_configs_to_search_spaces.pySummary by CodeRabbit
New Features
Bug Fixes
Database
Chores
Style/Refactor