Repository navigation
fix(sessions): find the first user message past injected context - #243
Merged
andrebrait merged 3 commits intoOct 10, 2026
Merged
Conversation
omp writes rules, skills and memory-recall entries before the first user message, which pushes it past the 4 KiB list-scan prefix. The sidebar then showed "(no messages)" and auto-name refused with no messages to name until omp set a title. When the prefix has no user message, scan up to 256 KiB.
Injected context larger than 256 KiB still hid the first user message. Stream lines until the first textual user entry instead; forEachFileLineSync now stops when onLine returns false.
…iling The streaming scan read oversized files whose prefix has no user message, and a line past the JS string cap threw, so scanSessionInfo dropped the session and its route returned 404 instead of 413.
andrebrait
added a commit
to andrebrait/ompweb
that referenced
this pull request
Oct 10, 2026
…cted context Squashed from origin/fix/session-first-message-scan (08a6929) onto upstream/main.
andrebrait
added a commit
to andrebrait/ompweb
that referenced
this pull request
Oct 10, 2026
…cted context Squashed from origin/fix/session-first-message-scan (08a6929) onto upstream/main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
omp writes injected context (rules, skills, memory recall) into a session file before the first user message. That pushed the message past the 4 KiB prefix that
scanSessionInfoparses, so a new session's sidebar title fell back to(no messages), and the auto-name button refused with "no user messages to name" until omp wrote its own title.When the prefix holds no user message,
scanSessionInfonow streams the file line by line until the first user entry. Torn lines are skipped, and the result is capped at 4 KiB because the session list ships it for every session. Results stay memoized by size and mtime.Verification: a regression test in
lib/session-reader.test.mjscovers the injected prefix, a torn line before the user entry, and a 300 KB first message. It failed before the fix and passes after. Real affected session files now reportIntegrate and deployinstead of(no messages).