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>
This commit is contained in:
2026-06-29 01:17:21 +08:00
parent 86b98865e3
commit beff3fac8d
1084 changed files with 117315 additions and 1281 deletions

View File

@@ -1,7 +1,7 @@
"""
任务模型 — Goal 拆解的子任务
"""
from sqlalchemy import Column, String, Text, Integer, DateTime, JSON, Boolean, ForeignKey, func
from sqlalchemy import Column, String, Text, Integer, DateTime, JSON, Boolean, ForeignKey, Index, func
from sqlalchemy.dialects.mysql import CHAR
from sqlalchemy.orm import relationship
from app.core.database import Base
@@ -25,9 +25,13 @@ class Task(Base):
# 任务编排配置
task_config = Column(JSON, comment="编排配置: {orchestration_mode, agents:[], workflow_id, input_data}")
# 依赖关系
# 依赖关系(参考 Claude Code task_system 设计)
parent_task_id = Column(CHAR(36), ForeignKey("tasks.id"), nullable=True, comment="父任务ID")
depends_on = Column(JSON, default=list, comment="前置依赖任务ID列表")
depends_on = Column(JSON, default=list, comment="前置依赖任务ID列表 (blockedBy)")
blocks = Column(JSON, default=list, comment="被此任务阻塞的任务ID列表")
# 认领机制(参考 Claude Code claimTask
owner = Column(String(200), nullable=True, comment="认领此任务的 Agent 标识 (区别于 assigned_agent_id)")
# 执行结果
result = Column(JSON, comment="执行输出结果")
@@ -42,6 +46,7 @@ class Task(Base):
requires_approval = Column(Boolean, default=False, comment="是否需要人工审批")
approver_id = Column(CHAR(36), ForeignKey("users.id"), nullable=True, comment="审批人ID")
approval_status = Column(String(20), comment="审批状态: pending/approved/rejected")
workspace_id = Column(CHAR(36), ForeignKey("workspaces.id"), nullable=True, comment="所属工作区ID")
# 时间
started_at = Column(DateTime, comment="开始时间")