Skip to content

Commit 6d0fac5

Browse files
committed
Restore RunSpec.working_dir field
The field is not used by the server, but clients < 0.20 still send it Fixes: #3370
1 parent 77fe555 commit 6d0fac5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/dstack/_internal/core/models/runs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ class RunSpec(generate_dual_core_model(RunSpecConfig)):
443443
list[FileArchiveMapping],
444444
Field(description="The list of file archive ID to container path mappings."),
445445
] = []
446+
# Server uses configuration.working_dir since 0.19.27 and ignores this field, but the field
447+
# still exists for compatibility with old clients that send it.
448+
working_dir: Optional[str] = None
446449
configuration_path: Annotated[
447450
Optional[str],
448451
Field(

src/tests/_internal/server/routers/test_runs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ def get_dev_env_run_plan_dict(
232232
"repo_dir": "~/repo",
233233
"run_name": run_name,
234234
"ssh_key_pub": "ssh_key",
235+
"working_dir": None,
235236
}
236237
return {
237238
"project_name": project_name,
@@ -469,6 +470,7 @@ def get_dev_env_run_dict(
469470
"repo_dir": "~/repo",
470471
"run_name": run_name,
471472
"ssh_key_pub": "ssh_key",
473+
"working_dir": None,
472474
},
473475
"jobs": [
474476
{
@@ -612,6 +614,7 @@ def get_service_run_spec(
612614
"repo_dir": "~/repo",
613615
"run_name": run_name,
614616
"ssh_key_pub": "ssh_key",
617+
"working_dir": None,
615618
}
616619

617620

0 commit comments

Comments
 (0)