Skip to content

test(server): pin saved-usage test clock so CI stops failing on an aged fixture - #475

Closed
dbalders wants to merge 1 commit into
mainfrom
fix/usage-saved-window-clock-20261102
Closed

dbalders wants to merge 1 commit into
mainfrom
fix/usage-saved-window-clock-20261102

Conversation

@dbalders

@dbalders dbalders commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Summary

Pins the clock in one server test, reports saved usage of a removed directory only for windows it reaches. This is the exact upstream fix (pingdotgg/t3code#28603, 1280ccd0d2). Test-only; one file, 3 lines added and 1 changed.

Why

The test writes a transcript dated 2026-08-01, deletes its folder, and checks that the saved usage still appears for a date range that reaches it. It read with the real clock. Saved usage for deleted files is kept for 92 days, so since 2026-11-01 10:00 UTC the fixture has been past retention. The service correctly drops it, and the test fails Test Server 1 on any PR based on current main (for example #473). Product behavior is unchanged; the test only ever passed because "now" happened to be close to its fixture date.

With "now" pinned to 2026-08-15, the test keeps checking both behaviors:

  • saved usage of a deleted folder is still reported for a date range that reaches it;
  • a later date range shows no usage and the source is missing.

Validation

  • vp check (format and lint), vp run typecheck via vp run check:changed: all passed, including knip and graphql
  • Relevant tests passed: apps/server/src/usage/UsageService.test.ts 40/40. Before this change, the same test failed on dd0d5acfd1 with expected [] to deeply equal [ { day: '2026-08-01', … } ] at line 2470.
  • git diff --check
  • Native mobile lint: not applicable
  • No app run: this changes only a test.

Risk and Recovery

None for users; only a test changes. Revert to restore the previous test.

Release and Deployment Impact

None.

Upstream Alignment

Byte-identical to upstream 1280ccd0d2 (cherry-picked with -x), so the next upstream sync applies cleanly. Upstream's later 8b4de61b8b adds a redundant second setTime before setup; the sync will bring that in.

#474 currently carries its own version of this fix (it.effect pinned to 2026-08-02). Once this lands, #474 can drop that edit and stay UI-only.

Checklist

  • The PR is ready for review and is not a draft
  • The change is focused and avoids unrelated churn
  • New behavior has regression coverage where practical
  • No secrets, credentials, private URLs, or sensitive logs are included
  • Actionable review findings have been resolved or explicitly answered

Implementation: Claude Opus 5.5 via Claude Code

…g after its fixture aged out

The saved-usage window test wrote an August 1, 2026 transcript but read it
with the real clock. Since 2026-11-01 that fixture is older than the 92-day
retention window, so deleted-file usage is correctly pruned and the test
fails on every PR. Pin "now" near the fixture, matching upstream.

(cherry picked from commit 1280ccd0d2a8525c840999fe633cff20ebdeafd5)
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next included review available in 40 minutes.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4429dcc and a57b752.

Files selected for processing: 1
  • apps/server/src/usage/UsageService.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@dbalders

dbalders commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner Author

Cross-model review blocked: authentication

Implementation (PR footer): Claude Opus 5.5 via Claude Code
Reviewer: Codex gpt-6.1-sol (high)
Commit: a57b752e1cd877acad2d595426cc50dcf1a5b1ff

The review did not finish, so no verdict was produced. Reason: ReviewAuthenticationError: codex authentication was rejected during review on the review service. No review verdict was produced.

Sign in to the reviewer on the review service host, then comment /cross-review to retry. For Claude, run claude auth login --claudeai; for Codex, run codex login.


Automated cross-model review, updated 2026-11-02T18:25:02+00:00.

@github-actions github-actions Bot added the size:XS 0-9 effective changed lines (test files excluded in mixed PRs). label Nov 2, 2026

@dbalders dbalders left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

TritonAI Review

Model: api-glm-5.3 · Reasoning: high.

No actionable findings in the inspected changes.

Reviewed a57b752e1cd877acad2d595426cc50dcf1a5b1ff against 4429dcc73fb933cb1c76ecf70997e144f67ce396.

Reviewed 1 file(s) together as one PR.

Changes

  • PR: This PR is a minimal, test-only change that pins the clock in one UsageService test (reports saved usage of a removed directory only for windows it reaches). A TestClock.setTime to 2026-08-15 is added after setup, and the test's pipe gains Effect.provide(TestClock.layer()) so the service's retention/pruning logic sees the pinned

CI snapshot

Check runs:
- Sync PR size label definitions: status=completed conclusion=skipped app=
- Label PR size: status=completed conclusion=success app=
- Windows Regression Tests: status=in_progress conclusion=none app=
- Macroscope - Effect Service Conventions: status=completed conclusion=skipped app=
- Macroscope - Correctness Check: status=completed conclusion=skipped app=
- CodeRabbit: status=completed conclusion=neutral app=
- Prepare PR size config: status=completed conclusion=success app=
- Test: status=queued conclusion=none app=
- Test Server 4: status=queued conclusion=none app=
- Test Server 3: status=queued conclusion=none app=
- Test Server 1: status=in_progress conclusion=none app=
- Test Server 2: status=in_progress conclusion=none app=
- Test Server 5: status=queued conclusion=none app=
- Preflight: status=queued conclusion=none app=
- Mobile Native Changes: status=queued conclusion=none app=
- Release Smoke: status=in_progress conclusion=none app=
- Rust: status=completed conclusion=success app=
- Native fingerprint diff: status=completed conclusion=success app=
- Windows Test Scope: status=completed conclusion=success app=

CI is reported separately. This code review does not claim to have run tests.

Comment /triton-review to request a fresh review. Findings are advisory; GitHub branch protection remains authoritative.

@dbalders

dbalders commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

/cross-review

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB −7 B (−0.1%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB −7 B (−0.6%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB +7 B (+0.1%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB +7 B (+0.6%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 4429dcc · PR result: a57b752 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@dbalders

dbalders commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Note

🤖 Claude Opus 5.5 responding on behalf of David

Closing as superseded: #474 (squash 4429dcc) already put a clock fix for this test on main (it.effect, clock set to 2026-08-02T12:00Z). David chose to keep that version. The next upstream sync will hit a 3-line conflict here against upstream 1280ccd0d2; resolve it by taking upstream's version. The branch is kept.

@dbalders dbalders closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 effective changed lines (test files excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant