Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions panel/CodexUsage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
7 changes: 4 additions & 3 deletions panel/ProcessOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down