Skip to content

fix(memory): normalize auto-recall query for /new startup prompts#1228

Open
Naluko wants to merge 1 commit intoMemTensor:mainfrom
Naluko:fix/normalize-auto-recall-query
Open

fix(memory): normalize auto-recall query for /new startup prompts#1228
Naluko wants to merge 1 commit intoMemTensor:mainfrom
Naluko:fix/normalize-auto-recall-query

Conversation

@Naluko
Copy link

@Naluko Naluko commented Mar 14, 2026

Summary

Fix auto-recall failures caused by /new and /reset startup prompts being used as the recall query.

Problem

When a new session starts, the runtime may prepend a long startup prompt such as:

  • A new session was started via /new or /reset...
  • session startup instructions
  • internal runtime context
  • "Continue where you left off" text

The auto-recall pipeline was trimming some transport metadata, but it could still treat this injected startup text as the search query. That made retrieval noisy or caused it to miss relevant memories entirely.

Root Cause

Auto-recall query extraction only handled a subset of wrapper metadata inline at the call site. It did not normalize session-start prompt text introduced during /new or /reset, so the retrieval query could become the whole startup prompt instead of the user's actual message.

Fix

  • Extract query normalization into normalizeAutoRecallQuery(rawPrompt)
  • Strip sender metadata / fenced JSON wrappers
  • Reuse inbound metadata cleanup
  • Remove injected /new and /reset startup prompt text
  • Remove internal runtime context and "Continue where you left off" carry-over text
  • Use the normalized query in the auto-recall entry path

Result

Auto-recall now searches with the user's real message content instead of the session-start boilerplate, improving retrieval accuracy in fresh sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants