From c877ca646ef2e2571467adb3732412c710d7fb10 Mon Sep 17 00:00:00 2001 From: Didactyl User Date: Thu, 16 Apr 2026 17:25:47 -0400 Subject: [PATCH] v0.2.44 - Fix adoption list selection to self-authored latest event in agent and skill tool --- README.md | 4 ++-- src/agent.c | 7 +++++++ src/main.h | 4 ++-- src/tools/tool_skill.c | 6 ++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1ed96f2..b676f94 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,11 @@ Skills compose by adoption-list order (`10123`) and trigger tags carry runtime e 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.2.43 +## Current Status — v0.2.44 **Active build — this project is barely working. Experiment at your own risk.** -> Last release update: v0.2.43 — Fix /help adopted-skills section to use latest kind 10123 event by created_at in CLI and HTTP views +> Last release update: v0.2.44 — Fix adoption list selection to self-authored latest event in agent and skill tool - 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/agent.c b/src/agent.c index 24dd6ca..09cfce5 100644 --- a/src/agent.c +++ b/src/agent.c @@ -1471,6 +1471,13 @@ static int refresh_adopted_skills_cache_if_needed(void) { if (!ev || !cJSON_IsObject(ev)) { continue; } + + cJSON* ev_pubkey = cJSON_GetObjectItemCaseSensitive(ev, "pubkey"); + if (!ev_pubkey || !cJSON_IsString(ev_pubkey) || !ev_pubkey->valuestring || + strcmp(ev_pubkey->valuestring, g_cfg->keys.public_key_hex) != 0) { + continue; + } + cJSON* created_at = cJSON_GetObjectItemCaseSensitive(ev, "created_at"); double created = (created_at && cJSON_IsNumber(created_at)) ? created_at->valuedouble : 0.0; if (!list_event || created > list_event_created_at) { diff --git a/src/main.h b/src/main.h index cc929d5..f1d2d60 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 2 -#define DIDACTYL_VERSION_PATCH 43 -#define DIDACTYL_VERSION "v0.2.43" +#define DIDACTYL_VERSION_PATCH 44 +#define DIDACTYL_VERSION "v0.2.44" // Agent metadata #define DIDACTYL_NAME "Didactyl" diff --git a/src/tools/tool_skill.c b/src/tools/tool_skill.c index 4078eb8..f270c4e 100644 --- a/src/tools/tool_skill.c +++ b/src/tools/tool_skill.c @@ -342,6 +342,12 @@ static int fetch_adoption_list_tags_local(tools_context_t* ctx, cJSON** out_tags continue; } + cJSON* ev_pubkey = cJSON_GetObjectItemCaseSensitive(ev, "pubkey"); + if (!ev_pubkey || !cJSON_IsString(ev_pubkey) || !ev_pubkey->valuestring || + strcmp(ev_pubkey->valuestring, ctx->cfg->keys.public_key_hex) != 0) { + continue; + } + cJSON* created_at = cJSON_GetObjectItemCaseSensitive(ev, "created_at"); double created = (created_at && cJSON_IsNumber(created_at)) ? created_at->valuedouble : 0.0; if (!best || created > best_created) {