From acb1282966b859db37326a0bc30d67f1d7df08fa Mon Sep 17 00:00:00 2001 From: StuBehan Date: Fri, 17 Jul 2026 20:19:14 +0100 Subject: [PATCH] fix(usage): locate claude in ~/.local/bin; drop stale codex tiers --- panel/CodexUsage.swift | 6 ++++++ panel/ProcessOutput.swift | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/panel/CodexUsage.swift b/panel/CodexUsage.swift index dd0f92f..6f6d896 100644 --- a/panel/CodexUsage.swift +++ b/panel/CodexUsage.swift @@ -107,6 +107,12 @@ final class CodexQuotaProbe { let used = (dict["used_percent"] as? NSNumber)?.doubleValue else { return nil } let resetsAt = (dict["resets_at"] as? NSNumber) .map { Date(timeIntervalSince1970: $0.doubleValue) } + // A window whose reset time has already passed has since rolled over; + // the captured used_percent is stale and no longer reflects the current + // window. Drop it so the Usage tab doesn't show old numbers with a + // "resets N days ago" (happens when Codex hasn't run recently and the + // newest rollout is older than its own rate-limit window). + if let resetsAt, resetsAt < Date() { return nil } return QuotaTier(utilization: used, resetsAt: resetsAt) } } diff --git a/panel/ProcessOutput.swift b/panel/ProcessOutput.swift index 7687821..63d85a0 100644 --- a/panel/ProcessOutput.swift +++ b/panel/ProcessOutput.swift @@ -64,12 +64,13 @@ enum ProcessOutput { .first { FileManager.default.isExecutableFile(atPath: $0) } } - // Resolve the `claude` CLI. Same minimal-PATH rationale as gh(); the - // ~/.claude/local fallback covers users who installed via the curl-bash - // installer rather than Homebrew. + // Resolve the `claude` CLI. Same minimal-PATH rationale as gh(). The + // native installer (current default) symlinks into ~/.local/bin; the + // ~/.claude/local fallback covers the older curl-bash/migration installer. static func claude() -> String? { let home = NSHomeDirectory() return [ + "\(home)/.local/bin/claude", "/opt/homebrew/bin/claude", "/usr/local/bin/claude", "\(home)/.claude/local/claude",