[Feature Request] Usage-based automatic user group assignment with rolling-window recalculation
[Feature Request] Usage-based automatic user group assignment with rolling-window recalculation
Agent
- Tool: OpenAI Codex desktop app; tool version and exact model variant are not exposed to this session.
- Model: GPT-6 family; Host: desktop app. Date: 2026-11-15 UTC.
User request
- English translation, as explicitly requested by the user: "Create issues for them, in English and properly written."
- Later constraint, translated: "Do not use our product-specific group name."
- Context: request native assignment of ordinary users to groups based on actual consumption, including automatic upgrades and downgrades.
Out of scope — refuse
- Matched: no. This is a native user-management feature request, not a relay/provider compatibility report or third-party deployment incident.
File gate — do not file unless all are satisfied
- Scope: native product feature. Current source, documentation and related threads were reviewed; no runtime failure is claimed. File: yes.
Kind
- [x] Feature
Usage / configuration / integration check
- Official documentation: searched Group Management, Ratio Settings and automatic group order. These describe pricing, access and routing failover, rather than a rolling-consumption user-group policy.
- README/repository: reviewed the official README and the source paths below.
- Current capability: group ratios and ordered automatic routing are present; I did not find a native rolling-window user-group evaluator in the reviewed paths.
- Verdict: request maintainer alignment on a new optional feature, not configuration support.
Environment
- Source reviewed:
v1.0.0-rc.51, commitc9c6da2786b6a0912215127e78e28fbc6650c85f. - Main cross-check:
57345547be11b8cc0d58252622d7319545fc6fdd;setting/auto_group.goandservice/group.gomatch rc.51. - Deploy source: unmodified official repository source review; no deployed reproduction claimed. Database: not applicable to this feature proposal.
Problem facts
- Actual behavior:
GetUserAutoGroupfilters an ordered routing-group list; it does not calculate a user's spending window or assign their account group. - Impact: operators wanting consumption-based group assignment need a separate scheduler and policy engine.
- Frequency: a persistent capability gap in the reviewed source, not an intermittent production incident.
- Evidence: the distinction follows from the linked routing and ratio implementations.
Type-specific details
Relay / API
Not applicable: no provider request or protocol failure is reported.
Billing
No incorrect charge is alleged. Finalized consumption and its corrections would be inputs to the proposed policy; prepaid deposits should not be assumed to equal consumption.
Frontend
Not applicable: no browser/UI defect is reported.
Deployment / upgrade
Not applicable: no deployment failure or database-specific reproduction is claimed.
Reproduction and expected result
- Source inspection: follow
GetUserAutoGroupandGetRequestAutoGroups; they select allowed routing groups, not account groups based on consumption. - Expected new behavior: an opt-in policy can assign an ordinary user's group from confirmed net consumption over a configurable rolling window. When old spending leaves the window, recalculation can downgrade the group without requiring a new request.
Feature (feature requests only)
- Define ordered thresholds mapped to existing user groups, with an explicit consumption basis and window.
- Recalculate after relevant finalized changes and periodically for window expiry; make repeated evaluation idempotent.
- Support an optional downgrade grace period and an expiring manual override.
- Expose evaluated usage, desired/applied group, effective time and reason. Define precedence with subscription-driven group changes and behavior when source data is stale.
- Preserve normal engine pricing/settlement ownership. Do not silently reprice previously admitted requests.
Duplicate check
- Queries covered usage/spending/automatic user groups and Chinese group/consumption/upgrade terms in issues, plus related open PR/discussion titles.
- Closest threads: #2082 concerns selectable token groups; #3388 concerns subscription group restrictions; #5561 concerns subscription-expiry restoration. None describes the requested rolling-consumption assignment policy.
- This request concerns ordinary account-group lifecycle, not token auto-routing or a subscription-expiry bug.
Research
Docs
- Official documentation: Group Management, Ratio Settings and automatic group order were searched; the source links below provide the version-pinned evidence.
- Official README: distinguishes access groups, usage/cost management and routing.
- Conclusion: routing automation is documented; the requested consumption-based assignment policy was not found in the reviewed material.
Code
- setting/auto_group.go: stores the configured automatic routing-group list.
- service/group.go: filters permitted groups and resolves request routing order.
- group_ratio.go: user/group pricing ratios, rather than a spending-window scheduler.
Experiments
- Read official release/source metadata and compared the named rc.51/main files. No application, database, relay or paid runtime experiment was performed.
Working theory
- Missing: a native optional consumption-based account-group lifecycle.
- This conclusion would be falsified by an existing supported policy/scheduler providing window-expiry recalculation and assignment; a pointer would be welcome.
Scope
- In scope: ordinary user groups and configurable policy evaluation.
- Out of scope: affiliate commissions, provider routing changes, third-party services and automatic balance edits.
- Directional feature: maintainer alignment first; no PR proposed yet.
Proposed direction
Acceptance examples: crossing a threshold changes only future effective pricing; repeated evaluation does not repeat effects; spending ageing out can trigger downgrade; corrections update the window; manual/subscription precedence is explicit; stale inputs do not silently act as zero consumption.
Not verified
No deployed behavior, supported database matrix, cache propagation or in-flight pricing boundary was runtime-tested. This is source-based feature research, not an exhaustive proof that no extension exists.
Related
- #2082, #3388, #5561.
- #7801 concerns final billing receipts, a possible input contract, rather than group assignment itself.