fix(proxy): support Pro Lite account routing#558
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5419de7772
ℹ️ 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".
| normalized = normalize_account_plan_type(value) | ||
| if normalized is None: | ||
| return False |
There was a problem hiding this comment.
Preserve direct matching for unknown account plans
account_plan_matches_allowed now rejects any plan string that is not in ACCOUNT_PLAN_TYPES because normalize_account_plan_type returns None, so accounts with a new upstream plan (for example, any future plan value) will never pass model gating even when the model registry explicitly allows that same plan. This is a regression from the previous _filter_accounts_for_model behavior (a.plan_type in allowed_plans) and can cause modeled requests to fail with NO_PLAN_SUPPORT_FOR_MODEL until code is updated for each new plan string; keep a fallback direct membership check before applying equivalence mapping.
Useful? React with 👍 / 👎.
|
Thanks @aruis -- the prolite plumbing looks right and P1 --
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5419de7772
ℹ️ 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".
| if normalized is None: | ||
| return False |
There was a problem hiding this comment.
Allow unknown plans when explicitly listed
account_plan_matches_allowed now returns False whenever normalize_account_plan_type cannot resolve the account plan, which regresses the previous behavior of _filter_accounts_for_model (direct string membership). If the model registry starts emitting a new slug (for example a future plan type) and available_in_plans includes that same slug, those accounts will still be filtered out and selection can fail with no_accounts until code is updated. This should fall back to comparing the cleaned raw plan string against allowed_plans when normalization returns None so explicitly-allowed unknown plans continue to work.
Useful? React with 👍 / 👎.
Summary
proliteaccount plan values without rewriting stored account rows.pro, so Pro-gated models can select Pro Lite accounts.Fixes #557
Validation
uv run pytest -q tests/unit/test_auth.py tests/unit/test_usage.py tests/unit/test_proxy_load_balancer_refresh.py tests/integration/test_dashboard_overview.pyuv run ruff check app/core/plan_types.py app/core/usage/__init__.py app/modules/proxy/load_balancer.py tests/unit/test_auth.py tests/unit/test_usage.py tests/unit/test_proxy_load_balancer_refresh.py tests/integration/test_dashboard_overview.pyuv run ty check app/core/plan_types.py app/core/usage/__init__.py app/modules/proxy/load_balancer.py tests/unit/test_auth.py tests/unit/test_usage.py tests/unit/test_proxy_load_balancer_refresh.py tests/integration/test_dashboard_overview.pyNotes
uv run openspec validate --specscould not run locally because theopenspecexecutable is not installed in this environment.gpt-5.4request routing after proxy configuration was corrected.