Repository navigation
[companion] fix(sessions): find the first user message past injected context - #94
andrebrait wants to merge 3 commits into
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The extended scan addresses long injected context, and no actionable merge-blocking risk remains after normal checks. Pre-merge checks |
|
|
@codex review |
1 similar comment
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@coderabbitai review |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bc41e8f42
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| function scanFirstUserMessage(filePath: string): string { | ||
| const [window, , size] = readTextSlices(filePath, SESSION_FIRST_MESSAGE_SCAN_BYTES, 0); |
There was a problem hiding this comment.
Continue past 256 KiB to find the first user message
When injected rules, skills, or recalled memory exceed 256 KiB, this bounded read never examines the first user entry; the subsequent fallback only checks the original 4 KiB prefix. Such sessions are therefore listed as (no messages), cannot be found by prompt text, and the documented auto-name fallback can incorrectly return session_no_messages_to_name. Scan JSONL entries until the first textual user message is found while bounding only the retained result, rather than the input offset.
AGENTS.md reference: AGENTS.md:L221-L225
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 57b2e32: the scan now streams lines until the first textual user entry, with no fixed read window. forEachFileLineSync stops when its callback returns false. A regression case covers a user entry behind 300 KB of injected context.
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.
|
@codex review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…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.
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Upstream kahme247#243 merged. |
Review companion for kahme247#243: same head branch, base pinned to the same upstream/main commit (
05fb0a8), so the diff is identical. Bot reviews only; merge happens upstream.Summary by CodeRabbit