Commit Graph

7 Commits

Author SHA1 Message Date
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