Commit Graph

17 Commits

Author SHA1 Message Date
3483c6b3be fix: update TTS voice mapping to only use valid Edge TTS voices
Previously the voice map referenced 10+ non-existent Edge TTS voice names
(xiaohan, xiaochen, xiaoshuang, etc.), causing NoAudioReceived errors and
fallback to browser default TTS. Now only maps to the 6 actually available
Chinese voices (xiaoxiao, xiaoyi, yunxi, yunyang, yunjian, yunxia).
Added voice speed adjustments and fixed --rate argument format for Windows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-04 17:06:51 +08:00
fbf8dbbe86 fix: Android null-safety Gson crash + AgentChat full UX overhaul (Round 1-4)
Android:
- Add NullSafeStringAdapter to GsonBuilder globally to prevent null String injection into non-nullable Kotlin fields
- Add defensive null-safe mappings in AgentRepository and all UI Text() calls

Frontend AgentChat (4 rounds):
- Round 1: Stop generation button, server-side session history sync, smart scroll
- Round 2: Full markdown rendering (marked), file/image upload with drag-drop, message edit/delete
- Round 3: TTS speech (browser SpeechSynthesis), voice input (SpeechRecognition), empty state guidance, model/temperature selector
- Round 4: Extract shared chat core — useMarkdown, useFileUpload, ChatMessageBubble, ChatInputArea modules — merge AgentChat.vue and AgentChatPreview.vue divergent code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-04 14:45:55 +08:00
876789fac1 feat: multi-tenant workspace isolation, RBAC, sidebar nav, billing, and Android enhancements
- Backend: workspace_id isolation for 14 model tables + safe migration/backfill
- Backend: RBAC system with 4 roles and 23 permissions, seeded on startup
- Backend: workspace admin endpoints (list/manage all workspaces)
- Backend: admin user management API (CRUD, reset password)
- Backend: billing API with subscription plans, usage tracking, rate limiting
- Backend: fix system_logs.py UNION query and wrong column references
- Backend: WebSocket JWT auth and workspace enforcement
- Frontend: sidebar navigation replacing top dropdown menu
- Frontend: user management page (Users.vue) for admins
- Frontend: enhanced Workspaces.vue with admin table view
- Frontend: workspace RBAC computed properties in user store
- Android: agent marketplace, billing/subscription UI, onboarding wizard
- Android: phone login, analytics tracker, crash handler, network diagnostics
- Android: splash screen, encrypted token storage, app update enhancements
- Docs: multi-tenant RBAC guide with 8 sections and role-permission matrix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-04 01:00:22 +08:00
7e192d25c8 feat: add customer service agent entry in Settings
- "天工客服" agent (ID: 3490efa8) created on backend, status: published
- Settings > Account section now has "联系客服" button
- Tap navigates to chat with the CS agent directly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 23:14:13 +08:00
92ae0b5e46 feat: add manual 'Check Update' button in Settings > About section
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 22:30:25 +08:00
029abaa60c feat: add Account Security screen (change password, bind phone, delete account)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 22:28:31 +08:00
50de6f3dee fix: replace deprecated MediaType.parse() with toMediaType() extension
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 22:25:33 +08:00
21a06e8664 feat: complete P0-2 Token Refresh, P0-4 Android ProGuard, P0-5 App Update
- P0-2: Refresh token with Redis storage (UUID tokens, 30-day TTL, rotation on refresh)
- P0-2: Backend POST /auth/refresh and /auth/revoke endpoints
- P0-2: Android AuthInterceptor refresh-before-re-login flow
- P0-2: AuthRepository saves refresh_token on login, revokes on logout
- P0-4: Enable R8 minification (isMinifyEnabled=true) with comprehensive keep rules
- P0-5: Backend GET /api/v1/app/check-update with force_update support
- P0-5: Android AppUpdateManager with force/optional update dialogs on startup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 22:20:47 +08:00
3dcf769660 feat: Android login/register add mandatory agreement checkbox
- LoginScreen: add agreement checkbox, disabled until checked
- RegisterScreen: add agreement checkbox, disabled until checked
- RegisterViewModel: pass agreed_terms/agreed_terms_version to API
- RegisterRequest DTO: add agreedTerms/agreedTermsVersion fields
- Also include 3 template scripts missed in previous commit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 22:06:16 +08:00
96394c4b9f fix: duplicate messages on scroll-to-top in chat
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled
Three root causes fixed:
- Room Flow observer overwrote deduplicated list during loadMoreHistory()
  → Added isLoadingHistory flag to suppress Flow updates while loading
- beforeId used local IDs (user_/asst_ prefix) that server couldn't resolve,
  causing server to return ALL messages → Find oldest server-UUID message as cursor
- Scroll-to-top LaunchedEffect could double-fire → Added 800ms throttle

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 20:56:32 +08:00
f1326bff95 fix: memory scope_id column overflow and API read mismatch
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled
AgentRuntime writes scope_id as {user_id}:{agent_id} (73 chars) but:
- DB columns were CHAR(36)/VARCHAR(36), causing Data too long errors
- Memory API queried with agent_id only, returning empty results

- Add _mem_scope() helper to build correct scope_id format
- Update all CRUD queries in agent_memory.py to use _mem_scope()
- Enhance login failure logging in auth.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 08:05:23 +08:00
e33aa6e0b7 fix: message ordering and duplicate messages
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled
Backend:
- Composite ORDER BY (created_at DESC, iteration ASC, id ASC) to fix
  non-deterministic ordering when multiple messages share same second
- Composite key cursor pagination to avoid missing messages at boundary

Android:
- Fix message duplication: guard loadMoreHistory from firing before
  initial scroll completes (isAtTop race → fetchOlderMessages →
  cacheMessagesFromApi with different IDs → Room duplicates)
- Add distinctBy(id) at all message assignment points in ViewModel
- cacheMessagesFromApi: skip insert if same ID or same content exists
- Add relative timestamp display on message bubbles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-30 22:09:03 +08:00
cffe4a52d6 feat: agent memory management — CRUD API + Android management screen
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled
Backend:
- New /api/v1/agents/{id}/memory endpoints: CRUD for global_knowledge,
  knowledge_entities, learning_patterns, vector_memories + import/export
- Fix scope_id column overflow: 3 model columns expanded to hold compound
  keys (user_id:agent_id format, 73 chars vs old VARCHAR(36))
- Config: allow unknown env vars (extra="ignore") for optional overrides

Android:
- MemoryManageScreen: 4-tab UI (全局知识/知识实体/学习模式/对话记忆)
  with search, delete, and FAB to add new entries
- Import/export via ShareSheet and file picker
- AgentListScreen: long-press dropdown menu → 记忆管理 entry point
- NavGraph: memory_manage/{agentId}/{agentName} route with URL encoding

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-30 02:23:45 +08:00
43d5347458 feat: add 200 character limit with counter to chat input field
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-30 00:35:08 +08:00
971f0c33a9 fix: increase chat input maxLines from 4 to 8 for better long-text editing
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-30 00:33:46 +08:00
a06082480a feat: persistent chat message storage + Android pull-to-load history
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled
Backend:
- Add ChatMessage model + Alembic migration 024
- Add on_message callback to AgentRuntime for persisting messages during SSE streaming
- Plumb session_id from ChatRequest to AgentContext in all 4 chat endpoints
- Add GET /agent-chat/{id}/sessions and /sessions/{sid}/messages with cursor pagination

Android:
- Add DTOs/ApiService/MessageDao for server-side chat history
- ChatRepository: fetchOlderMessages (API + Room cache), offline fallback
- ChatViewModel: loadMoreHistory with isLoadingMore/hasMoreMessages state
- ChatScreen: scroll-to-top detection + top loading indicator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-30 00:07:26 +08:00
beff3fac8d fix: delete agent 500 error + dynamic personality + deployment guide
- Fix delete agent 500: clean up FK records (agent_llm_logs, permissions,
  schedules, executions, team_members) and unbind goals/tasks before delete
- Remove hardcoded personality templates in Android, replace with dynamic
  system prompt generation from name + description
- Set promptSectionsEnabled=false to bypass PromptComposer for personality
- Add Tencent Cloud Linux deployment guide (Docker Compose)
- Accumulated backend service updates, frontend UI fixes, Android app changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-29 01:17:21 +08:00