@ogulcancelik/pi-minimal-footer 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +6 -0
  2. package/index.ts +15 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -41,6 +41,12 @@ Usage is fetched:
41
41
 
42
42
  The footer adapts to narrow terminals by stacking lines vertically instead of the single-line wide layout.
43
43
 
44
+ ## Known issues
45
+
46
+ ### Claude Max usage bar not showing
47
+
48
+ Anthropic's OAuth usage endpoint (`/api/oauth/usage`) has been returning persistent 429 (rate limit) errors since late March 2026, affecting all third-party tools that display Claude usage data (CodexBar, oh-my-claudecode, claude-pulse, etc.). This is an Anthropic-side issue — tracked in [claude-code#30930](https://github.com/anthropics/claude-code/issues/30930) and [claude-code#31021](https://github.com/anthropics/claude-code/issues/31021). The usage bar will start working again once Anthropic fixes the endpoint.
49
+
44
50
  ## Notes
45
51
 
46
52
  - Replaces the default pi footer entirely via `ctx.ui.setFooter()`
package/index.ts CHANGED
@@ -783,7 +783,13 @@ export default function (pi: ExtensionAPI) {
783
783
  * changed while the fetch was in flight. */
784
784
  function fetchUsage(modelProvider: string): void {
785
785
  const provider = detectProvider(modelProvider);
786
- if (!provider) return;
786
+ if (!provider) {
787
+ activeProvider = null;
788
+ latestUsage = null;
789
+ stopRefreshTimer();
790
+ tuiRef?.requestRender();
791
+ return;
792
+ }
787
793
 
788
794
  activeProvider = provider;
789
795
 
@@ -794,10 +800,11 @@ export default function (pi: ExtensionAPI) {
794
800
  tuiRef?.requestRender();
795
801
  }
796
802
 
797
- // Fetch fresh in background
803
+ // Fetch fresh in background — keep cached data on transient errors
798
804
  fetchUsageForProvider(provider)
799
805
  .then((u) => {
800
806
  if (!u || activeProvider !== provider) return;
807
+ if (u.windows.length === 0 && u.error && cached?.windows.length) return;
801
808
  usageCache.set(provider, u);
802
809
  latestUsage = u;
803
810
  tuiRef?.requestRender();
@@ -810,10 +817,13 @@ export default function (pi: ExtensionAPI) {
810
817
  if (refreshTimer) clearInterval(refreshTimer);
811
818
  refreshTimer = setInterval(() => {
812
819
  if (activeProvider) {
813
- fetchUsageForProvider(activeProvider)
820
+ const provider = activeProvider;
821
+ const cached = usageCache.get(provider);
822
+ fetchUsageForProvider(provider)
814
823
  .then((u) => {
815
- if (!u) return;
816
- usageCache.set(activeProvider!, u);
824
+ if (!u || activeProvider !== provider) return;
825
+ if (u.windows.length === 0 && u.error && cached?.windows.length) return;
826
+ usageCache.set(provider, u);
817
827
  latestUsage = u;
818
828
  tuiRef?.requestRender();
819
829
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogulcancelik/pi-minimal-footer",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Minimal footer for pi with context gauge and subscription usage bars",
5
5
  "type": "module",
6
6
  "keywords": [