Skip to content

fix(agent-service): delete links targeting removed input ports when shrinking input ports - #7349

Open
VuMartin wants to merge 2 commits into
apache:mainfrom
VuMartin:fix/7169-dangling-input-links
Open

fix(agent-service): delete links targeting removed input ports when shrinking input ports#7349
VuMartin wants to merge 2 commits into
apache:mainfrom
VuMartin:fix/7169-dangling-input-links

Conversation

@VuMartin

@VuMartin VuMartin commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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:

bun test --test-name-pattern="removes links targeting input ports that are dropped"
bun test

Before:
image

After:
image

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

Generated-by: ChatGPT (5.5 mini)

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @mengw15, @bobbai00
    You can notify them by mentioning @mengw15, @bobbai00 in a comment.

@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 6, 2026
@github-actions
github-actions Bot requested a review from xuang7 August 6, 2026 01:39
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
release/v1.2 Already labeled — this fix is queued to backport here.

Auto-label run.

@codecov-commenter

codecov-commenter commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.20%. Comparing base (0ccbe16) to head (045a9fe).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7349   +/-   ##
=========================================
  Coverage     83.20%   83.20%           
  Complexity     4117     4117           
=========================================
  Files          1166     1166           
  Lines         46456    46462    +6     
  Branches       5177     5177           
=========================================
+ Hits          38652    38658    +6     
  Misses         6097     6097           
  Partials       1707     1707           
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 0ccbe16
agent-service 83.69% <100.00%> (+0.03%) ⬆️
amber 80.43% <ø> (ø) Carriedforward from 0ccbe16
computing-unit-managing-service 43.60% <ø> (ø) Carriedforward from 0ccbe16
config-service 65.97% <ø> (ø) Carriedforward from 0ccbe16
file-service 69.05% <ø> (ø) Carriedforward from 0ccbe16
frontend 83.84% <ø> (ø) Carriedforward from 0ccbe16
notebook-migration-service 78.89% <ø> (ø) Carriedforward from 0ccbe16
pyamber 97.36% <ø> (ø) Carriedforward from 0ccbe16
workflow-compiling-service 26.31% <ø> (ø) Carriedforward from 0ccbe16

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xuang7 xuang7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@chenlica

chenlica commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@VuMartin Add screenshots?

@VuMartin VuMartin changed the title fix(agent-service): remove dangling links when input ports shrink fix(agent-service): delete links targeting removed input ports when shrinking input ports Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-service fix release/v1.2 back porting to release/v1.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WorkflowState.updateOperatorInputPorts leaves dangling links when the input-port count shrinks (agent-service)

5 participants