fix:多source的节点跳不到的问题,例如:agent p\u\e, p->u,p->e,u->e 在运行当中,p或u无法跳到e#6728
fix:多source的节点跳不到的问题,例如:agent p\u\e, p->u,p->e,u->e 在运行当中,p或u无法跳到e#6728rxy007 wants to merge 1 commit intomicrosoft:mainfrom
Conversation
ekzhu
left a comment
There was a problem hiding this comment.
Thanks for the PR. Could you please add a test case in the unit test to show your fix addresses the scenario? Can you also update the PR description to show the original issue with a working code block and output.
There was a problem hiding this comment.
Pull Request Overview
This PR addresses an issue where nodes from multiple sources are not triggering as expected in the message thread update logic. The key change involves modifying the condition for appending a target node to the ready queue.
- Changed the condition from "== 0" to ">= 0" in the update_message_thread function to handle node activation.
| if self._activation[target][activation_group] == "all": | ||
| self._remaining[target][activation_group] -= 1 | ||
| if self._remaining[target][activation_group] == 0: | ||
| if self._remaining[target][activation_group] >= 0: |
There was a problem hiding this comment.
The condition '>= 0' may allow the target node to be added to the ready queue before all required processing is complete. Consider revisiting this logic to verify if the intended condition should remain '== 0' to ensure that nodes are only activated when their remaining count is exactly zero.
| if self._remaining[target][activation_group] >= 0: | |
| if self._remaining[target][activation_group] == 0: |
Why are these changes needed?
Related issue number
Checks