Let each control actually govern the thing it names
Auto Scroll, the learning gate, the fold and the flash label each described a behaviour they did not enforce.
This commit is contained in:
@@ -956,9 +956,14 @@ $thinking = trim($thinking);
|
||||
// and the token ledger all see the text without it. Matched only at the very end, so a MEMORY:
|
||||
// mentioned mid-answer while explaining this feature is not mistaken for one being filed.
|
||||
if (vv_ai_mem_learn_enabled() && $answer !== '') {
|
||||
if (preg_match('/\n[ \t]*MEMORY:[ \t]*(.+?)[ \t]*$/s', "\n" . $answer, $mm)) {
|
||||
// No /s, and the tail is [^\n]+ rather than .+ — the marker must BE the last line, which is
|
||||
// what the comment above always claimed. With /s the dot crossed newlines, so a lazy group
|
||||
// anchored at $ matched the FIRST line-initial MEMORY: and captured everything after it to
|
||||
// the end: asking the assistant to explain this very feature filed the rest of its own answer
|
||||
// as a proposal and deleted it from the transcript.
|
||||
if (preg_match('/\n[ \t]*MEMORY:[ \t]*([^\n]+?)[ \t]*$/', "\n" . $answer, $mm)) {
|
||||
$candidate = trim(preg_replace('/\s+/', ' ', $mm[1]));
|
||||
$answer = trim(preg_replace('/\n[ \t]*MEMORY:[ \t]*.+?[ \t]*$/s', '', "\n" . $answer));
|
||||
$answer = trim(preg_replace('/\n[ \t]*MEMORY:[ \t]*[^\n]+?[ \t]*$/', '', "\n" . $answer));
|
||||
|
||||
if ($candidate !== '') {
|
||||
$r = vv_ai_mem_propose($candidate, [
|
||||
|
||||
Reference in New Issue
Block a user