Skip to content

NameError: BASIC_TIER_MEMORIES_CREATED_LIMIT_PER_MONTH not defined in get_plan_features #7466

Closed

Description

@beastoin

Bug

get_plan_features() in backend/utils/subscription.py crashes with NameError for basic (free) plan users.

Error: NameError: name 'BASIC_TIER_MEMORIES_CREATED_LIMIT_PER_MONTH' is not defined
Service: Cloud Run backend (backend-01020-v7j)
First seen: 2026-05-23 ~08:53 UTC

Cause

PR #7427 removed the BASIC_TIER_MEMORIES_CREATED_LIMIT_PER_MONTH variable definition (line 402) but left two references in get_plan_features() at lines 664-665:

# Lines 663-666 — variable no longer exists
(
    f"{BASIC_TIER_MEMORIES_CREATED_LIMIT_PER_MONTH} memories per month"
    if BASIC_TIER_MEMORIES_CREATED_LIMIT_PER_MONTH > 0
    else "Unlimited memories"
),

Impact

  • Affected: All free-tier (basic plan) users hitting /v1/users/me or plan catalog endpoints
  • Not affected: Paid plan users (Neo/Operator/Architect) — function returns early for those plan types
  • Callers: routers/users.py:816 (user profile), routers/users.py:907 (plan catalog), legacy_plan_features() (old mobile clients)

Fix

Replace the 4-line conditional with "Unlimited memories". The variable was always 0 (default), so the conditional always evaluated to the else branch — this was a dead code path that now crashes.

cc @kodjima33

Activity

  1. added
    intelligence
    p2
    on May 24, 2026
  2. added a commit that references this issue on May 24, 2026
    8437c05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    intelligencep2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions