Repository navigation
Conversation
pi and oh-my-pi sessions are currently folded into the Claude and Codex collectors, which only count Anthropic and openai-codex providers. Users on any other backend (OpenRouter, Kimi, etc.) never see their usage in the agents panel. Add bin/omarchy-agent-usage-pi to scan ~/.pi and ~/.omp sessions for any provider, and stop counting those sessions in the Claude and Codex collectors. Fixes omacom#8270 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Make local usage caching date-aware, optional and safe after empty or failed refreshes. Validate transcript records, discover configured session roots and profiles, and deduplicate inherited responses without conflating independent short IDs or mutable billing fields. Invalidate pre-split Codex caches, label Pi as local usage, and cover the regressions in both UTC and UTC+14. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Pushed f481aa5 after a deeper audit. Added cache/date/write-failure regressions, malformed-record handling, configured roots/profiles, fork and physical-alias deduplication, and Codex cache-transition coverage. All 25 Pi tests plus the original assertions pass in UTC and UTC+14; adjacent collector/updater tests and the CLI suite pass in isolated Linux. The description documents validation limits and overlap with #8602, #9546, #8345 and #8649. Pi is labeled Local usage; no quota or cost is inferred. |
Co-Authored-By: Saurabh Suri <[email protected]>
Co-Authored-By: Saurabh Suri <[email protected]>
[Medium impact] The PR appears safe to merge, with one non-blocking improvement to the cache regression test. Findings
SummaryAdds a dedicated Pi/OMP record for usage across all backends.
|
|
Adding a concrete data point in favor of this landing. Setup: Omarchy 4.0.4-1, Hyprland/Quickshell, 170 session files under Why the current collectors show nothing for me. rg --json -e '"provider"\s*:\s*"openai-codex"' -e '"api"\s*:\s*"openai-codex'My Pi sessions route to non-OpenAI backends through a local router, so nothing under On the labelling. One practical blocker. The PR is currently Happy to build the branch and report back with real numbers from a Pi install — record shape, per-model buckets, and whether the fork/lineage dedupe holds across resumed sessions — if that helps move it along. |
Co-Authored-By: Saurabh Suri <[email protected]>
| identity = str(self.home) + '\n' + str(self.home / '.codex') + '\n' + str(db) | ||
| old_cache = self.cache.parent / ('codex-scan-' + hashlib.sha1(identity.encode()).hexdigest()[:16] + '.json') | ||
| old_cache.parent.mkdir(parents=True, exist_ok=True) | ||
| old_cache.write_text(json.dumps({'schemaVersion': 1, 'scanDate': namespace['today'], 'stats': stats})) |
There was a problem hiding this comment.
test_codex_cache_from_before_pi_split_is_ignored writes schemaVersion: 1, but the Codex collector already required version 2 before this PR. The test therefore passes even if the new cache namespace is removed, leaving that change unprotected. Write version 2 in this fixture so the test catches reuse of old totals containing Pi usage.
| old_cache.write_text(json.dumps({'schemaVersion': 1, 'scanDate': namespace['today'], 'stats': stats})) | |
| old_cache.write_text(json.dumps({'schemaVersion': 2, 'scanDate': namespace['today'], 'stats': stats})) |
Summary
Fixes #8270.
Add a dedicated local Pi/Oh My Pi usage record for every backend, including OpenRouter. Claude and Codex no longer aggregate Pi/OMP transcripts; native and opencode collection remains intact.
Changes
Validation
Coordination
Related active work: #8602 (fork deduplication), #9546 (profiles), #8345 (roots/cache identity), and #8649 (OMP collector). After this split, Pi fixes must target the dedicated collector rather than unused Claude/Codex Pi scanners. Agree on OMP ownership before adding another record.
Generated with Devin