fix: update emitter event matching logic#17
Open
bw31642 wants to merge 1 commit intolgazo:mainfrom
Open
Conversation
Owner
|
Hi @bw31642, The reason why I think the fix is not correct is, that the Extension builds proper event name in on_standard_tool_request_from_server, which is used by the mentioned tool. The PR looks like being built by AI without wider understanding of the context. |
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.
Fix for get-shape-categories Tool Hanging Issue
Problem Description
The
get-shape-categoriesMCP tool call was hanging indefinitely instead of returning the shape categories from Draw.io. This issue affected the tool's ability to retrieve available shape categories from the diagram's library.Root Cause Analysis
The issue was located in the reply matching logic within the
emitter_bus.tsfile. Here's what was happening:The Broken Flow
Request Generation (
tool.tsline 19):Request Sent to Extension:
{ "__event": "get-shape-categories", "__request_id": "abc123" }Extension Response:
{ "__event": "get-shape-categories", "__request_id": "abc123", "categories": [...] }Failed Reply Matching (
emitter_bus.tsline 21):This was comparing:
emitter_data.__event:"get-shape-categories"event_name:"get-shape-categories.abc123"Result: No match → Promise never resolves → Tool hangs
The Fix
File Modified:
./src/emitter_bus.tsBefore (lines 18-24):
After (lines 18-24):
What Changed
The matching condition was changed from:
To: