Reject registerTool() promise when signal is aborted#202
Open
beaufortfrancois wants to merge 2 commits into
Open
Reject registerTool() promise when signal is aborted#202beaufortfrancois wants to merge 2 commits into
beaufortfrancois wants to merge 2 commits into
Conversation
Contributor
Author
|
@domfarolino Please review |
beaufortfrancois
commented
Jun 9, 2026
| 1. If |signal| is [=AbortSignal/aborted=], then return [=a promise rejected with=] | ||
| |signal|'s [=AbortSignal/abort reason=]. | ||
|
|
||
| 1. [=AbortSignal/add|Add an abort algorithm=] to |signal| that [=model context/unregisters a |
Contributor
Author
There was a problem hiding this comment.
I also need to reject promise when tool gets unregistered but it's not clear to me how to do this properly. Should I add |promise| and |signal| parameters to the "unregister a tool" algorithm or should I call both reject promise and then unregister tool algorithm?
Contributor
Author
There was a problem hiding this comment.
I gave it a shot. Please let me know if that looks good to you.
Contributor
Author
There was a problem hiding this comment.
One thing I'm still not sure is whether we want "Notify documents of a tool change" to run before rejecting the promise when signal is aborted.
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.
I believe we should reject
registerTool()promise when signal is aborted instead now following #200 changesIt's part of changes required for #175.
Preview | Diff