优化全能创作

This commit is contained in:
Azmat@qq.com
2026-09-11 19:11:27 +08:00
parent dbcac8a44b
commit 02e5dbfb60
25 changed files with 2398 additions and 462 deletions
+11
View File
@@ -300,6 +300,11 @@ class CreationConversation(TeamOwnedModel):
COMPLETED = "completed", "已完成"
FAILED = "failed", "失败"
class AgentStatus(models.TextChoices):
IDLE = "idle", "空闲"
PLANNING = "planning", "整理方案中"
AWAITING_USER = "awaiting_user", "等待用户"
title = models.CharField(max_length=120, default="未命名创作")
mode = models.CharField(max_length=16, choices=Mode.choices, default=Mode.VIDEO)
preset = models.CharField(max_length=64, blank=True, default="") # "" = 自由创作
@@ -310,6 +315,11 @@ class CreationConversation(TeamOwnedModel):
# 记忆:{summary, artifacts:[{msg_id,asset_id,prompt,kind}], turn_count}
memory = models.JSONField(default=dict, blank=True)
status = models.CharField(max_length=16, choices=Status.choices, default=Status.RUNNING)
# Agent 编排态(与 status=会话生命周期正交)。planning 时整团队只能有一个在途 turn。
agent_status = models.CharField(
max_length=16, choices=AgentStatus.choices, default=AgentStatus.IDLE,
)
agent_started_at = models.DateTimeField(null=True, blank=True)
last_active_at = models.DateTimeField(auto_now_add=True)
is_deleted = models.BooleanField(default=False)
purged_at = models.DateTimeField(null=True, blank=True)
@@ -320,6 +330,7 @@ class CreationConversation(TeamOwnedModel):
models.Index(fields=["team", "-last_active_at"]),
models.Index(fields=["team", "status", "-last_active_at"]),
models.Index(fields=["team", "is_deleted", "purged_at"]),
models.Index(fields=["team", "agent_status"]),
]
def __str__(self) -> str: