Skip to content

Select latest Codex session by record time - #393

Merged
tsouth89 merged 3 commits into
mainfrom
fix/issue-271
Aug 23, 2026
Merged

Select latest Codex session by record time#393
tsouth89 merged 3 commits into
mainfrom
fix/issue-271

Conversation

@tsouth89

@tsouth89 tsouth89 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Fixes #271.

Codex latest-session summaries now rank each rollout by its newest included record timestamp. File modification time remains the fallback, and equal timestamps use a stable path tie-break.

Checks:

  • cargo fmt --all -- --check
  • cargo test --manifest-path rust/Cargo.toml codex_latest_session

Note

Low Risk
Narrow cost-scanner ranking change with tests; it only affects which session is labeled latest, not totals or auth.

Overview
Codex local cost summaries now treat the latest session as the rollout with the newest transcript timestamp, not the file with the newest mtime. Copying or touching an older rollout no longer displaces a more recent session.

CodexReportRollups ranks by the newest in-range record.timestamp, falls back to file mtime when a transcript has no timestamps, and breaks equal times with a stable path comparison. Tests cover both the mtime-vs-record case and the path tie-break.

Reviewed by Cursor Bugbot for commit dcbd8ce. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Select latest Codex session by transcript record time, not file mtime

Previously, touching or copying an older rollout file could overwrite a newer session in local cost summaries because selection used the file's modified time. The latest field of CodexReportRollups now stores DateTime<Utc> alongside the source PathBuf and CostSummary, and ingest_parsed picks the most recent record.timestamp from the transcript records instead of the filesystem mtime (which becomes a fallback). When two rollouts share the same record timestamp, the lexicographically larger path wins for deterministic ordering.

  • Risk: callers reading CodexReportRollups.latest must handle the new tuple shape (DateTime<Utc>, PathBuf, CostSummary); the in-tree consumer in finish is already updated.

Macroscope summarized dcbd8ce.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ceiling dcbd8ce Commit Preview URL

Branch Preview URL
Aug 23 2026, 06:43 PM

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tsouth89, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9aa74069-9b07-4008-ac44-564ca1e3ed6e

📥 Commits

Reviewing files that changed from the base of the PR and between 3214df1 and dcbd8ce.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • rust/src/cost_scanner.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Aug 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_4d23f453-006e-4919-96fc-bf3862062556)

@cursor

cursor Bot commented Aug 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_38cc736b-dd35-4207-a488-ffc0bb88bd36)

@cursor

cursor Bot commented Aug 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_cc711901-c7b5-44bc-b4b3-bce405ebf8ba)

@tsouth89
tsouth89 merged commit 305265f into main Aug 23, 2026
13 of 14 checks passed
@tsouth89
tsouth89 deleted the fix/issue-271 branch August 23, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select the latest Codex session by record timestamp, not file mtime

1 participant