Skip to content

Conversation

@jif-oai
Copy link
Collaborator

@jif-oai jif-oai commented Jan 28, 2026

No description provided.

@jif-oai
Copy link
Collaborator Author

jif-oai commented Jan 28, 2026

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de1e384b6e

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

Comment on lines +148 to +152
rollout_paths.sort_by_key(|(path, _archived)| {
let parsed = path
.file_name()
.and_then(|name| name.to_str())
.and_then(parse_timestamp_uuid_from_filename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep archived copies from being overwritten on backfill

This sort ignores the archived flag and sort_by_key is not stable, so if the same rollout file exists in both sessions and archived_sessions (e.g., an interrupted archive move or manual copy), the unarchived copy can be processed last and upsert_thread will overwrite the archived record, clearing archived_at. Previously the loop order guaranteed archived files were applied after sessions. Consider including archived in the sort key (or preserving the original root ordering) so archived copies always win when duplicates exist.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant

Copy link
Contributor

@gt-oai gt-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are just going to go into SQLite then it's not clear to me why this matters...?

@jif-oai
Copy link
Collaborator Author

jif-oai commented Jan 28, 2026

If these are just going to go into SQLite then it's not clear to me why this matters...?

Because we do this backfill only once so if people close codex directly after starting it, we still one the most recent files to be in

@jif-oai jif-oai changed the title feat: store metadata by date feat: sort metadata by date Jan 28, 2026
@jif-oai jif-oai merged commit 231406b into main Jan 28, 2026
32 checks passed
@jif-oai jif-oai deleted the jif/sort-rollouts branch January 28, 2026 15:19
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2026
@gt-oai
Copy link
Contributor

gt-oai commented Jan 28, 2026

If these are just going to go into SQLite then it's not clear to me why this matters...?

Because we do this backfill only once so if people close codex directly after starting it, we still one the most recent files to be in

Oh okay, would make sense as a comment then. Or fixing the underlying problem which is that backfill can be interrupted and not restarted. Otherwise we'll get bug reports of people not knowing this backfill was happening, killing Codex, and then missing sessions?

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.

3 participants