Agent Zero
2c9e74776e
feat(5.21): Tasks Plugin — activities with status, priority, due dates, ARQ reminders
...
- New builtin plugin app/plugins/builtins/tasks/ with full CRUD
- Task model with TenantMixin (title, description, status, priority, due_date, assigned_to, contact_id)
- Routes: GET/POST /tasks, GET/PATCH/DELETE /tasks/{id}, POST /tasks/{id}/assign, POST /tasks/{id}/status
- All routes RBAC-protected (tasks:read, tasks:write, tasks:delete)
- ARQ cron job tasks_due_reminder (daily 8:00) sends notifications for due tasks
- Migration 0001_initial.sql creates tasks table with indexes
- Frontend: Tasks.tsx page with list, filter, create/edit modal, detail modal
- Frontend: api/tasks.ts with React Query hooks
- Route /tasks in routes/index.tsx, sidebar entry via plugin manifest
- i18n keys for nav.tasks and tasks.* in de.json and en.json
- Tests: test_tasks.py (11 tests) + Tasks.test.tsx (3 tests)
- Registered TasksPlugin in conftest.py and worker.py
2026-07-23 23:41:34 +02:00
Agent Zero
bdad91a649
feat(5.20): Custom Fields — plugin-defined fields in Contact UI
...
- Add CustomFieldDefinition to PluginManifest (text/number/date/select/multiselect/boolean)
- Add GET/PATCH /api/v1/contacts/{id}/custom-fields routes
- Merge plugin definitions with stored values in contacts.custom JSONB
- Add CustomFieldRenderer component (read + edit modes)
- Integrate into ContactDetail (read-only) and ContactEditModal (editable)
- Add custom_fields to pluginStore and active manifests API
- Add useCustomFields/useUpdateCustomFields React Query hooks
- Tests: test_custom_fields.py (9 tests) + CustomFieldRenderer.test.tsx (5 tests)
- i18n keys already present (contacts.customFields)
2026-07-23 23:35:35 +02:00
Agent Zero
15f1a57c0f
Phase 5 Batch 5 Task 5.18: Report Generator PDF-Support & Druck-Funktionen
...
- Installed WeasyPrint 69.0 for PDF generation
- Created 5 Jinja2 HTML templates: contact_list, calendar_week, calendar_month, company_list, audit_log
- All templates: A4 landscape, print-optimized CSS (@media print, page margins)
- Extended output_format in schemas.py: added pdf and print
- Created pdf_generator.py: Jinja2 + WeasyPrint pipeline with preset support
- Modified routes.py: PDF/print generation, preset endpoints (/presets, /presets/generate)
- Added RBAC (require_permission) to all report endpoints
- Generate endpoints return StreamingResponse (file download) directly
- 7 backend tests: presets listing, PDF/CSV generation, template CRUD, RBAC
2026-07-23 23:22:33 +02:00
Agent Zero
317d5c81f8
feat: MCP Client plugin (Task 5.17) - integrate external MCP servers for AI agents
...
- New plugin app/plugins/builtins/mcp_client/ with server config CRUD
- Models: McpServerConfig with TenantMixin (name, url, api_token, enabled)
- Routes: GET/POST/PATCH/DELETE /api/v1/mcp-client/servers
- Routes: GET /servers/{id}/tools, POST /servers/{id}/execute
- client.py: async MCP client using httpx for external server calls
- tool_registry_integration.py: registers external MCP tools in AI tool registry
- Migration: 0001_initial.sql for mcp_server_configs table
- Frontend: mcpClient.ts API client with React Query hooks
- Frontend: MCP Client settings UI in SettingsMcp.tsx (server CRUD, tool viewing)
- Tests: 8 tests covering CRUD, auth, tool registry integration
2026-07-23 23:02:07 +02:00
Agent Zero
9d4f701a25
feat: MCP Server plugin (Task 5.16) - expose LeoCRM tools to external AI clients
...
- New plugin app/plugins/builtins/mcp_server/ with 9 MCP tools
- Tools: search_contacts, get_contact, create_contact, list_calendar_entries,
create_calendar_entry, list_emails, send_email, list_files, upload_file
- Routes: GET /api/v1/mcp/tools, POST /api/v1/mcp/tools/{name}/execute, GET /api/v1/mcp/config
- API-token auth via session + RBAC (mcp:read, mcp:write)
- Frontend: mcp.ts API client with React Query hooks
- Frontend: SettingsMcp.tsx settings page with tool listing and execution
- i18n: de.json and en.json updated with MCP entries
- Tests: 7 tests covering tool listing, config, execution, auth, schema validation
2026-07-23 23:01:59 +02:00
Agent Zero
9cfc6bf3b0
Phase 5.15: Automated backup system with pg_dump, file backup, retention, restore, notifications
2026-07-23 22:48:19 +02:00
Agent Zero
66b6c32ed8
Phase 5.14: API documentation - OpenAPI tags, response models, examples, docs
2026-07-23 22:44:54 +02:00
Agent Zero
903d649a0f
Phase 4: KI-UI-Steuerung — AI agent UI control via WebSocket
...
- New ai_ui_control plugin: WS endpoint /ws/ai-ui-control, REST API (POST /command, GET /command/{id}/status, GET /online-users)
- UI-Command-Protocol: 6 command types (navigate, filter, open_contact, modal, tab, settings) with Pydantic schemas
- WebSocket manager: per-user connections, command delivery, feedback storage, stale cleanup
- Frontend useAIUIControl hook: WS client with auto-reconnect, command dispatch, feedback sending
- aiUIControlStore: Zustand store for command state, active modal/tab, pending filter/settings
- AIUIControlIndicator: visual KI indication (Bot icon, toast, pulse animation)
- ContactDetail integration: syncs activeTab and personModalOpen from AI control store
- AppShell integration: useAIUIControl hook + AIUIControlIndicator
- i18n keys for DE/EN
- 18 Vitest tests: command protocol, store actions, feedback, visual indication
- TSC: 0 new errors (only 2 pre-existing Dms.tsx errors)
2026-07-23 20:13:39 +02:00
Agent Zero
5dc6f29ac1
Phase 3.5: Automation & Agents Plugin
...
Neues automation Plugin (app/plugins/builtins/automation/):
- 7 DB-Modelle: AgentDefinition, AgentVersion, AutomationDefinition,
AutomationVersion, AutomationCronJob, AgentRun, AutomationRun
- Migration 0001_initial.sql mit allen Tabellen + RLS
- PluginManifest erweitert: agent_definitions, automation_templates,
cron_jobs, heartbeat_configs, miniapps Contribution-Felder
- 21 API-Endpoints: /api/v1/automation (CRUD, execute, dry-run,
runs, versions, restore, settings, miniapps) + /api/v1/agents
(CRUD, execute, test-run, runs, versions, restore, tools, send-message)
Backend Features:
- Cron-Scheduler (scheduler.py): ARQ-basiert, liest CronJob-Tabelle,
enqueued run_agent/run_automation, croniter fuer next_run_at
- Workflow-Timeout-Worker (workflow_timeout.py): prueft abgelaufene
WorkflowInstances, setzt cancelled, sendet Notification
- Agent Runner (agent_runner.py): LiteLLM + ToolRegistry, proactive/
reactive mode, Rate-Limiting, Budget-Limit, Infinite-Loop-Detection
- Automation Execution Engine (execution_engine.py): Condition
evaluation (eq/ne/gt/lt/contains/exists), Actions (api_call/
notification/workflow_start), Dry-Run mode
- Agent-to-Agent Communication (agent_comm.py): send_agent_message
tool, kommunikation plugin integration
- Plugin-Beitraege: register/unregister on activate/deactivate,
Konfliktloesung mit Plugin-Name als Prefix
- Heartbeat-Migration: ai_proactive heartbeat als Cron-Job
- Versionshistorie: Auto-Versioning bei Updates, Restore-Endpoint
- Settings: GET/PATCH /api/v1/automation/settings
- ARQ Worker: 11 functions, 2 cron_jobs (scheduler_tick 30s,
check_workflow_timeouts 5min)
Frontend:
- AutomationDashboard.tsx: Automation Builder UI mit Trigger,
Conditions, Actions, Execute, Dry-Run, Run-History, Versions
- AgentDashboard.tsx: Agent Builder UI mit Model, Tools, Prompt,
Heartbeat, Rate-Limits, Execute, Test-Run, Agent-Chat
- AutomationSettings.tsx: Settings + MiniApp-Builder
- automation.ts: 24 React Query Hooks
- automation.ts types: TypeScript Interfaces
- routes/index.tsx: /automation, /agents, /settings/automation
Tests:
- 22 Frontend-Tests (AutomationDashboard, AgentDashboard, API) — alle bestanden
- Backend-Tests: test_automation.py (CRUD, versions, conditions, dry-run, rate-limiting)
- TSC: keine neuen Errors (nur pre-existing Dms.tsx)
- croniter dependency installiert
2026-07-23 20:00:37 +02:00
Agent Zero
fc96a2f86c
Phase 3: Plugin-UI-System (WordPress-Style)
...
Backend:
- PluginManifest um 5 neue UI-Felder erweitert: menu_items, page_routes,
detail_tabs, settings_pages, dashboard_widgets (FrontendMenuItem,
FrontendPageRoute, FrontendDetailTab, FrontendSettingsPage,
FrontendDashboardWidget)
- GET /api/v1/plugins/active-manifests Endpoint liefert UI-Manifeste
aller aktiven Plugins
- Registry.get_active_manifests() + PluginService.get_active_manifests()
- 12 Built-in Plugins mit UI-Manifest-Daten gefuellt (menu_items,
page_routes, detail_tabs, settings_pages)
- Plugin-Install-System: POST /upload (ZIP), POST /install-url (URL)
mit Validierung (Manifest, dangerous imports, SQL migrations)
Frontend:
- pluginStore.ts (Zustand) mit PluginUiManifest Typen + Selektoren
- useActivePluginManifests() React Query Hook
- PluginRegistry.tsx — fetcht Manifeste beim App-Start
- PluginLoader.tsx — dynamisches React.lazy() mit ErrorBoundary
- PluginRouteRenderer.tsx — Catch-all fuer Plugin-Routes
- routes/index.tsx — Catch-all Routes fuer Plugin-Pages + Settings
- Sidebar.tsx — dynamische Plugin Menu-Items mit Grouping + Icons
- Settings.tsx — dynamische Plugin Settings-Pages
- ContactDetail.tsx — dynamische Plugin Detail-Tabs mit Permissions
- AppShell.tsx — PluginRegistry Provider eingebunden
- SettingsPlugins.tsx — Install-UI (ZIP Upload + URL Install)
- plugins.ts — useUploadPlugin() + useInstallPluginFromUrl() Hooks
Docs & Templates:
- docs/plugin-development-guide.md — komplette Entwickler-Doku
- templates/plugin-template/ — Boilerplate mit allen Manifest-Feldern
Tests:
- 34 Vitest-Tests (PluginRegistry, PluginLoader, PluginRouteRenderer,
pluginStore) — alle bestanden
- TSC: keine neuen Errors (nur pre-existing Dms.tsx)
2026-07-23 19:01:18 +02:00
Agent Zero
b15a62bec6
Phase 1A: Remove company routes/services/models/schemas, unify to Contact
...
- Removed: app/routes/companies.py, app/services/company_service.py, app/models/company.py, app/schemas/company.py
- Updated: main.py, routes/__init__.py, models/__init__.py (removed company imports)
- Updated: action_mapper.py (company intents → contact intents, /api/v1/companies → /api/v1/contacts)
- Updated: workflows/engine.py (company.created → contact.created)
- Updated: worker.py (removed index_company)
- Updated: roles.py, permission_registry.py, permissions.py, deps.py (companies: → contacts:)
- Updated: permission_registry.py CORE_FIELD_DEFINITIONS (old field names → unified contact fields)
- Updated: address model/schema/service (entity_type company → contact only)
- Updated: ai_copilot_service.py (_exec_companies removed, _exec_contacts extended)
- Updated: ai_proactive services/jobs/context_tools (Company → Contact, company_contacts → contact_persons)
- Updated: unified_search jobs.py (removed index_company), query_understanding.py
- Updated: calendar/models.py, addresses.py docstrings
- Updated: conftest.py (Company → Contact, removed companies/company_contacts from TRUNCATE)
- Updated: test_unified_search.py (index_company → index_contact)
2026-07-23 17:29:53 +02:00
Agent Zero
879106c4eb
Phase 1C: Frontend unified contact UI
2026-07-23 17:17:32 +02:00
Agent Zero
ec81940178
Phase 0 Complete: Tasks 0.7-0.20
...
- 0.7: UI-Design-Richtlinien (docs/ui-design-guidelines.md, 535 lines)
- 0.8: Theme-Customization Backend (4 theme fields, migration 0023)
- 0.9: Theme-Customization Frontend (SettingsTheme.tsx, themeStore.ts, live preview)
- 0.10: RBAC-Audit (4 plugins secured, 53 routes with require_permission)
- 0.11: LiteLLM-Cleanup (llm_client.py migrated from httpx to litellm)
- 0.12: KI-Agent-Framework docs (plugin-development-guide.md, agent_capabilities field)
- 0.13: Heartbeat configurable (ProactiveSettings, migration 0024, frontend UI)
- 0.14: Unified Search Field-Level RBAC (resolve_permissions + filter_fields_by_permission)
- 0.15: Undo/History-System (EntityHistory model, service, routes, migration 0025, HistoryViewer)
- 0.16: Storage Backend (LocalStorage + S3Storage, DMS/attachments/mail updated)
- 0.17: Import/Export unified Contact fields (firstname, surname, email_1, phone_1)
- 0.18: .gitignore & Config-Cleanup (webui→frontend, python-jose removed, .env untracked)
- 0.19: Mail-Salt Security-Fix (per-account random salt, migration 0026)
- 0.20: AGPL replaced (PyMuPDF→pypdf, OnlyOffice→Collabora, LICENSE + THIRD_PARTY_LICENSES.md)
2026-07-23 08:42:26 +02:00
Agent Zero
c2143eea19
debug: add startup print statements for plugin activation
2026-07-22 02:14:29 +02:00
Agent Zero
5116e79fb6
fix: AIParticipantHandler recognizes plugin rooms (locked_by=ai_assistant) as AI-active
2026-07-22 02:11:34 +02:00
Agent Zero
4a71297a1e
fix: add kommunikation dependency to ai_assistant and ai_proactive for correct load order
2026-07-22 02:04:52 +02:00
Agent Zero
69ef8bb7d9
fix: add __init__.py exports for kommunikation and system_notif plugins for discovery
2026-07-22 01:35:27 +02:00
Agent Zero
cc3ac9a43d
feat: Unified Messaging System — kommunikation plugin, AI/Proactive/System participants, MessageSidebar, Rich Content Renderer
...
Phase 1: Backend plugin kommunikation (13 files, 10 tables, REST API, WebSocket, RBAC, DMS Bridge, Participant Registry, Mini-App Registry, Search Provider)
Phase 2: AI plugins as participants (ai_assistant + ai_proactive dock as participants, heartbeat job)
Phase 3: system_notif plugin (system events → chat messages, pinned System room)
Phase 4: Frontend MessageSidebar (replaces AISidebar, same design, comm API client, WebSocket hook, commStore)
Phase 5: Rich Content Block Renderer (11 components: Markdown, HTML, Image, Audio, Video, File, ActionCard, ContactCard, MiniApp, BlockRenderer)
BasePlugin: added services property + _container in on_activate
2026-07-22 01:22:15 +02:00
Agent Zero
e94e64ba6b
DMS redesign: 3-column explorer layout with toolbar, source tree, file details panel
...
- Add backend endpoints: GET /dms/files, GET /dms/folders/{id}/files
- New SourceTree component: sources (Meine Dateien, Geteilte Ordner, Externe Speicher)
- New FileExplorer component: 5 view modes (list, table, icons-sm/md/lg)
- New FileDetails component: right panel with file metadata and actions
- Rewrite Dms.tsx: PluginToolbar + 3-column ResizablePanel layout
- Update DmsFile type: size_bytes + uploaded_by (backward compat aliases)
- Add 60+ i18n keys for de/en
2026-07-20 17:31:04 +02:00
Agent Zero
e1a9a8e33e
fix: retrieve UID after IMAP APPEND + handle uid=None mails in vanished check
2026-07-20 16:48:41 +02:00
Agent Zero
a2d68e1aca
fix: call imap_delete_mail BEFORE db.delete/folder_id change — IMAP sync was broken
2026-07-20 16:38:26 +02:00
Agent Zero
3a5520b46a
fix: remove all deleted_at/soft-delete from mails — standard mail program logic only
2026-07-20 16:08:05 +02:00
Agent Zero
fb92acb52b
fix: bidirectional sync — check sync queue before restoring deleted mails
...
- If mail has deleted_at and is still on IMAP server:
- Check sync queue for pending delete operation
- If pending delete exists: our IMAP delete failed, keep deleted, retry via queue
- If no pending delete: another program restored the mail, restore in DB
- This enables true bidirectional sync like Thunderbird/Outlook
2026-07-20 14:35:36 +02:00
Agent Zero
452828babe
fix: never restore deleted mails during sync — deleted means deleted
...
- Sync was restoring deleted_at mails when found on IMAP server
- This caused deleted mails to reappear in inbox on every sync
- Now deleted mails are always skipped during sync, never restored
- IMAP delete is retried via sync queue
2026-07-20 14:26:07 +02:00
Agent Zero
4acebe55e5
fix: stop cross-folder message_id dedup — mails were being moved between folders
...
- message_id dedup was searching across ALL folders
- A mail in Trash with same message_id as one in INBOX was found and moved to INBOX
- Now message_id dedup only searches within the SAME folder
- This matches how real mail clients work: same message_id in different folders = separate copies
2026-07-20 14:03:19 +02:00
Agent Zero
1a2f7f3ab6
fix: stop sync from moving Trash mails back to Inbox
...
- When mail is moved to Trash in DB (folder_id=Trash, deleted_at set) but IMAP MOVE fails,
the mail stays in INBOX on the IMAP server
- Previously sync restored deleted_at and moved folder_id back to INBOX
- Now sync only restores if mail is in the SAME folder in DB and IMAP
- If mail is in Trash in DB but INBOX on IMAP, skip it — sync queue will retry the MOVE
2026-07-20 13:56:30 +02:00
Agent Zero
7631698215
fix: restore deleted_at mails when still on IMAP server — sync was permanently hiding mails
...
- When IMAP delete fails, deleted_at stays set but mail remains on IMAP server
- Sync was skipping deleted_at mails, so they stayed permanently hidden
- Now sync restores deleted_at=None when mail is found on IMAP server
- This means: if IMAP delete fails, mail reappears in LeoCRM on next sync
- Only truly deleted mails (removed from IMAP server) stay hidden
2026-07-20 13:46:48 +02:00
Agent Zero
04e0c60222
fix: add deleted_at column to mail_sync_queue — process_sync_queue was crashing
...
- MailSyncQueue inherits TenantMixin which includes SoftDeleteMixin (deleted_at)
- Migration 0007 did not create this column
- process_sync_queue crashed on every auto-sync attempt
- Add migration 0008 to add deleted_at column
- Bump plugin version to 1.3.0
2026-07-20 13:42:30 +02:00
Agent Zero
11c2a0c9af
fix: deleted mails showing in inbox — set deleted_at on move to Trash, show in Trash folder
...
- delete_mail: set deleted_at when moving to Trash (not just folder_id)
- empty_folder: same — set deleted_at when moving to Trash
- list_mails: show soft-deleted mails when viewing Trash folder
- This prevents sync from moving deleted mails back to inbox
- Trash folder shows deleted_at mails, all other folders hide them
2026-07-20 13:26:39 +02:00
Agent Zero
b68accb9a1
fix: IMAP sync overhaul - move to Trash, fix func import, fix count queries
...
- Fix missing func import (imap_sync_folder was crashing silently)
- imap_delete_mail now moves to Trash folder instead of permanent delete
- Add permanent parameter: permanent=True for Trash->delete, False for Inbox->Trash
- delete_mail route: move to Trash if not in Trash, permanent delete if in Trash
- empty_folder: move to Trash or permanent delete if already in Trash
- Add Papierkorb/Trash folder to create_mail_account
- Fix not Mail.is_seen -> Mail.is_seen.is_(False) (SQLAlchemy bug)
- Fix select(text("COUNT(*)")) -> select(func.count()).select_from(Mail)
- process_sync_queue reads permanent flag from payload
2026-07-20 13:17:07 +02:00
Agent Zero
5ded6f7d0b
fix: dedup by message_id in imap_sync_folder — stop deleted mails reappearing from Trash
...
- imap_sync_folder now checks message_id in addition to (folder_id, imap_uid)
- If mail was moved to Trash by IMAP server (new UID, same message_id), it is recognized
- Soft-deleted mails with matching message_id are skipped, not re-created
- Prevents deleted mails from reappearing when IMAP server moves them to Trash
2026-07-20 12:59:19 +02:00
Agent Zero
478ea877f9
fix: stop restoring soft-deleted mails during sync — they stay deleted
...
- Removed restore logic from imap_sync_account and imap_sync_folder
- Soft-deleted mails are now skipped during sync (not touched, not restored)
- This prevents deleted mails from reappearing when they are found on IMAP
- The sync queue handles retrying failed IMAP deletes
2026-07-20 12:40:27 +02:00
Agent Zero
61ab481349
fix: incremental IMAP sync - only fetch new UIDs since last known, like real mail clients
...
- imap_sync_folder now searches only UID > max_known_uid instead of ALL
- First sync gets last 50, subsequent syncs only get new mails
- UI loads cached mails immediately from DB, sync runs in background
- Folder counts updated after sync
2026-07-20 12:12:53 +02:00
Agent Zero
3313047577
feat: live IMAP sync on folder select + 60s auto-sync interval
...
- New imap_sync_folder function: syncs single folder quickly for live use
- New POST /mail/folders/{folder_id}/sync route
- Frontend: syncFolder API + called on every folder selection
- Auto-sync interval reduced from 300s to 60s
- Sent mail IMAP APPEND already uploads full body via msg.as_bytes()
2026-07-20 12:01:16 +02:00
Agent Zero
c24a86bc90
fix: IMAP sync - use imap_uid, add sync queue with retry, restore deleted on sync, upload sent mails
...
- imap_delete_mail: use stored imap_uid instead of Message-ID search, raise on failure
- imap_move_mail: same imap_uid fix, raise on failure
- New MailSyncQueue model + migration 0007 for pending IMAP operations
- delete_mail route: queues failed IMAP delete for retry
- move_mail route: queues failed IMAP move for retry
- process_sync_queue: retries pending delete/move operations in auto-sync loop
- Auto-sync loop: processes sync queue before pulling new mails
- Restore soft-deleted mails if they still exist on IMAP server during sync
- Upload sent mails to IMAP Sent folder via APPEND after SMTP send
- Plugin version bumped to 1.2.0
2026-07-20 11:31:17 +02:00
Agent Zero
9143346824
fix: add flag_type migration to plugin manifest + bump version to trigger migration run
2026-07-20 10:44:52 +02:00
Agent Zero
9da04057b9
feat: mail list font size, remove Termin toolbar, rename Flagge to Markierung with symbol picker
...
- Mail list: title and subject font text-xs -> text-sm
- Remove Termin (create-event) toolbar button
- Rename Flagge -> Markierung with select dropdown (star, flag, bookmark, important, question)
- Backend: add flag_type column to Mail model + migration 0006
- Backend: flag_type in MailFlagsUpdate schema, update_flags route, mail_to_response
- Frontend: flag_type in Mail interface, FlagUpdatePayload, MailList symbol display
2026-07-20 10:39:16 +02:00
Agent Zero
9063093a5a
feat: compact mail folder tree + right-click Ordner leeren
...
- MailFolderTree: compact styling matching AI assistant SessionList (py-1, text-sm, depth*12+8 padding, no space-y)
- Added right-click context menu on folders with "Ordner leeren" entry
- Backend: POST /mail/folders/{folder_id}/empty soft-deletes all mails in folder
- Frontend API: emptyFolder() function added to mail.ts
- Mail.tsx: onFolderEmptied callback reloads mails and folders
2026-07-20 09:25:43 +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
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
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
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
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
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
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
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
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