Skip to content

feat(accounts): add account priorities#545

Open
cani1989 wants to merge 21 commits intoSoju06:mainfrom
cani1989:codex/issue-540-account-priority
Open

feat(accounts): add account priorities#545
cani1989 wants to merge 21 commits intoSoju06:mainfrom
cani1989:codex/issue-540-account-priority

Conversation

@cani1989
Copy link
Copy Markdown

@cani1989 cani1989 commented May 4, 2026

fixes #540

Summary

  • add account priority levels (gold, silver, bronze) end-to-end across API, DB, proxy selection, and dashboard/account views
  • keep priorities behind a settings toggle so the feature can be enabled or disabled without changing account data
  • add a per-account priority editor in the accounts page and priority-aware sorting in the dashboard/accounts list

Why

Priority-aware selection makes it possible to prefer certain accounts before falling back to usage/reset-based ordering. The settings toggle keeps the new behavior opt-in, while still letting admins assign and change priorities independently of routing strategy.

Validation

  • npm test -- --run src/features/accounts/components/accounts-page.test.tsx
  • npm test -- --run src/features/dashboard/components/account-cards.test.tsx src/features/dashboard/components/account-card.test.tsx
  • backend integration/unit coverage added for account priority updates, dashboard ordering, settings persistence, and load-balancer selection

@cani1989 cani1989 changed the title Add account priorities feat(accounts): add account priorities May 4, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59cd4febe4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/modules/accounts/repository.py Outdated
Comment thread app/db/alembic/versions/20260503_000000_add_accounts_priority.py Outdated
@cani1989 cani1989 mentioned this pull request May 4, 2026
@Komzpa
Copy link
Copy Markdown
Contributor

Komzpa commented May 6, 2026

I checked this against a smaller manual account-routing change for the same operator need: #553. There is real overlap in the core routing feature:

  • this PR adds per-account gold / silver / bronze priority
  • feat(accounts): add manual routing policy #553 uses explicit routing intent: burn_first / normal / preserve
  • both approaches select from the manually preferred eligible pool before the normal usage/reset/capacity strategy

The main difference is scope. This PR also includes reset-display/account-list work, quota display appearance settings, Docker/dev-deploy changes, and dashboard sorting. Those may be useful, but they make the routing behavior harder to review as one unit.

For mergeability, I think the account-routing part should be either split into a focused PR, or kept here with a clear OpenSpec delta for the selection contract:

  • manual priority applies after hard eligibility gates
  • it does not bypass model plan or additional-quota filtering
  • preserved/low-priority accounts are fallback-only while other eligible accounts exist

One naming note: UI labels like Burn first, Normal, Preserve may be clearer than medal labels, because “gold” can read as either “best account” or “most valuable account to protect”.

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.

Account priority

2 participants