Skip to content

5561 client - Keep agent cluster elements on action toggle and move the Stream response label - #5573

Merged
ivicac merged 2 commits into
masterfrom
5561-cluster-element-editor-followups
Aug 25, 2026
Merged

5561 client - Keep agent cluster elements on action toggle and move the Stream response label#5573
ivicac merged 2 commits into
masterfrom
5561-cluster-element-editor-followups

Conversation

@ivicac

@ivicac ivicac commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Follow-ups to #5568 on the simple AI Agent editor.

Keep the agent cluster elements when the action toggle saves

Toggling the AI Agent action (chat <-> streamChat) re-saved the cluster root from a node-data copy that carried no clusterElements, and saveWorkflowDefinition replaces a cluster root's clusterElements wholesale — so the agent's model, tools and memory were silently stripped from the definition on every toggle.

Two changes, either of which alone leaves a hole:

  • useAiAgentStreamResponse now carries rootTask.clusterElements (read from the definition, not from the seeded-once rootClusterElementNodeData) into the updated root node data.
  • saveWorkflowDefinition falls back to the existing definition task's clusterElements when the incoming task has none. Note this uses ??, not ||, so an explicit empty map still clears the elements — that distinction is covered by a test.

Move the Stream response toggle below a standalone label

The title and the switch shared a row; the title is now a standalone heading with the switch on its own row below it.

Tests

Regression coverage added for all three behaviours, including the explicit-empty-map case that distinguishes ?? from ||.

  • npm run check (lint + typecheck + tests): 357 test files, 3831 tests passed.

Scope note

These commits were lifted off a longer-running branch. Two related follow-ups could not come along, because the code they touch is not on master yet:

  • The same clusterElements fix applied to useAiAgentSkills, whose hook does not exist on master.
  • A cluster-element sibling-spacing fix in layoutUtils, which targets a version of getClusterElementsLayoutElements that has diverged substantially from the one on master.

Both will need to ride along with the branches that introduce their prerequisites.

🤖 Generated with Claude Code

ivicac and others added 2 commits August 25, 2026 12:04
…saves

Toggling the AI Agent action re-saved the cluster root from a node-data
copy that carried no clusterElements, so saveWorkflowDefinition wrote the
root back with them stripped. Carry the definition's clusterElements
through the updated root node data, and fall back to the existing
definition task's clusterElements when the incoming task has none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ivicac
ivicac merged commit e2f38db into master Aug 25, 2026
7 checks passed
@ivicac
ivicac deleted the 5561-cluster-element-editor-followups branch August 25, 2026 10:11
@sonarqubecloud

Copy link
Copy Markdown

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