Skip to content

Fix parent composite status after ghost child cleanup#12

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-composite-instance-update
Draft

Fix parent composite status after ghost child cleanup#12
Copilot wants to merge 2 commits intomainfrom
copilot/fix-composite-instance-update

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

During composite instance updates, parent composites were incorrectly included in the destroy phase alongside their ghost children, causing their operation status to be marked as "destroyed" instead of "updated".

Changes

  • operation-plan.ts: Modified findGhostCleanup() to only add ghost children to the destroy phase, not their parent composites
  • operation-plan.update.test.ts: Updated test expectations for ghost cleanup scenarios (tests 5, 5a, 16)

Impact

Ghost children (virtual instances without evaluation state) are still cleaned up correctly, but parent composites now maintain proper deployment status through the update operation.

Before:

// Parent composite was added to destroy phase
ghosts.push({
  id: instanceId,  // parent composite
  parentId: instance.parentId,
  message: "included in operation",
})

After:

// Only ghost children are added to destroy phase
if (isVirtualGhostInstance(state)) {
  ghosts.push({
    id: child.id,  // ghost child only
    parentId: child.parentId,
    message: "ghost cleanup",
  })
}
Original prompt

when updating composite instance, after ghost clean up parent instance became undeployed with operation state destroyed, while deployed/updated must be kept instead


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Exeteres <29506045+Exeteres@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix state change on composite instance update Fix parent composite status after ghost child cleanup Feb 7, 2026
Copilot AI requested a review from Exeteres February 7, 2026 01:06
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.

2 participants