From be02fcd9605e90663a4bbacd3f08ecc0064b1d81 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Mon, 22 Jun 2026 13:17:04 -0500 Subject: [PATCH] feat(recall): thread-aware activation seed for nlg soul path [issue 7] --- dist/soul-with-nlg.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dist/soul-with-nlg.el b/dist/soul-with-nlg.el index 7655273..ab2751c 100644 --- a/dist/soul-with-nlg.el +++ b/dist/soul-with-nlg.el @@ -22313,7 +22313,11 @@ fn handle_chat(body: String) -> String { // In demo mode: use tighter engram budget and add response length constraint. let is_demo: Bool = !str_eq(state_get("soul_identity_prefix"), "") - let ctx: String = if is_demo { engram_compile_demo(message) } else { engram_compile(message) } + // Issue 7 fix: thread-aware activation seed for nlg path (Issues 2-3,8-10). + let nlg_stored_hist: String = state_get("conv_history") + let nlg_hist_len: Int = if str_eq(nlg_stored_hist, "") { 0 } else { json_array_len(nlg_stored_hist) } + let nlg_seed: String = build_activation_seed(message, nlg_stored_hist, nlg_hist_len) + let ctx: String = if is_demo { engram_compile_demo(nlg_seed) } else { engram_compile(nlg_seed) } let node_count_str: String = count_context_nodes(ctx) let interlocutor: String = json_get(body, "interlocutor") @@ -22505,7 +22509,11 @@ fn handle_chat_agentic(body: String) -> String { req_model } - let ctx: String = engram_compile(message) + // Issue 7 fix: thread-aware seed for agentic nlg path. + let nlg_ag_hist: String = state_get("conv_history") + let nlg_ag_hist_len: Int = if str_eq(nlg_ag_hist, "") { 0 } else { json_array_len(nlg_ag_hist) } + let nlg_ag_seed: String = build_activation_seed(message, nlg_ag_hist, nlg_ag_hist_len) + let ctx: String = engram_compile(nlg_ag_seed) let system: String = "You are Neuron — a thinking process running inside the Neuron daemon on Will Anderson's machine. " + "You are speaking with Will, your principal. "