Repository navigation
fix(backend): NameError on BASIC_TIER_MEMORIES_CREATED_LIMIT_PER_MONTH - #7473
Conversation
…ONTH reference PR #7427 removed the variable definition but missed two references in get_plan_features(), causing NameError for all basic-plan users. Closes #7466 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Greptile SummaryThis PR fixes a
Confidence Score: 5/5Safe to merge — the one-line replacement is semantically identical to the deleted conditional and eliminates a live crash for all basic-plan users. The removed conditional always evaluated to 'Unlimited memories' because its controlling variable defaulted to 0, so the literal replacement is behaviorally identical. The fix is confined to a single expression in one function, there are no remaining references to the deleted variable in the backend, and the author confirmed tests pass. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[get_plan_features called] --> B{plan == PlanType?}
B -->|Pro/Neo| C[Return pro/neo feature list]
B -->|Basic / free| D[Build basic feature list]
D --> E[Minutes limit or Unlimited listening]
E --> F[Words transcribed limit or Unlimited words]
F --> G[Insights limit or Unlimited insights]
G --> H["Unlimited memories ← hardcoded fix"]
H --> I[Return list to caller]
Reviews (1): Last reviewed commit: "fix(backend): remove dangling BASIC_TIER..." | Re-trigger Greptile |
Prevents NameError regression if memories-created quota variable is accidentally referenced again. Also fixes test collection by stubbing database.announcements import. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
All omi-pr-workflow checkpoints passed (CP0–CP9B):
PR is ready for merge. by AI for @beastoin |
|
lgtm |
Summary
NameError: name 'BASIC_TIER_MEMORIES_CREATED_LIMIT_PER_MONTH' is not definedcrashingget_plan_features()for all basic (free) plan usersget_plan_features()(lines 664-665)0(env default), so the conditional always evaluated to"Unlimited memories"— replaced the 4-line dead conditional with the literal stringtest_basic_plan_features_include_unlimited_memoriesand fixeddatabase.announcementsstub in test collectionChanges
backend/utils/subscription.py: Replace 4-line conditional referencing undefined variable with"Unlimited memories"literal (1 insertion, 5 deletions)backend/tests/unit/test_subscription_plans.py: Add regression test + fixdatabase.announcementsimport stub for CITest plan
py_compilepasses onsubscription.pyandusers.pyBASIC_TIER_MEMORIES_CREATED_LIMIT_PER_MONTHin backend/legacy_plan_features()also covered (falls through toget_plan_features)Risks
legacy_plan_features(PlanType.basic)falls through toget_plan_features(), so this fix covers both pathsCloses #7466
🤖 Generated with Claude Code