Skip to content

Fix cost_scanner token-count test that ages out of the 30-day window - #110

Merged
Finesssee merged 1 commit into
nesszer:mainfrom
darknight105:fix/cost-scanner-flaky-date
Jul 2, 2026
Merged

Finesssee merged 1 commit into
nesszer:mainfrom
darknight105:fix/cost-scanner-flaky-date

Conversation

@darknight105

Copy link
Copy Markdown

Standalone fix split out of #108 per review.

cost_scanner::tests::parses_current_codex_payload_token_count_events writes a fixture event dated 2026-05-27 and scans with a 30-day window, so it fails with 0 sessions once that date is more than 30 days old (it fails on main today). The fixture timestamp is now computed relative to now, so the event always lands inside the window.

The test wrote a fixture event with a hardcoded 2026-05-27 timestamp and
scanned with a 30-day window, so it silently began failing (0 sessions
instead of 1) once that date fell more than 30 days in the past. Use a
timestamp relative to now so the event always lands inside the window.
darknight105 added a commit to darknight105/Win-CodexBar that referenced this pull request Jul 2, 2026
Resolved conflicts:
- main.rs: take upstream's startup-reveal timing (VISIBLE_START_ACTIVATION_DELAY
  500ms + new STARTUP_TRAY_BLUR_GRACE const).
- transition.rs: keep upstream's new mark_tray_panel_shown fn alongside the
  dead_code annotation on the (still-unused) tray-reveal fallback.
- Thread SurfaceMode through upstream's two new
  apply_window_layout(TrayPanel, ...) callers to match the refactored signature.

Verified on the merged tree: desktop-tauri 256/0, frontend tsc + vitest 111/0,
core lib 442 pass. The cost_scanner flaky test is split to PR nesszer#110.

@Finesssee Finesssee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thermo-nuclear code-quality review: approved. This is the right shape for the fix: one isolated test fixture timestamp, no production-path branching, no new abstraction, no file-size or layering regression. The relative timestamp keeps the test inside the scanner's existing 30-day window without changing scanner behavior. Focused validation: cargo test --manifest-path rust\Cargo.toml cost_scanner::tests::parses_current_codex_payload_token_count_events --quiet.

@Finesssee
Finesssee merged commit 558a5dc into nesszer:main Jul 2, 2026
2 checks passed
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.

2 participants