[Feat] Multi-suggestion autocomplete, Vision LLM config & Desktop analytics#1162
Conversation
|
@CREDO23 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 00ee797..4dd1b6c
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (48)
• .github/workflows/desktop-release.yml
• surfsense_backend/app/agents/autocomplete/autocomplete_agent.py
• surfsense_backend/app/app.py
• surfsense_backend/app/celery_app.py
• surfsense_backend/app/config/__init__.py
• surfsense_backend/app/config/global_llm_config.example.yaml
• surfsense_backend/app/db.py
• surfsense_backend/app/routes/__init__.py
• surfsense_backend/app/routes/search_spaces_routes.py
• surfsense_backend/app/routes/vision_llm_routes.py
• surfsense_backend/app/schemas/__init__.py
• surfsense_backend/app/schemas/new_llm_config.py
• surfsense_backend/app/schemas/vision_llm.py
• surfsense_backend/app/services/llm_service.py
• surfsense_backend/app/services/vision_llm_router_service.py
• surfsense_desktop/.env
• surfsense_desktop/package.json
• surfsense_desktop/pnpm-lock.yaml
• surfsense_desktop/scripts/build-electron.mjs
• surfsense_desktop/src/main.ts
• surfsense_desktop/src/modules/analytics.ts
• surfsense_desktop/src/modules/autocomplete/index.ts
• surfsense_desktop/src/modules/quick-ask.ts
• surfsense_web/.env.example
• surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx
• surfsense_web/app/dashboard/[search_space_id]/user-settings/components/DesktopContent.tsx
• surfsense_web/app/desktop/login/page.tsx
• surfsense_web/app/desktop/suggestion/page.tsx
• surfsense_web/app/desktop/suggestion/suggestion.css
• surfsense_web/atoms/vision-llm-config/vision-llm-config-mutation.atoms.ts
• surfsense_web/atoms/vision-llm-config/vision-llm-config-query.atoms.ts
• surfsense_web/components/TokenHandler.tsx
• surfsense_web/components/desktop/shortcut-recorder.tsx
• surfsense_web/components/new-chat/chat-header.tsx
• surfsense_web/components/new-chat/model-selector.tsx
• surfsense_web/components/settings/llm-role-manager.tsx
• surfsense_web/components/settings/search-space-settings-dialog.tsx
• surfsense_web/components/settings/vision-model-manager.tsx
• surfsense_web/components/shared/vision-config-dialog.tsx
• surfsense_web/contracts/enums/vision-providers.ts
• surfsense_web/contracts/types/new-llm-config.types.ts
• surfsense_web/lib/apis/vision-llm-config-api.service.ts
• surfsense_web/lib/query-client/cache-keys.ts
• surfsense_web/messages/en.json
• surfsense_web/messages/es.json
• surfsense_web/messages/hi.json
• surfsense_web/messages/pt.json
• surfsense_web/messages/zh.json
Multi-suggestion autocomplete, dedicated Vision LLM config system, and PostHog analytics for the desktop app.
Description
POSTHOG_KEYis empty. Uses anonymous machine ID — no PII.API Changes
New endpoints:
GET /api/v1/global-vision-llm-configsPOST/GET/PUT/DELETE /api/v1/vision-llm-configsvision_llm_id→vision_llm_config_idin LLM preferencesChange Type
Testing Performed
Checklist
High-level PR Summary
This PR introduces three major features: multi-suggestion autocomplete that provides 3 distinct completion options instead of a single one, a dedicated Vision LLM configuration system (separate from chat/agent LLMs) with full CRUD operations, YAML-based global configs, Auto mode routing, and RBAC permissions, and PostHog analytics integration for the desktop app that tracks key user actions (app launch, autocomplete trigger/accept/dismiss, quick assist) using an anonymous machine ID. The Vision LLM system includes database migration, API endpoints, a new settings tab in the UI, and backend routing service. Analytics are disabled when
POSTHOG_KEYis empty and collect no PII.⏱️ Estimated Review Time: 1-3 hours
💡 Review Order Suggestion
surfsense_backend/alembic/versions/120_add_vision_llm_configs_table.pysurfsense_backend/app/db.pysurfsense_backend/app/schemas/vision_llm.pysurfsense_backend/app/services/vision_llm_router_service.pysurfsense_backend/app/routes/vision_llm_routes.pysurfsense_backend/app/config/__init__.pysurfsense_backend/app/config/global_llm_config.example.yamlsurfsense_backend/app/services/llm_service.pysurfsense_backend/app/agents/autocomplete/autocomplete_agent.pysurfsense_backend/app/routes/search_spaces_routes.pysurfsense_backend/app/schemas/new_llm_config.pysurfsense_desktop/src/modules/analytics.tssurfsense_desktop/package.jsonsurfsense_desktop/pnpm-lock.yamlsurfsense_desktop/src/main.tssurfsense_desktop/src/modules/autocomplete/index.tssurfsense_desktop/src/modules/quick-ask.tssurfsense_desktop/.envsurfsense_desktop/scripts/build-electron.mjs.github/workflows/desktop-release.ymlsurfsense_web/app/desktop/suggestion/page.tsxsurfsense_web/app/desktop/suggestion/suggestion.csssurfsense_web/contracts/types/new-llm-config.types.tssurfsense_web/contracts/enums/vision-providers.tssurfsense_web/lib/apis/vision-llm-config-api.service.tssurfsense_web/atoms/vision-llm-config/vision-llm-config-query.atoms.tssurfsense_web/atoms/vision-llm-config/vision-llm-config-mutation.atoms.tssurfsense_web/components/shared/vision-config-dialog.tsxsurfsense_web/components/settings/vision-model-manager.tsxsurfsense_web/components/settings/llm-role-manager.tsxsurfsense_web/components/settings/search-space-settings-dialog.tsxsurfsense_web/components/new-chat/model-selector.tsxsurfsense_web/components/new-chat/chat-header.tsxsurfsense_web/lib/query-client/cache-keys.tssurfsense_web/messages/en.jsonsurfsense_web/messages/es.jsonsurfsense_web/messages/hi.jsonsurfsense_web/messages/pt.jsonsurfsense_web/messages/zh.jsonsurfsense_backend/app/routes/__init__.pysurfsense_backend/app/schemas/__init__.pysurfsense_backend/app/app.pysurfsense_backend/app/celery_app.pysurfsense_web/.env.examplesurfsense_web/components/TokenHandler.tsxsurfsense_web/components/desktop/shortcut-recorder.tsxsurfsense_web/app/dashboard/[search_space_id]/client-layout.tsxsurfsense_web/app/dashboard/[search_space_id]/user-settings/components/DesktopContent.tsxsurfsense_web/app/desktop/login/page.tsx