MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / application_job_failure_response

Function application_job_failure_response

src/daemon/application.c:1440–1470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1438}
1439
1440static char *application_job_failure_response(const cbm_index_worker_result_t *result,
1441 const char *log_path) {
1442 char message[1024];
1443 if (result && result->cancellation_requested) {
1444 (void)snprintf(message, sizeof(message),
1445 "index operation cancelled before completion (its last waiting "
1446 "client disconnected or the daemon stopped). %s",
1447 CBM_MCP_INDEX_ASYNC_HINT);
1448 } else if (result && (result->supervision_failed || !result->tree_quiesced)) {
1449 (void)snprintf(message, sizeof(message),
1450 "index worker containment failed (%s); inspect log: %s",
1451 cbm_proc_outcome_str(result->outcome), log_path ? log_path : "unavailable");
1452 } else if (result && result->response_missing) {
1453 /* #1300: name the silent clean exit, where it stopped, and the log. */
1454 const char *log = log_path ? log_path
1455 : result->worker_log[0] ? result->worker_log
1456 : "unavailable";
1457 (void)snprintf(message, sizeof(message),
1458 "index worker exited cleanly (exit 0) without writing a response; the "
1459 "index was not published; last phase reached: %s; inspect log: %s",
1460 result->last_phase[0] ? result->last_phase : "unknown", log);
1461 } else if (result) {
1462 (void)snprintf(message, sizeof(message),
1463 "index worker ended with %s (exit=%d, signal=%d); inspect log: %s",
1464 cbm_proc_outcome_str(result->outcome), result->exit_code,
1465 result->term_signal, log_path ? log_path : "unavailable");
1466 } else {
1467 (void)snprintf(message, sizeof(message), "index worker could not be started");
1468 }
1469 return cbm_mcp_text_result(message, true);
1470}
1471
1472static cbm_mcp_supervised_result_disposition_t application_attempt_disposition(
1473 cbm_daemon_application_job_t *job, application_attempt_t *attempt) {

Callers 1

application_job_publishFunction · 0.85

Calls 2

cbm_proc_outcome_strFunction · 0.85
cbm_mcp_text_resultFunction · 0.85

Tested by

no test coverage detected