feat(usage_limits): add {reset_at} absolute reset-time placeholder#192
Merged
Merged
Conversation
The existing {reset} placeholder only shows time-until-reset (e.g.
4h12m), which forces a mental "what time is that" calculation. Add
{reset_at} alongside it for the five-hour, seven-day, and per-model
usage_limits formats, rendering the absolute local clock time instead:
clock-only if the reset falls on today's local date (7:42 PM), weekday-
prefixed otherwise (Mon 9:00 AM). Mirrors {reset}'s None/past handling
(? / now).
Local-time/DST conversion has no portable std API, so this adds chrono
(clock feature only) rather than hand-rolling timezone arithmetic.
Updates docs/configuration.md (placeholder table + example) and the
repo's own cship.toml showcase config to demonstrate {reset_at} in both
formats.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Confirmed the 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Owner
|
Thank you for your submission! |
stephenleo
added a commit
that referenced
this pull request
Jun 29, 2026
#192 (the {reset_at} usage_limits placeholder) landed on main but was omitted from the release notes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
stephenleo
added a commit
that referenced
this pull request
Jun 29, 2026
- Bump crate version to 1.8.0
- Promote the Unreleased changelog section to [1.8.0], including the
previously-omitted {reset_at} entry (#192)
- Drop {reset_at} from the cship.toml showcase usage_limits formats
Ships the security fix (#191), the breaking cost-duration formatting
change, and the new effort (#187) and account (#153) modules.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
stephenleo
added a commit
that referenced
this pull request
Jun 29, 2026
- Bump crate version to 1.8.0
- Promote the Unreleased changelog section to [1.8.0], including the
previously-omitted {reset_at} entry (#192)
- Drop {reset_at} from the cship.toml showcase usage_limits formats
Ships the security fix (#191), the breaking cost-duration formatting
change, and the new effort (#187) and account (#153) modules.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Adds a
{reset_at}placeholder to$cship.usage_limits(five-hour, seven-day, and per-model formats), giving an absolute local clock time alongside the existing relative{reset}countdown.7:42 PM), weekday-prefixed otherwise (e.g.Mon 9:00 AM);?when the reset time is unknown,nowwhen it's already past. Mirrors{reset}'sNone/past handling.chrono(clockfeature only). Std has no portable local-timezone/DST API, and hand-rolling that conversion is a correctness trap;chrono::Localis the standard, minimal way to get it right.format_output(five-hour/seven-day sections) andformat_single_model(per-model breakdown) alongside the existing{pct}/{remaining}/{reset}/{pace}substitutions.docs/configuration.mdplaceholder table + example block, andcship.toml(repo's own showcase config) updated to demonstrate{reset_at}in both formats.Verification
cargo fmt --check✅cargo clippy -- -D warnings✅cargo test✅ (476 unit + 73 integration)cargo build --release✅🤖 Generated with Claude Code