From c6a64e9f6989bfca1fd154ede83fab54c048fc08 Mon Sep 17 00:00:00 2001 From: Simo Lin Date: Mon, 12 Jan 2026 15:41:52 -0800 Subject: [PATCH] [smg] fix type complexity for workflow run_if (#16981) --- sgl-model-gateway/src/workflow/definition.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sgl-model-gateway/src/workflow/definition.rs b/sgl-model-gateway/src/workflow/definition.rs index f88e411f5..c1f2ba0eb 100644 --- a/sgl-model-gateway/src/workflow/definition.rs +++ b/sgl-model-gateway/src/workflow/definition.rs @@ -14,6 +14,9 @@ use super::{ types::{FailureAction, RetryPolicy, StepId, WorkflowContext, WorkflowData, WorkflowId}, }; +/// A condition function that determines whether a step should run. +pub type StepCondition = Arc) -> bool + Send + Sync>; + /// Errors that can occur during workflow validation #[derive(Debug, Clone, thiserror::Error)] pub enum ValidationError { @@ -43,8 +46,7 @@ pub struct StepDefinition { /// Run step at or after this time (after dependencies satisfied) pub scheduled_at: Option>, /// Condition to evaluate; if false, step is skipped - #[allow(clippy::type_complexity)] - pub run_if: Option) -> bool + Send + Sync>>, + pub run_if: Option>, } impl fmt::Debug for StepDefinition {