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

@@ -17,6 +17,7 @@ class Settings(BaseSettings):
# 应用基本信息
APP_NAME: str = "天工智能体平台"
APP_VERSION: str = "1.0.0"
ENVIRONMENT: str = "dev" # dev | staging | prod
DEBUG: bool = False
SQL_ECHO: bool = False # 独立于 DEBUG 的 SQL 日志开关,生产环境必须为 False
SECRET_KEY: str = "dev-secret-key-change-in-production"
@@ -52,6 +53,13 @@ class Settings(BaseSettings):
AGENT_WORKSPACE_CHAT_LOG_ENABLED: bool = True
AGENT_WORKSPACE_CHAT_SUBDIR: str = "agent_workspaces"
# 日志配置
LOG_DIR: str = "logs"
LOG_LEVEL: str = "INFO"
LOG_MAX_BYTES: int = 10 * 1024 * 1024 # 10MB 单文件上限
LOG_BACKUP_COUNT: int = 5 # 保留最近5个轮转文件
LOG_RETENTION_DAYS: int = 30 # 数据库日志保留天数
# CORS配置支持字符串或列表
CORS_ORIGINS: str = "http://localhost:3000,http://127.0.0.1:3000,http://localhost:8038,http://101.43.95.130:8038"
@@ -63,6 +71,11 @@ class Settings(BaseSettings):
DEEPSEEK_API_KEY: str = ""
DEEPSEEK_BASE_URL: str = "https://api.deepseek.com"
# 全局 LLM 降级配置(当 Agent/工作流未配置 fallback_llm 时自动启用)
FALLBACK_LLM_MODEL: str = ""
FALLBACK_LLM_API_KEY: str = ""
FALLBACK_LLM_BASE_URL: str = ""
# SiliconFlow配置Embedding 推荐使用 SiliconFlow
SILICONFLOW_API_KEY: str = ""
SILICONFLOW_BASE_URL: str = "https://api.siliconflow.cn/v1"
@@ -75,6 +88,7 @@ class Settings(BaseSettings):
JWT_SECRET_KEY: str = "dev-jwt-secret-key-change-in-production"
JWT_ALGORITHM: str = "HS256"
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
JWT_MOBILE_TOKEN_EXPIRE_MINUTES: int = 10080 # 移动端 7 天Android EncryptedSharedPreferences 安全存储
# Celery 工作流任务:对**非业务节点失败**(非 WorkflowExecutionError的退避重试次数0 表示不重试
WORKFLOW_TASK_MAX_RETRIES: int = 0
@@ -96,6 +110,11 @@ class Settings(BaseSettings):
FEISHU_APP_SECRET: str = ""
FEISHU_VERIFICATION_TOKEN: str = ""
# 安全加固 — HSTS生产环境建议启用开发环境保持关闭
HSTS_ENABLED: bool = False
HSTS_MAX_AGE: int = 31536000 # 默认 1 年
HSTS_INCLUDE_SUBDOMAINS: bool = True
# Webhook 全局认证 Token — 所有 webhook 触发请求需要携带此 Token
WEBHOOK_AUTH_TOKEN: str = ""