From bc2ae0653eb651ece5ca591c06ac3dc31da16037 Mon Sep 17 00:00:00 2001 From: Dmitry Meyer Date: Fri, 21 Nov 2025 14:09:46 +0000 Subject: [PATCH] Fix LEGACY_REPO_DIR_DISABLED feature flag RunSpec.repo_dir = None is valid if there are no repos in the configuration --- src/dstack/_internal/server/services/runs/spec.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dstack/_internal/server/services/runs/spec.py b/src/dstack/_internal/server/services/runs/spec.py index 2bb8195ae..dbf62e57d 100644 --- a/src/dstack/_internal/server/services/runs/spec.py +++ b/src/dstack/_internal/server/services/runs/spec.py @@ -114,7 +114,12 @@ def validate_run_spec_and_set_defaults( raise ServerClientError("ssh_key_pub must be set if the user has no ssh_public_key") if run_spec.configuration.working_dir is None and legacy_repo_dir: run_spec.configuration.working_dir = LEGACY_REPO_DIR - if run_spec.repo_dir is None and FeatureFlags.LEGACY_REPO_DIR_DISABLED and not legacy_repo_dir: + if ( + run_spec.configuration.repos + and run_spec.repo_dir is None + and FeatureFlags.LEGACY_REPO_DIR_DISABLED + and not legacy_repo_dir + ): raise ServerClientError("Repo path is not set")