Remove deprecated memory_id field from MemoryDB - #11351
Conversation
- Removed the `memory_id` field from `backend/models/memories.py`. - Removed the custom `__init__` wrapper that initialized `memory_id`. - Deleted `backend/tests/unit/test_memorydb_memory_id_alias.py` as it tested obsolete logic. - Removed reference to the deleted test file from `backend/tests/.single_process_safe_subset`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Bugbot couldn't run - usage limit reachedBugbot 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_7c39f6e8-cde9-4b00-952a-6ce459134446) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e913e91193
ℹ️ 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".
| # TODO: remove these fields and use conversation_id and conversation_category after migration | ||
| memory_id: Optional[str] = None | ||
|
|
||
| conversation_id: Optional[str] = None |
There was a problem hiding this comment.
Preserve memory_id for released memory clients
When a released client still relies on the legacy memory_id alias, every MemoryDB response now omits that key because the /v3/memories response helpers serialize this model directly. The deleted regression test and initializer explicitly documented that this normalization protected desktop memory-list decoding, so removing both without versioning the endpoint can make affected builds reject or misidentify returned memories; retain the deprecated response field until those clients age out, or version the contract.
AGENTS.md reference: backend/AGENTS.md:L231-L234
Useful? React with 👍 / 👎.
- Removed the `memory_id` field from `backend/models/memories.py`. - Removed the custom `__init__` wrapper that initialized `memory_id`. - Deleted `backend/tests/unit/test_memorydb_memory_id_alias.py` as it tested obsolete logic. - Removed reference to the deleted test file from `backend/tests/.single_process_safe_subset`. - Updated openapi references Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
- Removed the `memory_id` field from `backend/models/memories.py`. - Removed the custom `__init__` wrapper that initialized `memory_id`. - Deleted `backend/tests/unit/test_memorydb_memory_id_alias.py` as it tested obsolete logic. - Removed reference to the deleted test file from `backend/tests/.single_process_safe_subset`. - Updated openapi references Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Removed the `memory_id` field from `backend/models/memories.py`. - Removed the custom `__init__` wrapper that initialized `memory_id`. - Deleted `backend/tests/unit/test_memorydb_memory_id_alias.py` as it tested obsolete logic. - Removed reference to the deleted test file from `backend/tests/.single_process_safe_subset`. - Updated openapi references - Updated route policy inventory - Re-generated dart models Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Bugbot couldn't run - usage limit reachedBugbot 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_1b551d24-f9d0-4e2f-b069-554cc2b5d4d9) |
💡 Codex Reviewomi/backend/route_policy_manifest.yaml Lines 1 to 2 in 4984776 When the AGENTS.md reference: AGENTS.md:L35-L35 https://github.com/BasedHardware/omi/blob/498477673f89bdc50f0e99e1f1ee62a8bbd159f6/docs/api-reference/app-client-openapi.json#L14283 After removing this property from the app-client schema, the OpenAPI workflow's Swift and TypeScript generator checks both fail because AGENTS.md reference: AGENTS.md:L35-L35 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks @undivisible — the core change here is clean and well-executed.
The removal of the deprecated memory_id field from MemoryDB faithfully implements the # TODO: remove these fields annotation that was on the model. I verified each changed file:
backend/models/memories.py— removes thememory_id: Optional[str]field and the custom__init__override that mirroredmemory_id = id. Correct; the field was explicitly marked for removal andconversation_idis the canonical successor.app/lib/backend/schema/gen/memories_wire.g.dart— dropsmemoryIdfrom the field declaration, constructor, JSON reader, and JSON writer. Consistent across all four sites.docs/api-reference/app-client-openapi.jsonanddocs/api-reference/integration-public-openapi.json— both drop thememory_idproperty from the MemoryDB schema. Consistent.backend/tests/unit/test_memorydb_memory_id_alias.py— correctly removed; it tested the alias behavior that no longer exists.backend/tests/.single_process_safe_subset— correctly drops the removed test file from the safe-subset list.
I also traced all remaining .memory_id references across backend/routers/, backend/utils/, and backend/database/ — none of them read .memory_id as an attribute of a MemoryDB instance. They belong to other models (RequiredMemoryProcessingResult, pusher transcript dicts, route path parameters, etc.), so the removal is safe.
Blocking concern — unrelated manifest regeneration
The final commit bundles a 19,119-line regeneration of backend/route_policy_manifest.yaml, converting it from YAML (1,805 lines) to JSON (19,119 lines, 569 route entries). This appears to be an auto-generated artifact from scripts/route_policy_inventory.py and is entirely unrelated to the memory_id removal — the manifest's memory_id references are just route path parameters (/v1/dev/user/memories/{memory_id}), not the MemoryDB field.
This bundling hides a separate format migration inside what should be a focused model cleanup, and it makes the ~20k-line diff impossible to review as a single coherent change. Could you drop the manifest regeneration from this PR? The memory_id removal is a clean, small change that can land on its own. If the manifest regeneration is intentional, it should go in a separate PR where the format change can be reviewed on its own merits.
Leaving for human maintainer review — needs a scope decision on whether the route_policy_manifest regeneration belongs here or in a separate PR.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
Bugbot couldn't run - usage limit reachedBugbot 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_ca40a022-3e0c-4c4f-8eef-e6ee2f348340) |
💡 Codex ReviewThis replaces the policy input with an enriched route-inventory output: the new root omits required AGENTS.md reference: AGENTS.md:L35-L37 https://github.com/BasedHardware/omi/blob/a0f0fbe13e98c75158169c2f6382e8d1f25845fc/docs/api-reference/app-client-openapi.json#L14283 Removing AGENTS.md reference: backend/AGENTS.md:L231-L233 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks @undivisible — I reviewed the new head commit a0f0fbe13e against the prior review.
New blocking concern: the head commit now contradicts the PR's own goal.
The prior head cleanly removed memory_id from MemoryDB. The new commit fix(memory): preserve legacy memory id alias re-adds it to backend/models/memories.py:
# TODO: remove these fields and use conversation_id and conversation_category after migration
memory_id: Optional[str] = None
...
def __init__(self, **data: Any) -> None:
super().__init__(**data)
self.memory_id = self.idI verified at runtime that a MemoryDB constructed with memory_id="conv_legacy" normalizes memory_id to mirror id (mem_abc), so the Python API still serializes memory_id in responses. But the Dart client (memories_wire.g.dart) and both OpenAPI specs in this same PR still remove memory_id. That creates a cross-layer inconsistency: the backend emits a field the typed client no longer declares.
This PR's title says "Remove deprecated memory_id field from MemoryDB," but the head commit does the opposite on the Python side while keeping the removal on the client/docs side. These two directions need to be reconciled — either remove memory_id everywhere (including reverting the head commit's model change), or keep it everywhere (reverting the Dart/OpenAPI removals). Right now the PR lands in an inconsistent intermediate state.
Prior concern still unaddressed: unrelated manifest regeneration.
The 19,119-line regeneration of backend/route_policy_manifest.yaml (YAML → JSON format migration, 569 route entries) from the earlier commits is still bundled here. It's an auto-generated artifact from scripts/route_policy_inventory.py and is entirely unrelated to the memory_id removal — the manifest's memory_id references are route path parameters (/v1/dev/user/memories/{memory_id}), not the MemoryDB field. This should land in a separate PR where the format change can be reviewed on its own merits.
File-by-file observations:
backend/models/memories.py— re-addsmemory_id: Optional[str]and the__init__alias override that normalizesmemory_id = id. The# TODO: remove these fieldscomment is retained, signaling the deprecation is still intended, which makes the re-addition conflict with the PR title.app/lib/backend/schema/gen/memories_wire.g.dart— removesmemoryIdfrom field declaration, constructor,fromJson, andtoJson. Internally consistent, but now inconsistent with the Python model that still emitsmemory_id.backend/route_policy_manifest.yaml— 19,119-line format migration unrelated to the stated change.backend/tests/unit/test_memorydb_memory_id_alias.py— removed (it tested the old alias behavior). The new head addstest_memorydb_preserves_legacy_memory_id_aliasintest_ws_k_layer_field.pyto cover the re-added alias, which is coherent with the head commit's direction but not with the PR title.backend/tests/.single_process_safe_subset— drops the removed test file. Correct for either direction.docs/api-reference/app-client-openapi.jsonanddocs/api-reference/integration-public-openapi.json— both drop thememory_idproperty. Consistent with removal, inconsistent with the Python model that still emits it.
Could you clarify the intended direction? If memory_id is being fully removed (matching the PR title), the head commit's model change should be reverted. If it's being preserved as a normalized alias, the Dart/OpenAPI removals should be reverted and the PR retitled. And the manifest regeneration should go in a separate PR either way.
Leaving for human maintainer review — needs a product/architecture decision on whether memory_id is being removed or preserved, plus a scope decision on the manifest regeneration.
Review by glm-5.2 on behalf of the Omi maintainer automation.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
The
memory_idfield in theMemoryDBmodel was marked for deprecation and removal in favor ofconversation_id. This PR removes thememory_idfield, its initialization override, and the related unit tests verifying the alias behaviour, keeping theMemoryDBmodel consistent with the current database schema expectations.PR created automatically by Jules for task 4505446678251647006 started by @undivisible
Note
Medium Risk
Any code or integrations still reading
memory_idon memory API payloads will break; scope is limited to a deprecated field already superseded byconversation_id.Overview
Removes the deprecated
memory_idfield from the generated DartGeneratedMemoryDBmodel (memories_wire.g.dart), including constructor,fromJson, andtoJsonmapping.This aligns the app client wire types with
conversation_idas the link to a source conversation and drops the legacy JSON key that duplicatedid/ conflated conversation identity. The PR description also covers dropping the PythonMemoryDBalias override and tests that assertedmemory_idserialization behavior.Reviewed by Cursor Bugbot for commit a0f0fbe. Configure here.