| 13016 | response_ok = final_response(j->fd, s->enable_cors, &j->req, id, |
| 13017 | parsed_content ? parsed_content : (text.ptr ? text.ptr : ""), |
| 13018 | parsed_reasoning, |
| 13019 | &parsed_calls, final_finish, |
| 13020 | prompt_tokens, completion); |
| 13021 | } |
| 13022 | if (job_cancelled(j)) response_ok = false; |
| 13023 | if (!response_ok) { |
| 13024 | job_mark_cancelled(j); |
| 13025 | final_finish = "error"; |
| 13026 | snprintf(err, sizeof(err), "client disconnected"); |
| 13027 | request_live_state_clear(s, slot); |
| 13028 | server_log(DS4_LOG_DEFAULT, |
| 13029 | "ds4-server: %s ctx=%s%s%s client disconnected", |
| 13030 | j->req.kind == REQ_CHAT ? "chat" : "completion", |
| 13031 | ctx_span, |
| 13032 | req_flags[0] ? " " : "", |
| 13033 | req_flags); |
| 13034 | } |
| 13035 | if (j->req.kind == REQ_CHAT && j->req.has_tools) { |
| 13036 | char flags[80]; |
| 13037 | log_flags(flags, sizeof(flags), |
| 13038 | responses_protocol, |
| 13039 | true, |
no test coverage detected