@@ -1211,6 +1211,8 @@ class BackendServiceImpl final : public backend::Backend::Service {
12111211 }
12121212
12131213 tasks.reserve (inputs.size ());
1214+ std::vector<task_result_state> states;
1215+ states.reserve (inputs.size ());
12141216 for (size_t i = 0 ; i < inputs.size (); i++) {
12151217 server_task task = server_task (type);
12161218
@@ -1229,9 +1231,13 @@ class BackendServiceImpl final : public backend::Backend::Service {
12291231 task.params .oaicompat_cmpl_id = completion_id;
12301232 // oaicompat_model is already populated by params_from_json_cmpl
12311233
1234+ // Extract oaicompat_chat_syntax for state tracking before moving task
1235+ states.push_back (task.params .oaicompat_chat_syntax );
1236+
12321237 tasks.push_back (std::move (task));
12331238 }
12341239
1240+ rd->set_states (std::move (states));
12351241 rd->post_tasks (std::move (tasks));
12361242 } catch (const std::exception & e) {
12371243 return grpc::Status (grpc::StatusCode::INVALID_ARGUMENT, e.what ());
@@ -1946,6 +1952,8 @@ class BackendServiceImpl final : public backend::Backend::Service {
19461952 }
19471953
19481954 tasks.reserve (inputs.size ());
1955+ std::vector<task_result_state> states;
1956+ states.reserve (inputs.size ());
19491957 for (size_t i = 0 ; i < inputs.size (); i++) {
19501958 server_task task = server_task (type);
19511959
@@ -1964,9 +1972,13 @@ class BackendServiceImpl final : public backend::Backend::Service {
19641972 task.params .oaicompat_cmpl_id = completion_id;
19651973 // oaicompat_model is already populated by params_from_json_cmpl
19661974
1975+ // Extract oaicompat_chat_syntax for state tracking before moving task
1976+ states.push_back (task.params .oaicompat_chat_syntax );
1977+
19671978 tasks.push_back (std::move (task));
19681979 }
19691980
1981+ rd->set_states (std::move (states));
19701982 rd->post_tasks (std::move (tasks));
19711983 } catch (const std::exception & e) {
19721984 return grpc::Status (grpc::StatusCode::INVALID_ARGUMENT, e.what ());
0 commit comments