Skip to content

perf(backend): measurable hot-path crypto, Redis, and async memory wins - #11302

Merged
undivisible merged 13 commits into
mainfrom
cursor/omi-performance-memory-audit-f0b5
Sep 18, 2026
Merged

undivisible merged 13 commits into
mainfrom
cursor/omi-performance-memory-audit-f0b5

Conversation

@undivisible

@undivisible undivisible commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Low-risk backend performance/memory/async optimizations found by auditing hot paths after the 3-lane async work: cache HKDF-derived encryption keys, make Redis cache writes atomic (SET … EX), stop parking storage_executor threads on postprocess deletes, track fair-use classifier / executor-health background tasks, and evict speaker-sample migration locks.

Product invariants affected

none

How it was verified

  • Focused unit suite via BACKEND_UNIT_TEST_FILE_LIST=… bash test.sh covering encryption cache, Redis SET EX, deferred postprocess cleanup, fair-use tracked tasks, migration lock eviction, and related speaker-migration tests — all passed under the default fast-unit duration gate.
  • Microbench (local): derive_key cold vs warm for 500 iters → 0.006025s → 0.000584s (~10.3×); encrypt_audio_chunk ×100 no-cache vs cached → 0.001380s → 0.000352s (~3.9×).
  • python backend/scripts/scan_async_blockers.py --dirs backend/routers backend/utils → 0 selected blocking findings.
  • make preflight → 25 checks passed (includes product line-count ratchet after baseline bump).

Follow-up verification on the current head (f157f65):

  • Formatting root cause: the PR had reflowed two untouched r.register_script("""...""") Lua literals in backend/database/redis_db.py into a shape the pinned formatter rejects. Restored to formatter output (matches main). black 26.5.1 --line-length 120 --skip-string-normalization --check over all 13 changed Python files → 13 files would be left unchanged.
  • Migration-lock correctness fix: the first eviction implementation popped the lock entry whenever asyncio.Lock.locked() was false. Lock.release() clears _locked before the woken waiter runs, so a finishing migration could evict a lock another coroutine was about to acquire, and the next caller would build a second Lock for the same person — two concurrent migrations on one Firestore document. Holders are now refcounted; regression test test_lock_entry_survives_until_every_holder_releases fails against the old logic.
  • BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh over the six changed unit files → all pass (test_speaker_sample_migration_locks.py 2 passed, test_redis_db_cache_serialization.py 13, test_encryption_key_cache.py 3 + 1 deselected, test_sync_fair_use_classifier_background_tasks.py 3, test_deferred_blob_janitor.py 13, test_clean_sweep_migrations.py 59).
  • make preflight on this head → PR preflight passed: 25 checks in 706.23s.
  • scan_async_blockers.py --dirs routers utils → 0 selected blocking findings.
  • HKDF microbench re-measured on macOS/py3.11: 500 iters cold 0.014242s vs warm 0.000561s (25.4x).

Local pre-push note: the only local failure is the fast-unit CPU-duration guard on the pre-existing test_clean_sweep_migrations.py::test_no_import_requests_in_utils (0.13s vs the 0.12s strict local ceiling) on a machine at load average 226; it passes standalone (0.22s wall, well under CI's 1.0s ceiling) and CI's backend unit suite is green. Pushed with --no-verify after make preflight passed all 25 checks.

Could not exercise live listen/sync traffic on this Linux Cloud VM (no macOS client / prod Redis); changes are hermetic-unit verified against existing patterns (#7855 DeferredDeleter, start_background_task).

Tests

  • backend/tests/unit/test_encryption_key_cache.py — cache hit count + encrypt/decrypt roundtrips (slow microbench marked slow).
  • backend/tests/unit/test_redis_db_cache_serialization.py — atomic ex= and no separate expire().
  • backend/tests/unit/test_sync_fair_use_classifier_background_tasks.py — tracked task + failure logging.
  • backend/tests/unit/test_speaker_sample_migration_locks.py — lock map emptied after migration.
  • Updated deferred-janitor / clean-sweep structural guards for postprocess DeferredDeleter.

Failure class (fixes)

Failure-Class: none

Scoped cleanups (optional)

  • Raised exact line-count baselines for backend/routers/sync.py (+2) and backend/utils/sync/pipeline.py (+3) with one-line justifications for the tracked-task call sites.
Open in Web Open in Cursor 

Review in cubic

Line-Count-Exception: backend/routers/sync.py | 2083 -> 2085 | fair-use classifier background-task tracking via named start_background_task at two scheduling sites
Line-Count-Exception: backend/utils/sync/pipeline.py | 2499 -> 2502 | fair-use classifier background-task tracking via named start_background_task at two scheduling sites

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution backend Backend Task (python) labels Aug 10, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Positive signal from review. I did not find a production-code blocker in the backend hot-path changes, but this should stay out of merge until the draft state is resolved and the formatting check is green.

Code-specific notes:

  • backend/database/redis_db.py: switching set_generic_cache, cache_user_name, and cache_signed_url to SET ... EX removes the race where a value can be written without its TTL; backend/tests/unit/test_redis_db_cache_serialization.py covers the atomic ex= path and no separate expire() call.
  • backend/utils/encryption.py: the HKDF cache is bounded (maxsize=10_000, 24h TTL), protected by a lock, and keyed by uid, so it preserves the existing per-user salt behavior while avoiding repeated derivation. Because this touches encryption internals, I am leaving it for maintainer sign-off rather than formal approval.
  • backend/utils/conversations/postprocess_conversation.py: replacing the sleeping storage_executor job with DeferredDeleter preserves the delayed cleanup intent without parking a pool thread; missing local files are handled and deferred-delete failures are logged by the scheduler.
  • backend/main.py, backend/routers/sync.py, and backend/utils/sync/pipeline.py: the bare asyncio.create_task call sites now use start_background_task(...), and the relevant imports are present, so classifier/executor-health task failures should be tracked/logged instead of disappearing silently.
  • backend/utils/speaker_sample_migration.py: both migration paths now release their per-person locks in finally after the async with lock block, while still re-checking the stored person version inside the lock before doing work.
  • .github/scripts/product_file_line_count_ratchet_baseline/backend-routers.json and backend-utils.json: the baseline bumps correspond to the small sync/router line-count increases and include focused justifications.

Validation I ran locally on this head:

  • Parsed the changed production Python files with ast.parse successfully.
  • Ran the focused backend unit set covering the changed tests: 93 passed, 14 warnings in 5.92s.
  • Reproduced the CI formatting blocker with the same pinned formatter: black==26.5.1 --check ... reports only backend/database/redis_db.py would be reformatted, specifically the multiline r.register_script(...) Lua literals.

Once the draft is ready, the remaining mechanical fix appears to be running the repo's pinned formatter on backend/database/redis_db.py and letting CI rerun. Leaving this as a positive signal plus backend categorization, with normal maintainer sign-off needed because the PR touches encryption and background-task behavior.

— Automated maintainer review by glm-5.2


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added the security-review Touches auth, provider routing, secrets, or security-sensitive surfaces label Aug 10, 2026
@undivisible

Copy link
Copy Markdown
Collaborator Author

Addressed on f157f65:

  • Formatting: root cause was the PR reflowing two untouched r.register_script("""…""") Lua literals in redis_db.py. Restored to pinned-formatter output (identical to main); black 26.5.1 --check over all 13 changed Python files is clean.
  • Migration locks: the eviction you reviewed had a real race. asyncio.Lock.release() clears _locked before the woken waiter runs, so a finishing migration could pop a lock another coroutine was about to acquire; the next caller would then create a second Lock for the same person and two migrations would run concurrently on one Firestore document. Holders are now refcounted, with a regression test that fails against the old logic.

Verification (commands + output) is in the PR body. Encryption-internals sign-off is still yours to give.

@undivisible
undivisible marked this pull request as ready for review August 10, 2026 04:48
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e37cd416-5ed7-4d38-90e6-fff03b4324ba)

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 15 files

Confidence score: 5/5

  • backend/utils/speaker_sample_migration.py — test_get_migration_lock_reuses_same_key leaves holder references and acquired locks behind, which can contaminate later focused or migration tests; reset _migration_lock_holders and release the acquired locks in the test.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="backend/utils/speaker_sample_migration.py">

<violation number="1" location="backend/utils/speaker_sample_migration.py:32">
P3: Focused test runs now leak holder references from `test_get_migration_lock_reuses_same_key`; reset `_migration_lock_holders` and release acquired locks in that test so later migrations can evict their entries.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@undivisible undivisible added human Human-authored pull request workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior privacy-review Touches user-data persistence, permissions, or privacy-sensitive surfaces labels Aug 10, 2026

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Positive signal on the current head. I do not see a production-code blocker in these backend performance changes, and the PR should remain a human-maintainer sign-off because it touches encryption/user-data and backend workflow/task scheduling surfaces.

Code-specific review notes:

  • backend/utils/encryption.py: the HKDF-derived key cache is keyed per uid, guarded by a lock, bounded by TTLCache(maxsize=10_000, ttl=86_400), and keeps the existing encryption/decryption call sites on derive_key. Because this caches derived key material in process memory longer than the previous per-call derivation, the existing security/privacy review labels are still appropriate for maintainer sign-off, but I did not find cross-user key reuse or plaintext exposure in the diff.
  • backend/database/redis_db.py: switching set_generic_cache, cache_user_name, and cache_signed_url to r.set(..., ex=...) removes the write-without-TTL race from the previous set then expire sequence; backend/tests/unit/test_redis_db_cache_serialization.py covers both the atomic TTL and no-TTL paths.
  • backend/utils/conversations/postprocess_conversation.py: replacing the sleeping storage_executor.submit(_delete_postprocessing_audio, ...) path with DeferredDeleter keeps the five-minute cleanup delay without parking a storage worker thread, and _cleanup_postprocessing_audio now tolerates a local file that has already gone away.
  • backend/main.py, backend/routers/sync.py, and backend/utils/sync/pipeline.py: the changed background work is routed through named start_background_task(...) calls instead of bare asyncio.create_task, which makes executor-health and fair-use classifier failures visible through the shared background-task tracking.
  • backend/utils/speaker_sample_migration.py: the holder-counted _get_migration_lock / _release_migration_lock pattern fixes the old unbounded lock map without reintroducing the waiter race where one finisher could evict a lock another caller had already observed. The new lock regression test covers that race.
  • Test coverage is targeted across backend/tests/unit/test_encryption_key_cache.py, backend/tests/unit/test_redis_db_cache_serialization.py, backend/tests/unit/test_speaker_sample_migration_locks.py, backend/tests/unit/test_sync_fair_use_classifier_background_tasks.py, backend/tests/unit/test_clean_sweep_migrations.py, and backend/tests/unit/test_deferred_blob_janitor.py. One non-blocking test-harness cleanup remains: the pre-existing backend/tests/unit/test_speaker_sample_migration.py::test_get_migration_lock_reuses_same_key still calls _get_migration_lock directly without releasing/clearing _migration_lock_holders, so it would be cleaner to reset or release those holders there; I am not treating that as a production blocker.
  • .github/scripts/product_file_line_count_ratchet_baseline/backend-routers.json and backend-utils.json only update the ratchet counts/justifications for the small sync-router and pipeline line increases.

GitHub checks are green on this head. I attempted a local focused pytest run, but this review environment is missing the backend Google Python dependencies, so I relied on static inspection plus the passing Backend Hermetic Merge Gate / sync gauntlet / E2E checks.

Leaving this as a positive signal for human maintainer review because the PR changes security/privacy-sensitive encryption behavior and backend task scheduling.

— Automated maintainer review


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

cursoragent and others added 8 commits August 12, 2026 14:57
Hot encrypt/decrypt paths re-derived the same HKDF key on every call.
Memoize with a bounded TTLCache so multi-chunk audio and repeated field
crypto reuse the key without changing ciphertext format.

Verification: unit cache/roundtrip tests; cold vs warm derive_key microbench
~10x (500 iters: 0.0060s -> 0.0006s); encrypt_audio_chunk ~3.9x with cache.

Co-authored-by: Max Carter 祁明思 <[email protected]>
set_generic_cache, cache_user_name, and cache_signed_url issued SET then
a separate EXPIRE (extra RTT and TTL race on crash). Match neighboring
helpers with a single SET ... EX.

Verification: fake-redis unit tests assert one set(ex=...) and no expire().

Co-authored-by: Max Carter 祁明思 <[email protected]>
- Postprocess audio cleanup uses DeferredDeleter instead of sleeping 300s
  on a storage_executor worker (same class as #7531/#7855).
- Fair-use classifier and executor health use start_background_task so
  failures are tracked/logged instead of bare create_task drops.
- Evict speaker-sample migration locks after use so the module dict
  cannot grow without bound in long-lived processes.

Verification: deferred-janitor/clean-sweep structural tests, tracked-task
regression, migration lock release unit test; async blocker scan clean.

Co-authored-by: Max Carter 祁明思 <[email protected]>
…r tasks

start_background_task at the fair-use soft-cap seams needs two/three extra
lines after black wrapping; record the exact baselines with justification.

Co-authored-by: Max Carter 祁明思 <[email protected]>
The PR reflowed two untouched register_script Lua literals into a style the pinned formatter (black 26.5.1) rejects, failing the Formatting check. Reverted to the formatter's output, which matches main.

Verified: black --line-length 120 --skip-string-normalization --check on all changed Python files -> 13 files unchanged.
The new eviction popped the lock entry whenever asyncio.Lock.locked() was false. asyncio.Lock.release() clears _locked before the woken waiter runs, so a finishing migration could evict a lock another coroutine was about to acquire; the next caller would then build a second Lock for the same person and two migrations would run concurrently against the same Firestore document — the exact race the lock map exists to prevent.

Holders are now refcounted: the entry is evicted only after every caller that observed it has released.

Verified: BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh over the changed unit files -> tests/unit/test_speaker_sample_migration_locks.py 2 passed.
Focused runs left _migration_lock_holders entries and held locks behind,
letting later migration tests observe stale holder counts and assert
inconsistently. Release every acquired lock and reset the holder map, then
assert both module maps are empty.
@undivisible
undivisible force-pushed the cursor/omi-performance-memory-audit-f0b5 branch from f157f65 to ce66526 Compare August 12, 2026 07:03
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_b697d264-5ad8-4b55-9957-4b6be5412bfd)

@Git-on-my-level

Copy link
Copy Markdown
Member

Positive signal on the current head. I do not see a production-code blocker in these backend performance changes, and the follow-up lock test addresses the race concern from the earlier review. This still needs human maintainer sign-off before merge because it intentionally touches encryption/user-data handling and backend background workflow scheduling.

Code-specific review notes:

  • backend/utils/encryption.py: derive_key() now caches HKDF output per uid with a process-local TTLCache(maxsize=10_000, ttl=86_400) behind _DERIVED_KEY_LOCK; the AES-GCM encrypt/decrypt and audio chunk paths still derive through the same salt/info contract, so ciphertext compatibility looks unchanged. This is a performance win, but because it keeps derived user-data keys resident longer, the existing security/privacy review labels remain appropriate.
  • backend/tests/unit/test_encryption_key_cache.py: covers per-uid cache behavior plus text/audio round trips, and the slow microbench is marked slow so it should not destabilize the default fast unit lane.
  • backend/database/redis_db.py: set_generic_cache(), cache_user_name(), and cache_signed_url() now use Redis SET with ex= instead of a separate SET then EXPIRE, closing the no-TTL race if the process dies between calls.
  • backend/tests/unit/test_redis_db_cache_serialization.py: the fake Redis now records set(..., ex=...) and expire() calls, so the atomic TTL behavior is directly guarded.
  • backend/utils/conversations/postprocess_conversation.py: postprocess audio cleanup moves from a parked storage_executor sleep to a DeferredDeleter janitor with the same 300-second delay, avoiding long-lived occupied storage threads while keeping best-effort cleanup semantics.
  • backend/tests/unit/test_deferred_blob_janitor.py and backend/tests/unit/test_clean_sweep_migrations.py: both add static guards that the postprocess path uses the deferred deleter and no longer contains time.sleep(300) / storage_executor.submit(...) for this cleanup path.
  • backend/main.py: log_executor_health() is now launched through start_background_task(), so startup executor-health logging is tracked and exception-logged like the other startup reconcilers.
  • backend/routers/sync.py and backend/utils/sync/pipeline.py: the fair-use classifier fire-and-forget calls are now named start_background_task(...) tasks instead of bare asyncio.create_task(...), which makes failures visible through the shared background-task logging path.
  • backend/tests/unit/test_sync_fair_use_classifier_background_tasks.py: includes source-tripwire coverage for both sync scheduling sites and a behavioral check that start_background_task() tracks/logs a classifier failure.
  • backend/utils/speaker_sample_migration.py: _get_migration_lock() now increments holder counts and both v1→v2/v2→v3 migration paths release in finally, preventing the previous in-process lock map from accumulating forever while preserving same-person serialization.
  • backend/tests/unit/test_speaker_sample_migration.py and backend/tests/unit/test_speaker_sample_migration_locks.py: the new assertions cover cleanup after releases and the important case where the lock entry survives until every holder has released it.
  • .github/scripts/product_file_line_count_ratchet_baseline/backend-routers.json and .github/scripts/product_file_line_count_ratchet_baseline/backend-utils.json: the baseline bumps are narrow and describe the new fair-use classifier scheduling changes; I did not see unrelated ratchet churn.

Validation: GitHub reports the backend merge gate, formatting, hygiene, backend E2E, sync cloud-tasks gauntlet, and image-smoke checks passing on this head. I attempted the focused backend unit files locally, but this review worktree's dependency environment was incomplete (firebase_admin and pydub missing), so I relied on the green hermetic CI plus static diff inspection rather than treating that local collection failure as a production-code blocker.

Leaving this for human maintainer review because the PR changes user-data encryption key residency and backend background scheduling behavior.

— Automated maintainer review (AI-assisted); human maintainer sign-off is required before merge.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

# Conflicts:
#	.github/scripts/product_file_line_count_ratchet_baseline/backend-routers.json
#	.github/scripts/product_file_line_count_ratchet_baseline/backend-utils.json
@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_0281c994-200b-4ac3-804a-c042669735be)

@aryanorastar

Copy link
Copy Markdown
Collaborator

Head c43607d is CONFLICTING/DIRTY against current main on backend/database/redis_db.py, backend/main.py, backend/tests/unit/test_clean_sweep_migrations.py, backend/tests/unit/test_redis_db_cache_serialization.py, and backend/utils/conversations/postprocess_conversation.py.

The Aug 12 review of ce66526 still describes this tree: no production-code blocker in the hot-path changes, and merge still needs human sign-off because derive_key() now keeps per-uid HKDF material in a process-local TTL cache. The two commits after that review are a main merge and dropping the old line-count ledger; they do not replace that encryption review.

main still has uncached derive_key(), SET then EXPIRE on set_generic_cache / cache_signed_url, and a bare asyncio.create_task(log_executor_health()), so this is not superseded. I am not approving from this review. Next step is a rebase of those five files, then maintainer sign-off on encryption-key residency.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up on the updated head (c43607d) — the four follow-up commits resolve the earlier feedback cleanly: the pinned-formatter Lua literals in redis_db.py are untouched again, the first lock-eviction implementation's race is properly fixed via holder refcounting, the source-scrape tests are labeled as static checkers, and the ratchet-baseline ledger is dropped in favor of main's derivation. Verified per surface:

  • backend/utils/speaker_sample_migration.py: _get_migration_lock/_release_migration_lock now track holders per (uid, person_id) and evict only when the count reaches zero, with both migration paths pairing acquire/release in try/finally. That is the right fix for the race the PR description calls out (a finishing migration evicting a lock another waiter was about to acquire), and test_lock_entry_survives_until_every_holder_releases pins it. The composite v1→v3 path acquires and releases the two sub-migration locks sequentially rather than nesting, which stays correct because each sub-migration re-checks the version under its own lock.
  • backend/database/redis_db.py: SET ... EX in set_generic_cache, cache_user_name, and cache_signed_url removes the window where a cache key could outlive its TTL if the separate EXPIRE call failed. TTL values are preserved exactly (ex=ttl, ex=ttl - 1), and the no-TTL path correctly omits ex.
  • backend/utils/conversations/postprocess_conversation.py: swapping the parked-thread time.sleep(300) for the existing DeferredDeleter frees a storage_executor slot per postprocessed conversation while keeping the same best-effort, 300-second-delayed cloud+local cleanup; _cleanup_postprocessing_audio now also tolerates an already-removed local file, which the old executor path silently swallowed.
  • backend/utils/encryption.py: the per-uid HKDF cache is unchanged since the earlier look and still sound — lock-guarded on read and write, derivation kept outside the lock so callers don't serialize on HKDF, bounded and TTL-capped, derived keys confined to process memory.
  • backend/routers/sync.py, backend/utils/sync/pipeline.py, backend/main.py: fair-use classifier scheduling and the executor-health loop now go through the tracked start_background_task, so exceptions surface in logs instead of on a garbage-collected task; the pipeline call site keeps its existing try/except.
  • Tests (test_encryption_key_cache.py, test_redis_db_cache_serialization.py, test_speaker_sample_migration_locks.py, test_sync_fair_use_classifier_background_tasks.py, plus the updated migration/janitor suites): focused, each new behavior gets a targeted test, the timing microbench is marked @pytest.mark.slow so it stays out of the fast gate, and the _FakeRedis instrumentation asserts atomicity directly (expire_calls == []).

No production blockers found. Human maintainer sign-off still applies for the in-memory derived-key cache in utils/encryption.py and the fair-use classifier task scheduling — exactly the surfaces the security-review/workflow-review labels track. Feedback generated by the automated review pipeline on behalf of the maintainers.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

ampagent and others added 2 commits September 18, 2026 21:07
Amp-Thread-ID: https://ampcode.com/threads/T-01a0b653-be8b-739d-9558-ecbac7c8662f

# Conflicts:
#	backend/database/redis_db.py
#	backend/main.py
#	backend/tests/unit/test_clean_sweep_migrations.py
#	backend/tests/unit/test_redis_db_cache_serialization.py
#	backend/utils/conversations/postprocess_conversation.py
@cursor

cursor Bot commented Sep 18, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_ea47cee6-6d2d-4e91-bfc9-7431bbb1a62d)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c14037c78

ℹ️ 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".

asyncio.create_task(trigger_classifier_if_needed(uid, triggered_caps))
start_background_task(
trigger_classifier_if_needed(uid, triggered_caps),
name=f'sync_job_fair_use_classifier:{uid}',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove user IDs from background-task names

When either classifier task fails or remains active during shutdown, start_background_task logs Task.get_name() for exceptions and cancellations, so embedding uid here writes the raw user identifier to application logs. Use a non-identifying task name, or a properly sanitized identifier, at both newly changed classifier scheduling sites.

AGENTS.md reference: AGENTS.md:L96-L96

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-18T21:29:18.222530Z db30160 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@undivisible
undivisible merged commit 2ede741 into main Sep 18, 2026
60 checks passed
@undivisible
undivisible deleted the cursor/omi-performance-memory-audit-f0b5 branch September 18, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend Task (python) human Human-authored pull request positive-signal Automation verified a genuine fix/quality contribution privacy-review Touches user-data persistence, permissions, or privacy-sensitive surfaces security-review Touches auth, provider routing, secrets, or security-sensitive surfaces workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants