Skip to content

Change the identifier of stored subscription information by account#133

Merged
kargnas merged 1 commit intomainfrom
codex-account-scoped-subscriptions
May 4, 2026
Merged

Change the identifier of stored subscription information by account#133
kargnas merged 1 commit intomainfrom
codex-account-scoped-subscriptions

Conversation

@kargnas
Copy link
Copy Markdown
Member

@kargnas kargnas commented May 4, 2026

Summary

  • Store subscription settings under account-scoped keys in the form subscription_v2.<provider>.<account>.
  • Use _default_ when no email or stable account ID is available.
  • Ignore legacy provider-level and invalid subscription keys instead of migrating them into current totals.
  • Resolve subscription menu account IDs from email first, then account ID, then default scope.

Impact

This prevents stale provider-level or malformed legacy subscription settings from being counted in monthly quota totals, while keeping account-specific subscription configuration available for multi-account providers.

Validation

  • make setup
  • xcodebuild test -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor -destination 'platform=macOS' -only-testing:CopilotMonitorTests/ProviderUsageTests - 27 tests passed
  • make lint-swift - 0 violations
  • Cleared DerivedData and rebuilt with xcodebuild build -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor -configuration Debug -destination 'platform=macOS'
  • Relaunched the Debug app and confirmed /tmp/provider_debug.log prints account/default subscription scope logs

@kargnas kargnas changed the title [codex] Scope subscription settings by account Scope subscription settings by account May 4, 2026
@kargnas kargnas marked this pull request as ready for review May 4, 2026 08:53
@kargnas kargnas changed the title Scope subscription settings by account Change the identifier of stored subscription information by account May 4, 2026
@kargnas kargnas merged commit 09931b4 into main May 4, 2026
11 of 12 checks passed
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.

1 participant