| 16440 | bool git_child, cbm_proc_result_t *result_out); |
| 16441 | |
| 16442 | static char *search_code_timeout_result(void) { |
| 16443 | static const char message[] = "search_code scan exceeded its execution deadline"; |
| 16444 | static const char fallback[] = |
| 16445 | "{\"content\":[{\"type\":\"text\",\"text\":\"search_code scan exceeded its execution " |
| 16446 | "deadline\"}],\"structuredContent\":{\"code\":\"request_timeout\",\"message\":\"search_" |
| 16447 | "code " |
| 16448 | "scan exceeded its execution deadline\"},\"isError\":true}"; |
| 16449 | yyjson_mut_doc *doc = yyjson_mut_doc_new(NULL); |
| 16450 | if (!doc) { |
| 16451 | return heap_strdup(fallback); |
| 16452 | } |
| 16453 | yyjson_mut_val *root = yyjson_mut_obj(doc); |
| 16454 | yyjson_mut_doc_set_root(doc, root); |
| 16455 | yyjson_mut_val *content = yyjson_mut_arr(doc); |
| 16456 | yyjson_mut_val *item = yyjson_mut_obj(doc); |
| 16457 | yyjson_mut_obj_add_str(doc, item, "type", "text"); |
| 16458 | yyjson_mut_obj_add_str(doc, item, "text", message); |
| 16459 | yyjson_mut_arr_add_val(content, item); |
| 16460 | yyjson_mut_obj_add_val(doc, root, "content", content); |
| 16461 | yyjson_mut_val *structured = yyjson_mut_obj(doc); |
| 16462 | yyjson_mut_obj_add_str(doc, structured, "code", "request_timeout"); |
| 16463 | yyjson_mut_obj_add_str(doc, structured, "message", message); |
| 16464 | yyjson_mut_obj_add_val(doc, root, "structuredContent", structured); |
| 16465 | yyjson_mut_obj_add_bool(doc, root, "isError", true); |
| 16466 | char *result = yy_doc_to_str(doc); |
| 16467 | yyjson_mut_doc_free(doc); |
| 16468 | return result ? result : heap_strdup(fallback); |
| 16469 | } |
| 16470 | |
| 16471 | static char *search_code_scan_error(search_scratch_t *scratch, const char *output_path, |
| 16472 | bool has_path_filter, cbm_regex_t *path_regex, char *root_path, |
no test coverage detected