feat(soul): add safety module, expand connectors API, memory-recall bug notes
- safety.el/.elh: new safety module - neuron-api.el, routes.el, soul.el, chat.el: connectors API expansion - regenerated dist/ C artifacts - MEMORY_RECALL_BUG.md: investigation notes Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vendored
+4
-1
@@ -177,6 +177,7 @@ el_val_t handle_chat(el_val_t body) {
|
||||
}
|
||||
el_val_t ctx = engram_compile(message);
|
||||
el_val_t system = build_system_prompt(ctx);
|
||||
system = safety_augment_system(system, message);
|
||||
el_val_t state_hist = state_get(EL_STR("conv_history"));
|
||||
el_val_t stored_hist = ({ el_val_t _if_result_12 = 0; if (str_eq(state_hist, EL_STR(""))) { _if_result_12 = (conv_history_load()); } else { _if_result_12 = (state_hist); } _if_result_12; });
|
||||
el_val_t hist_len = ({ el_val_t _if_result_13 = 0; if (str_eq(stored_hist, EL_STR(""))) { _if_result_13 = (0); } else { _if_result_13 = (json_array_len(stored_hist)); } _if_result_13; });
|
||||
@@ -579,7 +580,9 @@ el_val_t handle_chat_agentic(el_val_t body) {
|
||||
el_val_t identity = state_get(EL_STR("soul_identity"));
|
||||
el_val_t current_date = time_format(time_now(), EL_STR("%A, %B %d, %Y"));
|
||||
el_val_t web_directive = el_str_concat(el_str_concat(EL_STR(" Today's date is "), current_date), EL_STR(". You have a web_search tool that returns live results from the internet. For ANY question about current events, live scores, standings, schedules, recent news, people, prices, or anything that may have changed since your training, you MUST call web_search immediately and answer from the results. Do NOT ask the user to clarify first, do NOT say you lack live access, and do NOT answer time-sensitive questions from memory alone \xe2\x80\x94 search, then answer. When a question is ambiguous about timeframe (e.g. 'the tournament', 'the game', 'the playoffs'), assume the user means whatever is happening or most recent RIGHT NOW as of today's date, search for that, and lead with it."));
|
||||
el_val_t system = el_str_concat(el_str_concat(el_str_concat(el_str_concat(identity, EL_STR(" You have access to tools: read files, write files, browse the web, search your memory, run commands, plus any connected MCP tools (named mcp__<server>__<tool>). Use them when they add genuine value. Be direct.")), web_directive), EL_STR("\n\n")), ctx);
|
||||
el_val_t tool_directive = EL_STR(" You have real, working tools attached to THIS conversation right now \xe2\x80\x94 read and write files, browse the web, search your memory, run commands, and any connected services (named mcp__<server>__<tool>, e.g. a Filesystem, GitHub, or Notion connector the user enabled). The attached tool list is the ground truth of what you can do. When the user asks whether you can do something one of these tools enables, or asks you to do it, USE the tool and act. Do NOT claim you lack a capability your tools provide, do NOT describe your tools in the abstract, and do NOT refuse on the assumption you cannot \xe2\x80\x94 if a tool isn't in your attached list, say so plainly; otherwise just do it.");
|
||||
el_val_t system = el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(identity, EL_STR(" You have access to tools: read files, write files, browse the web, search your memory, run commands, plus any connected services (named mcp__<server>__<tool>). Use them when they add genuine value. Be direct.")), web_directive), tool_directive), EL_STR("\n\n")), ctx);
|
||||
system = safety_augment_system(system, message);
|
||||
el_val_t tools_json = agentic_tools_all();
|
||||
el_val_t safe_msg = json_safe(message);
|
||||
el_val_t messages = el_str_concat(el_str_concat(EL_STR("[{\"role\":\"user\",\"content\":\""), safe_msg), EL_STR("\"}]"));
|
||||
|
||||
Reference in New Issue
Block a user