Skip to content

Preserve unspecified node params on partial updates (recursive merge)#411

Merged
zhongkaifu merged 1 commit into
mainfrom
codex/do-not-update-unspecified-input-fields
Feb 8, 2026
Merged

Preserve unspecified node params on partial updates (recursive merge)#411
zhongkaifu merged 1 commit into
mainfrom
codex/do-not-update-unspecified-input-fields

Conversation

@zhongkaifu
Copy link
Copy Markdown
Owner

Motivation

  • Update operations should not drop or overwrite node params fields that the caller did not specify, especially for nested structures.
  • Existing behavior could remove nested keys when performing partial updates; this change ensures partial/patch semantics for node updates.

Description

  • Added helper functions _deep_merge_mapping and _merge_node_params to recursively merge incoming params onto existing node params while preserving unspecified fields.
  • Applied the merge step before schema filtering/validation in all update tools: update_action_node, update_reasoning_node, update_data_node, update_condition_node, update_switch_node, and update_loop_node by using merged_params as the input to filter_supported_params.
  • Adjusted condition-specific handling to merge and validate params.expression against the merged params.
  • Added a regression test tests/test_structure_update_node_partial_params.py that simulates an update_action_node call updating only a nested field and asserts other nested fields remain unchanged.

Testing

  • Ran pytest -q tests/test_structure_update_node_partial_params.py tests/test_workflow_builder_update.py, and the test suite completed successfully (all tests passed).

Codex Task

@zhongkaifu zhongkaifu merged commit 830660f into main Feb 8, 2026
1 check failed
@zhongkaifu zhongkaifu deleted the codex/do-not-update-unspecified-input-fields branch February 8, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant