From c7fe423476e4373e5bc8cd7fdc36249acec4e37c Mon Sep 17 00:00:00 2001 From: Yuan Li Date: Wed, 30 Sep 2026 20:26:51 +0800 Subject: [PATCH] fix(cron): bound profile flag lifecycle scan (cherry picked from commit 9546b9dd687606d676799b50a0df6e136fc6db8a) --- cron/lifecycle_guard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron/lifecycle_guard.py b/cron/lifecycle_guard.py index 9e9e4f41d5..f145d4db8d 100644 --- a/cron/lifecycle_guard.py +++ b/cron/lifecycle_guard.py @@ -247,11 +247,11 @@ _PROFILE_FLAG_LIFECYCLE_PATTERN = re.compile( r"(?i)" r"hermes\s+" # Any global flags before the profile selector (each may carry a value). - r"(?:-{1,2}\S+(?:\s+\S+)?\s+)*" + r"(?:-{1,2}\S+(?:\s+(?!-)\S+)?\s+){0,12}" # The selector: exactly the shapes the CLI's `_apply_profile_override` accepts. r"(?:--profile=([^\s]+)|(?:-p|--profile)\s+([^\s]+))" # Any global flags between the selector and the subcommand. - r"(?:\s+-{1,2}\S+(?:\s+\S+)?)*" + r"(?:\s+-{1,2}\S+(?:\s+(?!-)\S+)?){0,12}" r"\s+gateway\s+(?:restart|stop)" )