feat: complete multimodal ticket intake

This commit is contained in:
hailin
2026-07-27 18:59:28 +08:00
parent 96452934a3
commit 93065c0a00
39 changed files with 6443 additions and 267 deletions

View File

@@ -6,6 +6,7 @@ from django.conf import settings
from django.utils import timezone
from apps.agents.models import AgentRun
from apps.agents.services import append_run_event
from apps.agents.services import execute_agent_run as execute_agent_run_service
from apps.audit.models import OperationAuditLog
@@ -24,15 +25,24 @@ def execute_agent_run(self, run_id: int) -> None:
run.status = "timed_out"
run.error_code = "run_timeout"
run.error_message = "Agent 运行超过 10 分钟限制"
run.progress_stage = "timed_out"
run.progress_message = "Agent 运行超时"
run.finished_at = timezone.now()
run.save(
update_fields=[
"status",
"error_code",
"error_message",
"progress_stage",
"progress_message",
"finished_at",
]
)
append_run_event(
run,
"timed_out",
{"error_code": "run_timeout", "error_message": run.error_message},
)
OperationAuditLog.objects.create(
user=run.created_by,
module="agents",