fix: normalize startup session ordering across mixed timestamp formats#263
Merged
Robdel12 merged 3 commits intoRobdel12:mainfrom May 5, 2026
Merged
Conversation
0fbebfa to
42b0a1b
Compare
Use started_at as the final startup restore tiebreaker, keep the merged Codex router helper in rustfmt shape, and bump the Rust CI cache key so stale target artifacts do not poison GitHub runs.
42b0a1b to
c87f35e
Compare
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.
Summary
Root Cause
load_sessions_for_startup()was ordering sessions with SQLite expressions likeCAST(REPLACE(timestamp, 'Z', '') AS INTEGER).That works for unix-style values such as
1776438552Z, but breaks for RFC3339 values such as2026-05-01T14:10:34Z, which collapse to2026when cast to an integer in SQLite.That lets older unix-style rows sort ahead of newer ISO timestamp rows, which can make recent sessions look stale in the library.
Fix
Ztimestamps when availablelast_progress_at, then parsedlast_activity_at, thenstarted_atValidation
Zrowcargo testhad to start by downloading the pinned Rust toolchain fororigin/mainCloses #262