Skip to content

fix(): use params entity registry for update_persistent_entities#1898

Merged
benflexcompute merged 2 commits intomainfrom
fix/update-persistent-entities-from-params
Mar 16, 2026
Merged

fix(): use params entity registry for update_persistent_entities#1898
benflexcompute merged 2 commits intomainfrom
fix/update-persistent-entities-from-params

Conversation

@benflexcompute
Copy link
Copy Markdown
Collaborator

@benflexcompute benflexcompute commented Mar 14, 2026

Summary

  • Fix legacy workflow in set_up_params_for_uploading where volume zone modifications (center/axis) made on a separate VolumeMesh object were not reflected in the uploaded simulation.json
  • Root cause: entity_info deep copy was discarded after update_persistent_entities, and root_asset.internal_registry missed modifications from different asset references
  • Build a deduplicated entity registry from params.used_entity_registry instead, which always contains the user's actual modified entities from stored_entities

Test plan

  • Extended test_root_asset_entity_change_reflection to reproduce the bug (separate VolumeMesh object modifying zone center/axis)
  • Verified test fails before fix, passes after
  • All 6 tests in test_project.py pass
  • test_persistent_entity_info_update_volume_mesh and test_persistent_entity_info_update_geometry pass
  • Draft context entity update tests pass

🤖 Generated with Claude Code


Note

Medium Risk
Changes how set_up_params_for_uploading derives the entity registry for update_persistent_entities, which can alter serialized entity metadata (e.g., volume zone center/axis) in uploaded simulation.json for legacy (non-DraftContext) workflows.

Overview
Fixes the legacy (non-DraftContext) upload path so persistent entity updates are driven by entities actually referenced in SimulationParams rather than root_asset.internal_registry.

Adds _build_deduplicated_entity_registry_from_params() to build a de-duplicated EntityRegistry from params.used_entity_registry (keyed by (entity_type, private_attribute_id|name)), and uses it when calling entity_info.update_persistent_entities, ensuring user edits made via a separate asset instance (e.g., VolumeMesh zone center/axis) are reflected in the uploaded params.

Extends test_root_asset_entity_change_reflection and updates VM mock simulation JSON to validate zone IDs and that zone center/axis modifications propagate through set_up_params_for_uploading.

Written by Cursor Bugbot for commit 9b3cbf1. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

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

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: 8873b37fe7

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

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

…egacy workflow

The legacy workflow in set_up_params_for_uploading had two issues causing
entity modifications (e.g. volume zone center/axis) to not reflect in the
uploaded simulation.json:

1. entity_info deep copy was discarded after update_persistent_entities,
   then a fresh copy was used downstream — losing all updates.
2. root_asset.internal_registry was used as the entity source, which does
   not contain modifications when the user operates on a different asset
   object than project._root_asset.

Fix: obtain one deep copy of entity_info upfront and build a deduplicated
entity registry from params.used_entity_registry (which contains the
user's actual modified entities from stored_entities in models).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@benflexcompute benflexcompute force-pushed the fix/update-persistent-entities-from-params branch from 8873b37 to 836b060 Compare March 16, 2026 13:34
@benflexcompute benflexcompute merged commit 6ef13ca into main Mar 16, 2026
20 checks passed
@benflexcompute benflexcompute deleted the fix/update-persistent-entities-from-params branch March 16, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant