diff --git a/README.md b/README.md index 21e3fbd..24f7e62 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,11 @@ Agents learn capabilities through skills — Nostr events that any agent can di Didactyl will support local inference, which is very privacy preserving. Remote inference does however have it's advantages, and in those cases Didactyl supports using Bitcoin Lightning and eCash inference providers. -## Current Status — v0.0.23 +## Current Status — v0.0.24 **Active build — this project is barely working. Experiment at your own risk.** -> Last release update: v0.0.23 — Add tool_list runtime tool introspection (name/description/schema) and validate via CLI test mode +> Last release update: v0.0.24 — Handle SIGPIPE disconnect crash and fix nostr_list_manage use-after-free - Connects to configured relays with auto-reconnect and relay state transition logging - Publishes configured startup events per relay as each relay becomes connected diff --git a/src/main.c b/src/main.c index c42947a..95d735d 100644 --- a/src/main.c +++ b/src/main.c @@ -261,6 +261,7 @@ int main(int argc, char** argv) { signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); + signal(SIGPIPE, SIG_IGN); DEBUG_INFO("[didactyl] entering main poll loop"); DEBUG_INFO("[didactyl] running with pubkey %s", cfg.keys.public_key_hex); diff --git a/src/main.h b/src/main.h index b732df9..c2fdb22 100644 --- a/src/main.h +++ b/src/main.h @@ -12,8 +12,8 @@ // Using DIDACTYL_ prefix to avoid conflicts with nostr_core_lib VERSION macros #define DIDACTYL_VERSION_MAJOR 0 #define DIDACTYL_VERSION_MINOR 0 -#define DIDACTYL_VERSION_PATCH 23 -#define DIDACTYL_VERSION "v0.0.23" +#define DIDACTYL_VERSION_PATCH 24 +#define DIDACTYL_VERSION "v0.0.24" // Agent metadata #define DIDACTYL_NAME "Didactyl" diff --git a/src/tools.c b/src/tools.c index 8ccb74f..2e44a27 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2999,15 +2999,16 @@ static char* execute_nostr_list_manage(tools_context_t* ctx, const char* args_js free(list_content); cJSON_Delete(updated_tags); cJSON_Delete(events); - cJSON_Delete(args); if (rc != 0) { + cJSON_Delete(args); nostr_handler_publish_result_free(&publish_result); return json_error("nostr_list_manage failed"); } cJSON* out = cJSON_CreateObject(); if (!out) { + cJSON_Delete(args); nostr_handler_publish_result_free(&publish_result); return NULL; } @@ -3015,6 +3016,7 @@ static char* execute_nostr_list_manage(tools_context_t* ctx, const char* args_js cJSON_AddBoolToObject(out, "success", publish_result.success ? 1 : 0); cJSON_AddNumberToObject(out, "list_kind", publish_result.kind); cJSON_AddStringToObject(out, "action", action->valuestring); + cJSON_Delete(args); cJSON_AddNumberToObject(out, "items_affected", items_affected); cJSON_AddStringToObject(out, "event_id", publish_result.event_id);