feat: complete multimodal ticket intake
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user