fix: don't delete or fail to update conditions when their parent step…#71
Merged
Ruari-Phipps merged 2 commits intomainfrom Apr 14, 2026
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes push-time cleanup logic for Flow conditions when FlowSteps are deleted, preventing double-delete and invalid update operations caused by server-side cascade deletes.
Changes:
- Adjust
_clean_resources_before_pushto remove Conditions fromdeleted_resourceswhen their parentFlowStepis deleted. - Promote certain Condition updates to creates when their original
child_stepis deleted in the same push. - Add unit tests covering both scenarios; update delete prioritization to delete Conditions before Steps.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/poly/project.py |
Updates pre-push resource cleanup to avoid double-deletes and convert invalid condition-updates into creates. |
src/poly/handlers/sync_client.py |
Prioritizes deleting Condition resources earlier in the delete queue. |
src/poly/tests/project_test.py |
Adds unit tests for the two fixed push-cleanup edge cases involving deleted steps/conditions. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Coverage Report
Changed file coverage
|
oeisenberg
approved these changes
Apr 14, 2026
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.
Summary
Fixes two bugs in
_clean_resources_before_pushthat caused push failures when a flow step with conditions was deleted.Motivation
When a FlowStep is deleted, Agent Studio automatically deletes its child Conditions server-side. This caused two issues:
deleted_resourceswould result in a double-delete error.Changes
deleted_resourceswhen their parentFlowStepis being deleted (platform handles the cascade)updated_resourcestonew_resourceswhen their originalchild_stepis being deleted in the same pushTest strategy
poly <command>)Checklist
ruff check .andruff format --check .passpytestpassespolyCLI interface (or migration path documented)