Skip to content

Avoid counting duplicate Muse session events - #2

Merged
andresantonioriveros merged 1 commit into
andresantonioriveros:add-muse-usage-collectorfrom
nissuor:codex/muse-usage-dedup
Sep 8, 2026
Merged

andresantonioriveros merged 1 commit into
andresantonioriveros:add-muse-usage-collectorfrom
nissuor:codex/muse-usage-dedup

Conversation

@nissuor

@nissuor nissuor commented Sep 8, 2026

Copy link
Copy Markdown

Repeated native completion records and .msp-view session copies currently inflate Muse token and prompt totals. This deduplicates valid completions by record ID across session files and retained-frame children, and excludes .msp-view* directories inside the sessions tree.

Records without a usable ID remain countable, and metadata or malformed usage cannot claim an ID before a valid completion. The scan-cache version is bumped so previously inflated totals are rescanned. Existing opencode, subscription, and PAYG behavior is preserved.

This targets add-muse-usage-collector for inclusion in omacom#10610, following our collaboration discussion. No revert of the subscription-window commit is needed. Hiding cached limits after a failed probe can be reviewed separately.

Validation:

  • New deduplication regression test fails before the fix and passes afterward; covers plain records, retained frames, copied sessions, view directories, missing/malformed IDs, and old scan caches.
  • Existing Muse scanner and limits suites pass.
  • git diff --check passes. Ran ./test/all with the desktop environment variables unset: CLI passes; the shell suite has the same five failures previously reproduced on an untouched upstream snapshot. config-test.sh, snapper-test.sh, and unowned-system-paths-test.sh need a missing sibling omarchy-pkgs checkout; launch-about-test.sh fails its roomy-window animation assertion; locate-test.sh tries to decode generated Python bytecode as UTF-8.

@andresantonioriveros
andresantonioriveros merged commit 317a5e5 into andresantonioriveros:add-muse-usage-collector Sep 8, 2026
@nissuor
nissuor deleted the codex/muse-usage-dedup branch September 8, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants