Skip to content

Conversation

@dedrisian-oai
Copy link
Collaborator

@dedrisian-oai dedrisian-oai commented Oct 8, 2025

There was a regression where we'd read entire rollout contents if there was no /name present.

@chatgpt-codex-connector
Copy link
Contributor

💡 Codex Review

loop {
let slice_start = match (pos > 0, buffer.iter().position(|&b| b == b'\n')) {
(true, Some(idx)) => idx + 1,
_ => 0,
};
let (tail, newest_ts, name_opt) =
collect_last_response_values(&buffer[slice_start..], max_records);
if latest_timestamp.is_none() {
latest_timestamp = newest_ts.clone();
}
if latest_name.is_none() {
latest_name = name_opt.clone();
}
// Continue scanning until we have both a full tail and a latest name,
// or we reach the start of the file.
if (tail.len() >= max_records && latest_name.is_some()) || pos == 0 {
return Ok((tail, latest_timestamp.or(newest_ts), latest_name));

P1 Badge Avoid rescanning entire rollout when no rename exists

The new logic in read_tail_records keeps reading backwards until both the tail is filled and a SessionRenamed event is discovered. For most conversations there is no rename event, so latest_name stays None and the loop runs until pos == 0, effectively reading the entire JSONL file just to return the last 10 responses. get_conversations invokes this for every rollout it touches, so listing rollouts now degrades from O(tail_limit) to O(file_size) I/O per file whenever a name was never set, which can be megabytes per file across thousands of sessions. Consider short‑circuiting once the tail is populated when no rename is required, or bounding the scan with a cap/cached flag so listing sessions does not regress to full file reads.

ℹ️ 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

@dedrisian-oai dedrisian-oai force-pushed the daniel/name-chats-fix-rollout-bug branch 2 times, most recently from 1f87293 to aee5046 Compare October 9, 2025 00:08
@dedrisian-oai dedrisian-oai force-pushed the daniel/name-chats-fix-rollout-bug branch from aee5046 to 03b620a Compare October 9, 2025 00:09
@dedrisian-oai dedrisian-oai changed the title fix: /name long rollout bug revert: /name (for now) Oct 9, 2025
@dedrisian-oai dedrisian-oai changed the title revert: /name (for now) revert: /name for now Oct 9, 2025
@dedrisian-oai dedrisian-oai changed the title revert: /name for now revert /name for now Oct 9, 2025
@dedrisian-oai dedrisian-oai merged commit 4300236 into main Oct 9, 2025
19 checks passed
@dedrisian-oai dedrisian-oai deleted the daniel/name-chats-fix-rollout-bug branch October 9, 2025 00:13
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants