Skip to content

Backend Unit Tests red on main: 9 files fail after the customer-Firestore split (#11522) #11531

Closed

Description

@kodjima33

Backend Unit Tests is red on main at 0a8d0ffe98 (run 31753492154): 9 unit files fail. The lane is path-filtered on backend/**, so the desktop-only commits merged after it (00cc9ed9, 6083f7de) did not re-run it and the red state is still live on main.

Reproduced locally at 6083f7de58 with the CI runner (BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh) — same 9 files.

All of it traces to #11522, which added from database._client import get_customer_firestore_client to utils/subscription.py plus firestore_client= / provision= routing kwargs on the entitlement lookups.

Three distinct breakages:

  1. Import-isolation stubs don't export the new symbol (5 files: test_memory_service_parity, test_memory_visibility_export_fixes, test_universal_memory_list_cursor, test_universal_memory_service, test_users_add_sample_transaction). tests/unit/memory_import_isolation.py::make_database_client_stub and the file-local stub in test_users_add_sample_transaction.py build a synthetic database._client module with get_firestore_client only, so database.users → utils.subscription import raises ImportError: cannot import name 'get_customer_firestore_client' from 'database._client' (unknown location) at fixture setup.

  2. Tests pin the old call shapes (3 files). test_byok_security asserts is_byok_active('byok-user-uid') (actual: ..., firestore_client=None); test_paywall_reconnect_gate scrapes the literal _is_trial_expired_cached(uid) out of the source and asserts assert_called_with('uid1'); test_neo_desktop_grandfather monkeypatches get_user_valid_subscription/is_byok_active with single-arg lambdas, and the resulting TypeError is swallowed by the fail-open except in _is_trial_expired_cached, so the assertion fails one step downstream.

  3. is_desktop_trial_paywalled resolves the customer Firestore client before the guards that make it unnecessary (test_desktop_screen_crisp, CI-only: BlockedNetworkError: Blocked outbound network connection to ('169.254.169.254', 80)). Argument evaluation calls get_customer_firestore_client() first, so credentials are initialized even though TRIAL_PAYWALL_ENABLED defaults to false and mobile platforms are never gated. Any environment without ambient ADC now gets an exception out of /v1/screen-activity/sync instead of "not paywalled" — the desktop routes did no credential work here before fix(desktop): align chat tool calls and keep HTTP 402 honest through worker recycle #11522.

Fix in flight for all three.

Activity

  1. moved this from Someday to In review in omi TODO / bountieson Aug 15, 2026
  2. added a commit that references this issue on Aug 15, 2026
    0cd784f
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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions