Repository navigation
Explain an expired Claude sign-in instead of hiding the limits - #6795
Merged
Merged
Conversation
Only the Claude Code CLI can refresh the OAuth token it saves; the collector just reads it. A machine left alone long enough finds the token lapsed, and that branch returned an empty limits list with no status text at all, so the panel hid its whole limits section and explained nothing. Say what is wrong, and fall back to the cached limits already on disk rather than discarding them. Cached windows are kept only until they reset: a percentage from a window that has rolled over describes a period that is over, and pinning a stale 78% on an allowance that is now untouched would be worse than showing nothing. The probe-failure path gets the same filtering for the same reason. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Improves Claude usage reporting when OAuth credentials expire while preserving valid cached limits.
Changes:
- Reports expired sign-ins with actionable authentication guidance.
- Filters cached limits whose reset windows have elapsed.
- Adds coverage for expired, missing, and unreachable credential states.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bin/omarchy-agent-usage-claude |
Adds expiry messaging and valid-cache fallback behavior. |
test/shell.d/agent-usage-claude-limits-test.sh |
Tests credential states and cache-window filtering. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Aug 24, 2026
This was referenced Sep 3, 2026
nick1udwig
pushed a commit
to nick1udwig/omarchy
that referenced
this pull request
Sep 9, 2026
…m#6795) Only the Claude Code CLI can refresh the OAuth token it saves; the collector just reads it. A machine left alone long enough finds the token lapsed, and that branch returned an empty limits list with no status text at all, so the panel hid its whole limits section and explained nothing. Say what is wrong, and fall back to the cached limits already on disk rather than discarding them. Cached windows are kept only until they reset: a percentage from a window that has rolled over describes a period that is over, and pinning a stale 78% on an allowance that is now untouched would be worse than showing nothing. The probe-failure path gets the same filtering for the same reason. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
The agents panel showed no limits for Claude, and no error either.
Only the Claude Code CLI can refresh the OAuth token it saves in
.credentials.json;omarchy-agent-usage-claudeonly reads it. Leave amachine alone long enough and the saved token lapses, and that branch
returned an empty
limitslist withusageStatusTextunset — so the panel'slimits section (
visible: root.limits.length > 0) disappeared with nothingto explain it.
Now it says so, and keeps showing the numbers it already has:
the hero line and the urgent box it already uses for every other failure.
missing token falls back to the last known limits instead of throwing away
what is on disk.
window describes a period that is over, so an expiry during a week away would
otherwise pin a stale
78%on an allowance that is now untouched. Entrieswith no reset time, or an unparseable one, are kept. The probe-failure path
gets the same filtering for the same reason.
Verification
Eight new cases drive
collect_limitsover a planted cache with the networkstubbed unreachable, so only the credential state decides the answer. Full
suite passes (166 files).
Checked in the running shell by planting the real expired-branch output into
the usage record while the panel was open: the hero reads
SIGN-IN EXPIREDinplace of
MAX 20X, the help box wraps without clipping, and the cached limitrows still render with their countdowns.
🤖 Generated with Claude Code