From 6eb84c195a7e1d916dd1a5c64647bf35d03c8f32 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Wed, 12 Aug 2026 17:36:46 -0400 Subject: [PATCH] Keep the memory instruction out of the answer it was attached to Told there was nothing worth remembering, the model wrote a sentence saying so, which is a footnote about a mechanism the operator cannot see. --- Plugin/unraid/Tools/ai_chat_worker.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Plugin/unraid/Tools/ai_chat_worker.php b/Plugin/unraid/Tools/ai_chat_worker.php index 1e21791..7587e62 100644 --- a/Plugin/unraid/Tools/ai_chat_worker.php +++ b/Plugin/unraid/Tools/ai_chat_worker.php @@ -778,7 +778,11 @@ if (vv_ai_mem_learn_enabled()) { . "Never where a setting lives or how to reach it in the web UI — all of that is " . "already documented and retrievable, so remembering it gains nothing and costs " . "budget that a fact the documents cannot supply would have used.\n" - . "Most exchanges warrant nothing — when in doubt, leave the line out entirely.\n\n"; + . "Most exchanges warrant nothing — when in doubt, leave the line out entirely.\n" + . "When there is nothing to remember, say nothing about it. Do not write that no " + . "memory was needed, do not explain why, do not mention this instruction at all. " + . "The operator never asked about any of it and is not expecting an answer about " + . "it — your reply should read exactly as it would if this section did not exist.\n\n"; } if (trim($mem['learned']) !== '') { @@ -979,6 +983,24 @@ if (vv_ai_mem_learn_enabled() && $answer !== '') { mb_substr($candidate, 0, 80))); } } + + // The model narrating its decision not to remember anything — "No MEMORY needed here, this is + // a standard Unix permission setting." It is not a marker, so the strip above leaves it, and + // it lands in the transcript as a footnote about a mechanism the operator never asked about + // and cannot see. Every General Chat answer carried one from the moment learning was switched + // on. + // + // Narrow on purpose: the last line only, mentioning MEMORY in the capitals the marker uses, + // and short. Prose about RAM says "memory"; only a comment about this instruction shouts it. + $lines = explode("\n", $answer); + $last = trim(end($lines)); + if (count($lines) > 1 && $last !== '' && mb_strlen($last) <= 200 + && strpos($last, 'MEMORY') !== false + && preg_match('/\b(no|not|nothing|none|skip|omit|need|worth|warrant)\b/i', $last)) { + array_pop($lines); + $answer = rtrim(implode("\n", $lines)); + wlog('stripped a trailing remark about the memory marker'); + } } if ($answer === '') {