feat(workflow): expose workflow memory enable status in app share config API

This commit is contained in:
Eternity
2026-03-17 18:01:28 +08:00
parent 8ddacb7bc9
commit 3b8a806661
2 changed files with 9 additions and 0 deletions

View File

@@ -661,6 +661,7 @@ async def config_query(
content = {
"app_type": release.app.type,
"variables": workflow_service.get_start_node_variables(release.config),
"memory": workflow_service.is_memory_enable(release.config),
"features": release.config.get("features")
}
elif release.app.type == AppType.AGENT:

View File

@@ -868,6 +868,14 @@ class WorkflowService:
return node.get("config", {}).get("variables", [])
raise BusinessException("workflow config error - start node not found")
@staticmethod
def is_memory_enable(config: dict) -> bool:
nodes = config.get("nodes", [])
for node in nodes:
if node.get("type") in [NodeType.MEMORY_READ, NodeType.MEMORY_WRITE]:
return True
return False
# ==================== 依赖注入函数 ====================