feat(agent): support new Agent DSL import and export (#38849)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
zyssyz123
2026-07-15 02:02:14 +00:00
committed by GitHub
co-authored by autofix-ci[bot]
parent 38aec8b506
commit f86bfb2a31
40 changed files with 5477 additions and 143 deletions
+8 -1
View File
@@ -51,6 +51,7 @@ from core.workflow.file_reference import build_file_reference, is_canonical_file
from extensions.ext_database import db
from models import Account, App, EndUser, Message
from models.agent import (
APP_BACKED_AGENT_SOURCES,
Agent,
AgentConfigDraft,
AgentConfigDraftType,
@@ -580,7 +581,7 @@ class AgentAppGenerator(MessageBasedAppGenerator):
and_(
Agent.app_id == app_model.id,
Agent.scope == AgentScope.ROSTER,
Agent.source == AgentSource.AGENT_APP,
Agent.source.in_(APP_BACKED_AGENT_SOURCES),
),
Agent.backing_app_id == app_model.id,
),
@@ -590,6 +591,12 @@ class AgentAppGenerator(MessageBasedAppGenerator):
)
if agent is None:
raise AgentAppGeneratorError("Agent App has no bound Agent")
if (
agent.source == AgentSource.IMPORTED
and not agent.active_config_is_published
and invoke_from != InvokeFrom.DEBUGGER
):
raise AgentAppNotPublishedError("Agent has not been published")
if invoke_from == InvokeFrom.DEBUGGER:
draft = self._resolve_debug_draft(
tenant_id=app_model.tenant_id,