Skip to content

fix(agent-service, v1.2): delete links targeting removed input ports when shrinking input ports - #7637

Draft
github-actions[bot] wants to merge 1 commit into
release/v1.2from
backport/7349-delete-links-targeting-removed-input-por-v1.2
Draft

fix(agent-service, v1.2): delete links targeting removed input ports when shrinking input ports#7637
github-actions[bot] wants to merge 1 commit into
release/v1.2from
backport/7349-delete-links-targeting-removed-input-por-v1.2

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Automated backport of #7349 to release/v1.2.

Source: 12169c2 · automation run

Any related issues, documentation, discussions?

Backport of #7349. Originally linked #7169.

How was this PR tested?

Release-branch CI runs on this branch once the conflicts are resolved and this PR is marked ready for review.

Was this PR authored or co-authored using generative AI tooling?

No.

…hrinking input ports (#7349)

### What changes were proposed in this PR?

This PR fixes a bug in `WorkflowState.updateOperatorInputPorts` where
shrinking an operator's input port count left links targeting removed
input ports. The method now removes any links whose target port no
longer exists by calling `deleteLink`, preventing dangling links from
remaining in the workflow state.

A regression test was also added to verify that links targeting deleted
input ports are removed when the input port count is reduced.

### Any related issues, documentation, discussions?

Closes #7169

### How was this PR tested?

Added a regression test covering the case where an operator's input
ports are reduced while a link targets one of the removed ports.

Verified with:

```bash
bun test --test-name-pattern="removes links targeting input ports that are dropped"
bun test
```
Before:
<img width="1716" height="1160" alt="image"
src="https://github.com/user-attachments/assets/bcfd23cb-aa4b-4f8e-87c1-46f0eda3e3e4"
/>

After:
<img width="1716" height="984" alt="image"
src="https://github.com/user-attachments/assets/f9937312-80f8-423b-8ec7-d7c522319b90"
/>

### Was this PR authored or co-authored using generative AI tooling?

(backported from commit 12169c2)

Generated-by: ChatGPT (5.5 mini)
@github-actions

Copy link
Copy Markdown
Contributor Author

The cherry-pick conflicted and was committed with conflict markers. Resolve the conflicts on this branch, then mark this PR ready for review.

Conflicting files:

  • agent-service/src/agent/workflow-state.test.ts

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