Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 54432ad

Browse files
fix: block command field changes for python engine (#2007)
Co-authored-by: sangjanai <sang@jan.ai>
1 parent 752c2c5 commit 54432ad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

engine/controllers/models.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ void Models::UpdateModel(const HttpRequestPtr& req,
385385
message = "Successfully update model ID '" + model_id +
386386
"': " + json_body.toStyledString();
387387
} else if (model_config.engine == kPythonEngine) {
388+
// Block changes to `command`
389+
if (json_body.isMember("command")) {
390+
json_body.removeMember("command");
391+
}
388392
config::PythonModelConfig python_model_config;
389393
python_model_config.ReadFromYaml(yaml_fp.string());
390394
python_model_config.FromJson(json_body);

0 commit comments

Comments
 (0)