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:
@@ -159,6 +159,9 @@ fn handle_chat(body: String) -> String {
|
||||
|
||||
let ctx: String = engram_compile(message)
|
||||
let system: String = build_system_prompt(ctx)
|
||||
// Hard Bell: pre-LLM safety evaluation. Injects the soft/hard directive (and the
|
||||
// self_harm vs abuse routing) into the system prompt before the model responds.
|
||||
let system = safety_augment_system(system, message)
|
||||
|
||||
// Load from state; if empty, try to recover from engram (cross-restart continuity)
|
||||
let state_hist: String = state_get("conv_history")
|
||||
@@ -742,7 +745,13 @@ fn handle_chat_agentic(body: String) -> String {
|
||||
// user to clarify; with web_search available it must search FIRST and answer from
|
||||
// results. This is the fix for "model narrates web_search(...) instead of calling it."
|
||||
let web_directive: String = " Today's date is " + current_date + ". 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 — 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."
|
||||
let system: String = identity + " 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 + "\n\n" + ctx
|
||||
// Tool-awareness directive: without this the model confabulates its own capabilities — it
|
||||
// tells the user "I don't have filesystem tools" even though the tools ARE attached this turn.
|
||||
// Additive framing only (does not change character): trust the attached tool list, and act.
|
||||
let tool_directive: String = " You have real, working tools attached to THIS conversation right now — 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 — if a tool isn't in your attached list, say so plainly; otherwise just do it."
|
||||
let system: String = identity + " 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 + "\n\n" + ctx
|
||||
// Hard Bell: pre-LLM safety evaluation on the agentic path too.
|
||||
let system = safety_augment_system(system, message)
|
||||
|
||||
let tools_json: String = agentic_tools_all()
|
||||
let safe_msg: String = json_safe(message)
|
||||
|
||||
Reference in New Issue
Block a user