Merge branch 'main' into feat/memory-orchestration-be

This commit is contained in:
Stream
2025-08-25 14:54:14 +08:00
566 changed files with 14876 additions and 4377 deletions

View File

@ -2,7 +2,7 @@ from datetime import datetime
from typing import Optional
import sqlalchemy as sa
from celery import states # type: ignore
from celery import states
from sqlalchemy import DateTime, String
from sqlalchemy.orm import Mapped, mapped_column

View File

@ -8,7 +8,6 @@ from typing import TYPE_CHECKING, Any, Optional, Union
from uuid import uuid4
import sqlalchemy as sa
from flask_login import current_user
from sqlalchemy import DateTime, orm
from core.file.constants import maybe_file_object
@ -24,7 +23,6 @@ from core.workflow.constants import (
from core.workflow.nodes.enums import NodeType
from factories.variable_factory import TypeMismatchError, build_segment_with_type
from libs.datetime_utils import naive_utc_now
from libs.helper import extract_tenant_id
from ._workflow_exc import NodeNotFoundError, WorkflowDataError
@ -357,8 +355,8 @@ class Workflow(Base):
if self._environment_variables is None:
self._environment_variables = "{}"
# Get tenant_id from current_user (Account or EndUser)
tenant_id = extract_tenant_id(current_user)
# Use workflow.tenant_id to avoid relying on request user in background threads
tenant_id = self.tenant_id
if not tenant_id:
return []
@ -388,8 +386,8 @@ class Workflow(Base):
self._environment_variables = "{}"
return
# Get tenant_id from current_user (Account or EndUser)
tenant_id = extract_tenant_id(current_user)
# Use workflow.tenant_id to avoid relying on request user in background threads
tenant_id = self.tenant_id
if not tenant_id:
self._environment_variables = "{}"