v0.2.40 - Fix adoption list freshness by selecting newest kind 10123 event and temporarily disable periodic relay-backed trigger reconciliation for validation
This commit is contained in:
@@ -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.39
|
||||
## Current Status — v0.2.40
|
||||
|
||||
**Active build — this project is barely working. Experiment at your own risk.**
|
||||
|
||||
> Last release update: v0.2.39 — Add 15-minute relay-backed trigger reconciliation in trigger_manager_poll to recover missed self-skill events and re-register missing triggers
|
||||
> Last release update: v0.2.40 — Fix adoption list freshness by selecting newest kind 10123 event and temporarily disable periodic relay-backed trigger reconciliation for validation
|
||||
|
||||
- Connects to configured relays with auto-reconnect and relay state transition logging
|
||||
- Publishes configured startup events per relay as each relay becomes connected
|
||||
|
||||
@@ -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 39
|
||||
#define DIDACTYL_VERSION "v0.2.39"
|
||||
#define DIDACTYL_VERSION_PATCH 40
|
||||
#define DIDACTYL_VERSION "v0.2.40"
|
||||
|
||||
// Agent metadata
|
||||
#define DIDACTYL_NAME "Didactyl"
|
||||
|
||||
@@ -333,9 +333,25 @@ static int fetch_adoption_list_tags_local(tools_context_t* ctx, cJSON** out_tags
|
||||
free(events_json);
|
||||
|
||||
if (events && cJSON_IsArray(events) && cJSON_GetArraySize(events) > 0) {
|
||||
cJSON* ev0 = cJSON_GetArrayItem(events, 0);
|
||||
if (ev0 && cJSON_IsObject(ev0)) {
|
||||
cJSON* ev_content = cJSON_GetObjectItemCaseSensitive(ev0, "content");
|
||||
cJSON* best = NULL;
|
||||
double best_created = -1.0;
|
||||
int n = cJSON_GetArraySize(events);
|
||||
for (int i = 0; i < n; i++) {
|
||||
cJSON* ev = cJSON_GetArrayItem(events, i);
|
||||
if (!ev || !cJSON_IsObject(ev)) {
|
||||
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) {
|
||||
best = ev;
|
||||
best_created = created;
|
||||
}
|
||||
}
|
||||
|
||||
if (best && cJSON_IsObject(best)) {
|
||||
cJSON* ev_content = cJSON_GetObjectItemCaseSensitive(best, "content");
|
||||
if (ev_content && cJSON_IsString(ev_content) && ev_content->valuestring) {
|
||||
free(content);
|
||||
content = strdup(ev_content->valuestring);
|
||||
@@ -346,7 +362,7 @@ static int fetch_adoption_list_tags_local(tools_context_t* ctx, cJSON** out_tags
|
||||
}
|
||||
}
|
||||
|
||||
cJSON* ev_tags = cJSON_GetObjectItemCaseSensitive(ev0, "tags");
|
||||
cJSON* ev_tags = cJSON_GetObjectItemCaseSensitive(best, "tags");
|
||||
if (ev_tags && cJSON_IsArray(ev_tags)) {
|
||||
cJSON* dup = cJSON_Duplicate(ev_tags, 1);
|
||||
if (!dup) {
|
||||
|
||||
@@ -1568,7 +1568,13 @@ int trigger_manager_poll(trigger_manager_t* mgr) {
|
||||
}
|
||||
pthread_mutex_unlock(&mgr->mutex);
|
||||
|
||||
if (mgr->last_reconcile_at <= 0 || (now - mgr->last_reconcile_at) >= 900) {
|
||||
/*
|
||||
* Temporarily disable periodic relay-backed trigger reconciliation.
|
||||
* Keep code path in place for quick re-enable after adoption/cache fix validation.
|
||||
*/
|
||||
int enable_periodic_reconcile = 0;
|
||||
if (enable_periodic_reconcile &&
|
||||
(mgr->last_reconcile_at <= 0 || (now - mgr->last_reconcile_at) >= 900)) {
|
||||
mgr->last_reconcile_at = now;
|
||||
(void)trigger_manager_reconcile_from_relays(mgr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user