fix: stabilize reply and supervisor routing#64
Open
ThanhNT29Jacky wants to merge 1 commit into
Open
Conversation
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
pi-subagentsowncontact_supervisorwhen its native supervisor channel is availableRoot cause
ReplyTracker.resolveReplyTarget()checkedcurrentTurnContextbefore an explicitto, so a reply could be sent to the wrong pending sender. Separately, answering an ask clearedReplyTrackerbut left the same ask inpendingIdleMessages, allowing it to be delivered later.Since
pi-subagents0.33.0, delegated children can receive a native supervisor channel identified byPI_SUBAGENT_SUPERVISOR_CHANNEL_DIR.pi-intercomstill registered its broker-backedcontact_supervisorfirst, preventing the native, parent-session-scoped implementation from registering.The Windows test runner also could not spawn the
npxcommand shim directly, and one path fixture assumed POSIX absolute-path behavior.Behavior after this change
replyTo->to-> current turn -> single pending askpi-intercomkeeps the regularintercomtool, but leavescontact_supervisorto the native channel when that capability signal is present; the existing broker-backed fallback remains unchanged otherwiseprocess.execPathand the already-resolvedtsxCLI on every platformValidation
Windows 11, Node 22.20.0:
The two skips are the existing Unix permission tests. I also loaded this branch alongside
pi-subagents0.34.0 and verified the final tool set isintercomfrom pi-intercom plus nativecontact_supervisor, with no duplicate registration.git diff --checkpasses.