Skip to content

feat(gateway): replace content markers with fingerprint-based session tracking#125

Merged
BYK merged 1 commit intomainfrom
feat/fingerprint-session-tracking
May 6, 2026
Merged

feat(gateway): replace content markers with fingerprint-based session tracking#125
BYK merged 1 commit intomainfrom
feat/fingerprint-session-tracking

Conversation

@BYK
Copy link
Copy Markdown
Owner

@BYK BYK commented May 6, 2026

Summary

  • Removes visible [lore:sessionID] content markers from responses — they were appearing verbatim in chat UI and contaminating title/summary generation requests via message history
  • Replaces marker-based session tracking with SHA-256 fingerprint of the first user message + message-count proximity matching (threshold=20) to disambiguate forked sessions
  • Removes the forced non-streaming path on first requests — all responses now stream natively from the start

How fork disambiguation works

Normal turns grow message count by 2–6 per turn. A forked session drops count to the fork point (e.g. parent at 600, fork starts at 300). Any session with the same fingerprint but a message count drop exceeding the threshold (20) is treated as a new fork session.

Tests

All 94 gateway tests pass. Updated 3 tests that were asserting marker presence to instead assert marker absence.

… tracking

Session identification previously injected a visible [lore:sessionID]
marker into the first response content, causing:
- Markers appearing verbatim in chat UI
- Title/summary generation requests getting branded via message history
- First request forced to non-streaming to enable marker injection

Replace with SHA-256 fingerprint of the first user message combined with
message-count proximity matching (threshold=20) to disambiguate forked
sessions that share the same first message. Forked sessions drop message
count significantly (e.g. parent at 600, fork at 300) while normal turns
grow by 2-6 messages per turn.

Removes the entire forced non-streaming path, the marker injection block
in compaction, and the marker scanning from the observer hook. All
responses now stream natively from the first request.
@BYK BYK enabled auto-merge (squash) May 6, 2026 12:38
@BYK BYK merged commit 0c2c5b7 into main May 6, 2026
1 check passed
@BYK BYK deleted the feat/fingerprint-session-tracking branch May 6, 2026 12:38
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