From 43ef2395ac6fb3de23e1340a792e4a6277c80371 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 17 Jan 2026 04:27:34 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- api/controllers/console/app/online_user.py | 4 ++-- api/controllers/console/workspace/account.py | 2 +- api/models/comment.py | 6 +++--- api/services/workflow_comment_service.py | 14 ++++++-------- docker/docker-compose.yaml | 1 + 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/api/controllers/console/app/online_user.py b/api/controllers/console/app/online_user.py index d16093f957..8dceaaaec2 100644 --- a/api/controllers/console/app/online_user.py +++ b/api/controllers/console/app/online_user.py @@ -208,10 +208,10 @@ def get_or_set_leader(workflow_id: str, sid: str) -> str: # Fetch again raw_leader = redis_client.get(leader_key) current_leader = raw_leader.decode("utf-8") if isinstance(raw_leader, bytes) else raw_leader - + if current_leader: return current_leader - + # 5. Fallback (extremely rare race where leader expired/deleted right after SETNX failed) # Just return self (or recurse) return sid diff --git a/api/controllers/console/workspace/account.py b/api/controllers/console/workspace/account.py index 40da8e638e..3884d10f41 100644 --- a/api/controllers/console/workspace/account.py +++ b/api/controllers/console/workspace/account.py @@ -260,7 +260,7 @@ class AccountAvatarApi(Resource): avatar_url = file_helpers.get_signed_file_url(args["avatar"]) return {"avatar_url": avatar_url} - + @setup_required @login_required @account_initialization_required diff --git a/api/models/comment.py b/api/models/comment.py index 817e9b5c7f..54489fcd38 100644 --- a/api/models/comment.py +++ b/api/models/comment.py @@ -53,8 +53,8 @@ class WorkflowComment(Base): db.DateTime, nullable=False, server_default=func.current_timestamp(), onupdate=func.current_timestamp() ) resolved: Mapped[bool] = mapped_column(db.Boolean, nullable=False, server_default=db.text("false")) - resolved_at: Mapped[Optional[datetime]] = mapped_column(db.DateTime) - resolved_by: Mapped[Optional[str]] = mapped_column(StringUUID) + resolved_at: Mapped[datetime | None] = mapped_column(db.DateTime) + resolved_by: Mapped[str | None] = mapped_column(StringUUID) # Relationships replies: Mapped[list["WorkflowCommentReply"]] = relationship( @@ -177,7 +177,7 @@ class WorkflowCommentMention(Base): comment_id: Mapped[str] = mapped_column( StringUUID, db.ForeignKey("workflow_comments.id", ondelete="CASCADE"), nullable=False ) - reply_id: Mapped[Optional[str]] = mapped_column( + reply_id: Mapped[str | None] = mapped_column( StringUUID, db.ForeignKey("workflow_comment_replies.id", ondelete="CASCADE"), nullable=True ) mentioned_user_id: Mapped[str] = mapped_column(StringUUID, nullable=False) diff --git a/api/services/workflow_comment_service.py b/api/services/workflow_comment_service.py index c25bfa65e7..9bb9a90fca 100644 --- a/api/services/workflow_comment_service.py +++ b/api/services/workflow_comment_service.py @@ -111,7 +111,7 @@ class WorkflowCommentService: content: str, position_x: float, position_y: float, - mentioned_user_ids: Optional[list[str]] = None, + mentioned_user_ids: list[str] | None = None, ) -> dict: """Create a new workflow comment.""" WorkflowCommentService._validate_content(content) @@ -152,9 +152,9 @@ class WorkflowCommentService: comment_id: str, user_id: str, content: str, - position_x: Optional[float] = None, - position_y: Optional[float] = None, - mentioned_user_ids: Optional[list[str]] = None, + position_x: float | None = None, + position_y: float | None = None, + mentioned_user_ids: list[str] | None = None, ) -> dict: """Update a workflow comment.""" WorkflowCommentService._validate_content(content) @@ -251,7 +251,7 @@ class WorkflowCommentService: @staticmethod def create_reply( - comment_id: str, content: str, created_by: str, mentioned_user_ids: Optional[list[str]] = None + comment_id: str, content: str, created_by: str, mentioned_user_ids: list[str] | None = None ) -> dict: """Add a reply to a workflow comment.""" WorkflowCommentService._validate_content(content) @@ -282,9 +282,7 @@ class WorkflowCommentService: return {"id": reply.id, "created_at": reply.created_at} @staticmethod - def update_reply( - reply_id: str, user_id: str, content: str, mentioned_user_ids: Optional[list[str]] = None - ) -> dict: + def update_reply(reply_id: str, user_id: str, content: str, mentioned_user_ids: list[str] | None = None) -> dict: """Update a comment reply.""" WorkflowCommentService._validate_content(content) diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 429667e75f..594d5ae660 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -33,6 +33,7 @@ x-shared-env: &shared-api-worker-env OPENAI_API_BASE: ${OPENAI_API_BASE:-https://api.openai.com/v1} MIGRATION_ENABLED: ${MIGRATION_ENABLED:-true} FILES_ACCESS_TIMEOUT: ${FILES_ACCESS_TIMEOUT:-300} + ENABLE_COLLABORATION_MODE: ${ENABLE_COLLABORATION_MODE:-false} ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-60} REFRESH_TOKEN_EXPIRE_DAYS: ${REFRESH_TOKEN_EXPIRE_DAYS:-30} APP_DEFAULT_ACTIVE_REQUESTS: ${APP_DEFAULT_ACTIVE_REQUESTS:-0}