Commit Graph

414 Commits

Author SHA1 Message Date
Agent Zero 1d3b7a497b Fix: Suchfeld Höhe reduziert, Roboter-Symbol aus TopBar entfernt (nicht Sidebar!), Sidebar-Eintrag wiederhergestellt, Lösch-Buttons funktionsfähig mit State, Badge-Zahl dynamisch 2026-07-19 23:50:37 +02:00
Agent Zero d1a40c18e6 UI: schmaleres Suchfeld, KI-Symbol aus Sidebar entfernt, Lösch-Button bei Benachrichtigungen, KI Sidebar per Drag verstellbar (handleSide=left) 2026-07-19 23:16:22 +02:00
Agent Zero caaf239aa9 Fix alembic down_revision to match actual revision ID (0020 not 0020_notifications_updated_at) 2026-07-19 21:38:48 +02:00
Agent Zero c670846cbd Update unified search providers for unified contacts model (company queries contacts with type=company) 2026-07-19 21:32:24 +02:00
Agent Zero 3177daf47f Frontend: unified 3-column contacts page (folder tree | list/table/cards | detail), all Rentman fields, ContactPerson CRUD, removed old Contact/Company pages 2026-07-19 21:30:26 +02:00
Agent Zero cf75680583 Unified contacts model: Rentman-style type field (company/person), inline addresses, ContactPerson 1:N, all Rentman fields except rental-specific 2026-07-19 21:12:49 +02:00
Agent Zero d80feb2a3a fix: register search providers in ARQ worker on_startup 2026-07-19 19:55:14 +02:00
Agent Zero f1be1d280b fix: ARQ worker use direct function references instead of dotted paths 2026-07-19 19:46:05 +02:00
Agent Zero 7970495918 fix: ARQ worker functions must be dotted module paths not objects 2026-07-19 19:39:41 +02:00
Agent Zero f1f3ce26b3 feat: add ARQ background worker to container
- Create app/core/worker.py with WorkerSettings for ARQ
- Register all job functions: reindex, index_*, embedding_batch, deep_analysis
- Update prestart.sh to start ARQ worker in background before uvicorn
- Worker runs with max_jobs=10, job_timeout=300s
2026-07-19 19:36:48 +02:00
Agent Zero dc24c37c19 feat: use OpenRouter for embeddings with text-embedding-3-small (768 dims)
- Ollama Cloud has no embedding endpoint, OpenRouter does
- text-embedding-3-small with dimensions=768 matches DB vector(768) column
- API_KEY_OPENROUTER env var is primary, DB provider is fallback
- Added dimensions parameter for text-embedding-3 models
2026-07-19 19:21:49 +02:00
Agent Zero 6f1655785e fix: resolve all 12 TypeScript errors (tsc --noEmit clean)
- mail.ts: add explicit types to decodeMimeHeader callback params
- SessionList.tsx: use React.MouseEvent instead of nativeEvent
- ComposeModal.tsx: construct name from first_name + last_name
- MailDetail.tsx: destructure onReply/onForward from props
- RichTextEditor.tsx: use SetContentOptions object instead of boolean
- MailSearchBar.tsx: add optional value prop to interface
- EmptyState.tsx: add optional children prop
- Badge.tsx: add secondary variant to BadgeVariant, variantClasses, dotColors
- ConfirmDialog.tsx: add optional children prop
- hooks.ts: extend SearchResult type to include mail/file/event
2026-07-19 17:41:39 +02:00
Agent Zero 27a8ad8b30 fix: resolve all 65 pre-existing frontend test failures (318/318 passing)
- Remove duplicate vi.mock(@/api/hooks) in SettingsRoles.test.tsx that overrode forceUpdate logic
- SettingsRoles mock: use vi.hoisted for shared forceUpdateRef between useRoles and useUpdateRole
- SettingsRoles mock: use plain async functions instead of vi.fn().mockImplementation for mutations
2026-07-19 14:41:38 +02:00
Agent Zero 5db7364071 fix: increase max_tokens for LLM suggestions to prevent truncated JSON 2026-07-19 02:32:39 +02:00
Agent Zero 5c3fc027bc fix: strip markdown code fences from LLM responses before json.loads
- glm-5.2 returns JSON wrapped in ```json ... ``` code fences
- Added fence stripping in services.py, query_understanding.py, jobs.py
2026-07-19 02:30:07 +02:00
Agent Zero 6ed0752536 fix: health check worker uses zcard instead of llen for arq sorted set queue 2026-07-19 02:25:42 +02:00
Agent Zero 4a43745b50 fix: unified_search + ai_proactive get API key from DB, fix model names for Ollama Cloud
- query_understanding.py: get API key/base_url/provider_type from ai_providers DB
- embedding.py: get API key from DB, pass db+tenant_id through call chain
- routes.py: pass db+tenant_id to llm_analyze_query and llm_aggregate_results
- search_engine.py: pass db+tenant_id to generate_embedding
- unified_search/jobs.py: pass db+tenant_id to generate_embedding
- Fix all default model names: ollama/deepseek-v4 -> ollama/deepseek-v4-flash
- Ollama Cloud has no embedding endpoint; embedding calls fail gracefully
2026-07-19 02:22:25 +02:00
Agent Zero ef4f0cc494 fix: use provider_type for model prefix and base_url for Ollama Cloud
- _get_llm_api_key now returns provider_type
- Model string built with provider_type prefix (openai/deepseek-v4 instead of ollama/deepseek-v4)
- api_base set from provider.base_url (https://ollama.com/v1)
- Fixes: litellm tried localhost:11434 instead of Ollama Cloud
2026-07-19 01:51:14 +02:00
Agent Zero 7f8344bc24 fix: get LLM API key from DB instead of env var
- ai_proactive now reads API key from ai_providers table (like ai_assistant)
- Falls back to API_KEY_OLLAMA_CLOUD env var if no provider found
- Fixes: proactive engine could not generate suggestions because API key was empty
2026-07-19 01:36:16 +02:00
Agent Zero 5d9ddbebd2 fix: remove tenant switcher from TopBar, fix aiProactive API double-prefix
- Remove tenant switcher dropdown from TopBar (cleanup unused vars/imports)
- Fix aiProactive.ts: remove /api/v1 prefix from apiClient calls (baseURL already includes it)
- This fixes 404 errors on /api/v1/api/v1/ai-proactive/suggestions
2026-07-19 00:28:11 +02:00
Agent Zero ef6d011e16 ui: adjust toolbar heights and icon sizes, remove duplicate AI icon
- TopBar: h-16 → h-[58px] (10% lower), icons w-5 → w-4
- PluginToolbar: min-h-[36px] → min-h-[43px] (20% higher), icons w-3.5 → w-4
- Remove duplicate AI computer icon from TopBar (AISidebar collapsed icon remains)
- Clean up unused imports (toggleAISidebar, aiSidebarCollapsed)
2026-07-19 00:09:17 +02:00
Agent Zero ad41771b10 feat: implement sliding session - extend TTL on each authenticated request 2026-07-18 18:48:21 +02:00
Agent Zero b1153e0c54 fix: add updated_at columns to ai_proactive migration
- ai_proactive_suggestions: add updated_at TIMESTAMPTZ
- ai_proactive_context_log: add updated_at TIMESTAMPTZ

TenantMixin inherits TimestampMixin which expects both created_at and updated_at.
Missing updated_at caused 500 errors on /ai-proactive/context POST.
2026-07-18 18:22:16 +02:00
Agent Zero 7e53b747c7 feat: add Proaktiv and KI Chat tabs to AI sidebar 2026-07-18 17:48:09 +02:00
Agent Zero df82796023 fix: add deleted_at columns to ai_proactive migration
- ai_proactive_suggestions: add deleted_at TIMESTAMPTZ
- ai_proactive_context_log: add deleted_at TIMESTAMPTZ
- ai_proactive_settings: add deleted_at TIMESTAMPTZ

ORM models expect deleted_at for soft-delete support.
2026-07-18 16:18:45 +02:00
Agent Zero 185d4cfe8d test: erweitere Tests auf 103 (65 unified_search + 38 ai_proactive)
- Embedding Pipeline Tests (7)
- Query Understanding Tests (6)
- Search Engine Tests (4)
- Jobs Tests (5)
- Provider-spezifische Tests (12)
- API Tests (3)
- Context Tools Tests (7)
- Proactive Engine Tests (10)
- API Tests (6)
- Jobs Tests (1)
- Plugin Lifecycle Tests (3)

Alle 103 Tests bestanden.
2026-07-18 13:48:20 +02:00
Agent Zero 6f9253809a fix: unified_search test fixes - CSRF token + is_system_admin + 403/401 handling
- search_authed_client fixture: grant is_system_admin + capture CSRF token
- test_ac3: accept 403 (CSRF blocks before auth) instead of 401 only
- All 36 tests now passing (25 unified_search + 11 ai_proactive)
2026-07-18 13:24:34 +02:00
Agent Zero 8cebb4f4e9 feat: unified_search + ai_proactive plugins with Ollama Cloud DeepSeek V4
- unified_search: Hybride Suche (PostgreSQL FTS + pgvector + RRF Fusion)
  - 5 Search Providers (Contact, Company, Mail, File, Event)
  - KI Query Understanding (Fuzzy, Facetten via LiteLLM)
  - DMS Text-Extraction (PDF, DOCX, XLSX, PPTX)
  - Embedding Pipeline (ollama/nomic-embed-text, 768 Dim)
  - Background Jobs für Indexierung
  - Plugin-basierte Provider Registry

- ai_proactive: Proaktiver KI-Agent
  - Context-Tracking (Frontend → Backend → Event Bus)
  - Proactive Engine mit LLM Suggestion-Generierung
  - SSE Real-time Push an Frontend
  - 6 AI Tools für Tool Registry
  - Rate-Limiting + User Settings
  - Deep Analysis Background Jobs

- Frontend Integration:
  - useAIContext Hook, SuggestionSidebar, SuggestionBadge
  - ProactiveAISettings Page, Search API Client
  - Globale Suche auf neue API umgestellt

- Tests: test_unified_search.py + test_ai_proactive.py (alle bestanden)
- Config: Ollama Cloud DeepSeek V4 als Default, konfigurierbar
- Dependencies: PyMuPDF, python-docx, python-pptx, pgvector
- Bugfixes: notification type_key length, migration IF NOT EXISTS
2026-07-18 11:21:51 +02:00
Agent Zero 4c9295de21 feat: AI sidebar mobile full-width overlay with back button
- Mobile: expanded sidebar is fixed inset-0 full-screen overlay with back button
- Mobile: collapsed icon strip hidden (no space on mobile)
- Desktop: unchanged resizable panel + collapsed icon strip
2026-07-18 01:51:01 +02:00
Agent Zero 88be33879c feat: AI sidebar full height with collapsed icon strip and drag resize
- AISidebar: full height, right of TopBar and Toolbar (all pages except AI Assistant)
- AISidebar: collapsed mode shows narrow 48px icon strip with KI button
- AISidebar: expanded mode uses ResizablePanel with drag-to-resize (240-600px)
- AppShell: moved AISidebar outside inner content container to full-height flex
- uiStore: renamed aiSidebarOpen→aiSidebarCollapsed (default: true=collapsed)
- TopBar: AI button highlights when sidebar is expanded
2026-07-18 00:53:00 +02:00
Agent Zero d029892d27 fix: tighter folder tree, smaller mail list font, smooth resize via DOM ref
- MailFolderTree: reduce padding/gap ~25% (py-2→py-1, gap-2→gap-1.5)
- MailList: text-sm→text-xs for from and subject lines
- ResizablePanel: use DOM ref for width during drag instead of React state
  - No re-renders during drag, only single setWidth on mouseup
  - panelRef on outer div, contentRef on inner div
  - pointer-events:none on content during drag
  - contain:strict on content area
2026-07-17 23:49:19 +02:00
Agent Zero db433e81f1 feat: mail UI improvements - folder mapping, display name, resize perf, list header
- Add configurable folder mapping (sent/drafts/spam/trash) per account
- Migration 0005_folder_mapping.sql with 4 new columns on mail_accounts
- Backend: send_mail uses account.sent_folder_imap_name if set
- Backend: _build_folder_hierarchy respects folder_mapping for is_standard
- Frontend: MailSettings shows folder mapping editor per account
- Frontend: MailSettings allows editing display_name for existing accounts
- Frontend: MailFolderTree shows display_name || email, removes MailIcon
- Frontend: ResizablePanel isDragging state with contain:strict + pointer-events:none
- Frontend: MailList merges select-all and sort controls into one line
2026-07-17 23:17:52 +02:00
Agent Zero 04c419402b fix: increase MAX_EMAILS_PER_FOLDER to 2000 for complete sync 2026-07-17 23:02:53 +02:00
Agent Zero 153e7f0d23 fix: increase MAX_EMAILS_PER_FOLDER from 50 to 500 for full sync 2026-07-17 23:00:22 +02:00
Agent Zero c6364d40e6 fix: mail sync duplicates, sent folder, delimiter detection, folder move tracking
- Add imap_uid column + unique index for proper deduplication
- Use deterministic message_id for emails without Message-ID header
- Dedup by (account_id, folder_id, imap_uid) first, message_id fallback
- Track folder moves: update folder_id when email appears in different folder
- Fix Sent folder lookup: check Sent/INBOX.Sent/Sent Items/Sent Mail + ILIKE
- Detect IMAP delimiter from LIST response instead of hardcoding dot
- Use detected delimiter in stale folder name migration
- Migration 0004_imap_uid.sql with imap_uid column and unique index
2026-07-17 22:50:02 +02:00
Agent Zero 60081c5262 fix: add onDelete to TreeItem destructured props 2026-07-17 22:30:47 +02:00
Agent Zero 4f23c60fd4 feat: hover rename/delete icons in treeview, resizable tree and sidebar panels 2026-07-17 22:24:26 +02:00
Agent Zero 3fc4dcdb96 fix: add folder_id and sort_order to AIChatSession model, fix UUID conversion in routes, add migration 0003 2026-07-17 21:20:49 +02:00
Agent Zero 165350eda0 fix: user messages with primary-50 background and border for visual distinction 2026-07-17 21:05:47 +02:00
Agent Zero b137acb359 fix: custom markdown CSS styles for AI chat responses (tables, code, lists, headings) 2026-07-17 19:36:21 +02:00
Agent Zero 495d9c63ff fix: proper drag&drop with dataTransfer, context menu (rename/delete/new), bold active session 2026-07-17 17:59:18 +02:00
Agent Zero 5814b1691c fix: drag&drop events on folder headers with stopPropagation, separate root drop zone 2026-07-17 17:39:09 +02:00
Agent Zero ede37aced8 feat: remove header and buttons, move actions to toolbar, drag&drop to any folder level 2026-07-17 17:22:26 +02:00
Agent Zero f2d624720f feat: drag&drop treeview, flat chat UI, activity indicator, fixed toolbar registration 2026-07-17 17:09:26 +02:00
Agent Zero 70b8a66fd4 feat: attachment context for LLM, markdown rendering, mobile layout with back arrow 2026-07-17 13:45:21 +02:00
Agent Zero 202d80c750 feat: treeview with folders, toolbar, file attachments in chat 2026-07-17 09:21:40 +02:00
Agent Zero 9a29206190 feat: chat folders, attachments, treeview backend - migration, models, routes 2026-07-17 09:15:39 +02:00
Agent Zero 50650f5b17 fix: always add provider prefix to litellm model string 2026-07-17 01:48:08 +02:00
Agent Zero da8d0ce818 fix: add CSRF token to streaming fetch request 2026-07-17 01:43:52 +02:00
Agent Zero 561d1919f5 fix: add deleted_at columns to AI Assistant migration SQL 2026-07-17 01:08:13 +02:00