Skip to content

fix: Fall back to window duration for Claude and clear TUI buffer - #31

Merged
euxaristia merged 1 commit into
mainfrom
fix/claude-session-duration-fallback
Aug 14, 2026
Merged

fix: Fall back to window duration for Claude and clear TUI buffer#31
euxaristia merged 1 commit into
mainfrom
fix/claude-session-duration-fallback

Conversation

@euxaristia

@euxaristia euxaristia commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

Falls back to window duration (5h 0m) when Claude's session resets_at is null or unset, and explicitly clears the terminal buffer on TUI launch and redraws to prevent ghost text artifacts.

Changes

  • Added format_duration in src/time.rs to format durations in seconds as countdown strings.
  • Updated Bucket::into_window in src/parsers/claude.rs to use format_duration(seconds) when resets_at is null or missing.
  • Updated src/tui.rs to call terminal.clear() on startup and on resize, and rendered Clear over the frame and panel areas to wipe dirty terminal cells.
  • Updated Claude parser unit tests to assert duration fallback instead of Unknown.

Refs #30
Fixes #30

Test plan

  • Ran cargo fmt --check (clean)
  • Ran cargo clippy --all-targets --all-features -- -D warnings (clean)
  • Ran cargo test (155 tests passing)
  • Ran limits and verified the TUI launches cleanly with no terminal buffer bleed-through

When no session quota has been consumed, Anthropic omits resets_at. Format the window duration rather than displaying Unknown.

Refs #30
@euxaristia

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a6a316ed-5237-4bb8-86d7-f9f4e8a22bc4

📥 Commits

Reviewing files that changed from the base of the PR and between 350d208 and b65a123.

📒 Files selected for processing (2)
  • src/parsers/claude.rs
  • src/time.rs

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

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 22 minutes.

@euxaristia
euxaristia marked this pull request as ready for review August 14, 2026 20:41
@euxaristia
euxaristia merged commit 0c73cc2 into main Aug 14, 2026
0 of 4 checks passed
@euxaristia
euxaristia deleted the fix/claude-session-duration-fallback branch August 14, 2026 20:41
@euxaristia euxaristia changed the title fix(parsers): Fall back to window duration when Claude resets_at is unset fix: Fall back to window duration for Claude and clear TUI buffer Aug 14, 2026
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.

Fall back to window duration when Claude session resets_at is unset

1 participant