fix(config): generate unique default identifiers - #2201
Conversation
🤖 Open Code ReviewTarget: PR #2201 🔍 OpenCodeReview found 1 issue(s) in this PR. 1.
|
|
Good catch to check. I reran this with the exact test setup: Pydantic v2 |
|
|
Fixed the CWD dependency in 7e8769c: both tests now resolve the fixture relative to |
✅ Automated Test Results: PASSEDAll tests passed (4/4 executed). memos_python_core/changed-repo-python: 4/4. Duration: 5s [advisory, non-gating] AI-generated tests on branch test/auto-gen-2d018f7ca2c29a15-20260808102020: 61/61 passed — these do NOT affect the PR verdict; review the branch manually. Branch: |
|
Thanks for the approval, @WeiminLee. I noticed the required Python tests workflow is still sitting at |
✅ Automated Test Results: PASSEDAll tests passed (4/4 executed). memos_python_core/changed-repo-python: 4/4. Duration: 5s [advisory, non-gating] AI-generated tests on branch test/auto-gen-a8b5631b96d328da-20260818094438: 43/43 passed — these do NOT affect the PR verdict; review the branch manually. Branch: |
Description
MOSConfig.session_idandGeneralMemCubeConfig.cube_idcurrently calluuid.uuid4()when their modules are loaded. Pydantic then treats those generated strings as static defaults, so separate config instances created in the same process reuse the same identifier.This switches both fields to
default_factory. Explicit IDs and existing serialized configs keep the same behavior; only omitted IDs now get a fresh UUID per instance.The PR is now based on
dev-v2.0.30; the bug is still present there and the four-file functional diff is unchanged. No dependencies are added. I couldn't find an existing issue or PR for this, and the contribution guide says small bug fixes can go directly to a PR.Related Issue (Required): N/A
Type of change
How Has This Been Tested?
Verification on the merged
dev-v2.0.30tree:uv run --frozen --with 'pytest==8.3.5' pytest tests/configs/ -q— 39 passeduv run --frozen --extra mem-reader --with 'pytest==8.3.5' pytest tests/mem_os/ -q— 36 passed (3 existing Pydantic serialization warnings)uv run --frozen --with 'poetry>=2,<3' --with 'ruff==0.11.13' make format— Ruff passed; 621 files unchangedgit diff --check origin/dev-v2.0.30...HEAD— passedPython testsmatrix — 16/16 passed across Ubuntu, Windows, macOS 14/15 and Python 3.10–3.13Checklist
@WeiminLee when you have a moment, could you take a look?
Reviewer Checklist