safety/sessions: fix malformed string literals that crash elc
Three unescaped-quote typos produced malformed El string literals that broke compilation: - safety.el:282 stray extra double-quote at the tail of safety_soft_phrases (\"having a breakdown\""]") closed the string early, desyncing the lexer's string/code phase for the rest of the file and shattering later apostrophe text (can't, i'm) into bare identifiers -> invalid C. - sessions.el:517 str_replace(topic_snip, """, ...) — the bare """ is an empty string plus an unterminated string that swallowed the closing ) and }; with the current elc this triggers the parser overrun -> ~700GB OOM. - sessions.el:520 unescaped nested quotes in the topic_tags literal. All three now use escaped inner quotes. Verified: both files compile clean under the current elc (safety.c and sessions.c well-formed, brace-balanced).
This commit is contained in:
+2
-2
@@ -514,10 +514,10 @@ fn session_hist_save(session_id: String, hist: String) -> Void {
|
||||
let last_role: String = json_get(last_entry, "role")
|
||||
let last_content: String = json_get(last_entry, "content")
|
||||
let topic_snip: String = if str_len(last_content) > 200 { str_slice(last_content, 0, 200) } else { last_content }
|
||||
let safe_topic: String = str_replace(topic_snip, """, "'")
|
||||
let safe_topic: String = str_replace(topic_snip, "\"", "'")
|
||||
let ts_now: String = int_to_str(time_now())
|
||||
let topic_content: String = "last-session-topic | ts:" + ts_now + " | session:" + session_id + " | topic:" + safe_topic
|
||||
let topic_tags: String = "["last-session-topic","conv:history","Conversation","session:topic"]"
|
||||
let topic_tags: String = "[\"last-session-topic\",\"conv:history\",\"Conversation\",\"session:topic\"]"
|
||||
let topic_label: String = "last-session-topic:" + session_id
|
||||
// Delete old last-session-topic node for this session before writing fresh
|
||||
let old_topic: String = engram_search_json("last-session-topic:" + session_id, 2)
|
||||
|
||||
Reference in New Issue
Block a user