Skip to content

fix: strip recall marker text from temporal storage to prevent FTS echo#306

Merged
BYK merged 2 commits into
mainfrom
byk/fix-recall-marker-fts-noise
May 14, 2026
Merged

fix: strip recall marker text from temporal storage to prevent FTS echo#306
BYK merged 2 commits into
mainfrom
byk/fix-recall-marker-fts-noise

Conversation

@BYK
Copy link
Copy Markdown
Owner

@BYK BYK commented May 14, 2026

Summary

  • Recall markers (📚 Searching ... for "<query>"…) were stored as regular text parts in temporal_messages, causing FTS5 to index the raw query string. Future searches for the same terms surfaced the marker as a top result — pure noise that wastes result slots and creates a self-reinforcing echo effect.
  • Added isRecallMarker() predicate in recall.ts and filter in postResponse() (pipeline.ts) to strip marker text blocks before temporal.store(). Markers are still sent to the client and used for round-trip expansion — only the FTS index is kept clean.

Changes

File Change
packages/gateway/src/recall.ts Export isRecallMarker() using existing marker regexes
packages/gateway/src/pipeline.ts Filter recall marker blocks from assistant content before temporal storage; skip storage entirely if all blocks are markers

BYK added 2 commits May 14, 2026 11:23
Recall markers (📚 Searching ... for "<query>"…) were stored as regular
text in temporal_messages, causing FTS5 to index the raw query string.
Future searches for the same terms would surface the marker as a top
result — pure noise that wastes result slots and creates self-reinforcing
echo in search results.

Filter out recall marker text blocks before passing assistant content to
temporal.store(). Markers are still sent to the client and used for
round-trip expansion — only the FTS index is kept clean.
Single source of truth for marker format detection — isRecallMarker now
delegates to parseRecallMarker instead of duplicating regex checks.
Added unit tests covering search markers, id-based detail markers, and
non-marker rejection.
@BYK BYK merged commit 026173c into main May 14, 2026
7 checks passed
@BYK BYK deleted the byk/fix-recall-marker-fts-noise branch May 14, 2026 11:32
@craft-deployer craft-deployer Bot mentioned this pull request May 14, 2026
6 tasks
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.

1 participant