fix(config): generate unique default identifiers - #2201
Open
JiataiWang wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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?
Local verification:
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; 617 files unchangedgit diff --check origin/dev-v2.0.29...HEAD— passedChecklist
@WeiminLee when you have a moment, could you take a look?
Reviewer Checklist