Skip to content
Open
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: 1 addition & 5 deletions bin/omarchy-agent-usage-claude
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Everything the agents panel shows for Claude comes from this one
command: local transcript stats from ~/.claude/projects, the stats-cache and
history fallbacks for machines without transcripts, pi/omp and opencode
history fallbacks for machines without transcripts, opencode
sessions that ran on an Anthropic provider, and the authoritative rate
limits from Anthropic's OAuth usage endpoint. The panel itself only ever
reads the JSON this prints; it never talks to disk formats or endpoints.
Expand Down Expand Up @@ -1234,10 +1234,6 @@ def main() -> int:
if today_prompts or today_sessions:
stats = dict(stats, todayPrompts=today_prompts, todaySessions=today_sessions)

pi_usage = scan_pi_usage(scan_age)
if pi_usage is not None:
stats = merge_stats(stats, pi_usage)

opencode = scan_opencode_usage(scan_age)
if opencode is not None:
stats = merge_stats(stats, opencode)
Expand Down
15 changes: 7 additions & 8 deletions bin/omarchy-agent-usage-codex
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# omarchy:hidden=true
"""Collect Codex usage into one display-ready JSON record.

Local stats come from native Codex CLI session files, pi/omp sessions that
ran through openai-codex, and opencode sessions that ran on an OpenAI
provider; rate limits and the plan come from the Codex app-server RPC. The agents
panel only ever reads the JSON this prints.
Local stats come from native Codex CLI session files and opencode sessions
that ran on an OpenAI provider; rate limits and the plan come from the Codex
app-server RPC. Pi/OMP local stats belong to the dedicated Pi collector.
The agents panel only ever reads the JSON this prints.
"""

import argparse
Expand Down Expand Up @@ -545,9 +545,9 @@ def cache_root():
def scan_cache_digest():
codex_home = Path(os.environ.get("CODEX_HOME") or (Path.home() / ".codex"))
db = Path(os.environ.get("XDG_DATA_HOME") or (Path.home() / ".local" / "share")) / "opencode" / "opencode.db"
# The digest covers every data path the scan reads: the codex session
# roots, the opencode DB, and (via Path.home()) the pi/omp session roots.
return hashlib.sha1((str(Path.home()) + "\n" + str(codex_home) + "\n" + str(db)).encode("utf-8")).hexdigest()[:16]
# The digest covers the codex session roots and the opencode DB; its
# namespace excludes caches from before Pi/OMP moved to their own collector.
return hashlib.sha1(("native-opencode\n" + str(Path.home()) + "\n" + str(codex_home) + "\n" + str(db)).encode("utf-8")).hexdigest()[:16]


def scan_cache_paths():
Expand Down Expand Up @@ -706,7 +706,6 @@ def local_stats():
def run_local_scans(max_age):
cached_files = read_file_cache() if max_age > 0 else {}
scanned_files = {}
scan_pi_sessions()
scan_native_codex_sessions(cached_files, scanned_files)
complete = scan_opencode_sessions()
write_file_cache(scanned_files)
Expand Down
Loading
Loading