You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
toolactivated / toolcancel identify tools only by name, not Tool interface #384
ToolActivatedEvent and ToolCancelEvent identify the tool only through toolName. With #348, Tool objects and their execution are bound to a specific internal tool UUID, not just a name. But these events, fired on the tool owner's ModelContext, still report only the name.
Tool names are unique among a document's currently registered tools, so the name is usually unambiguous, with one exception that @beaufortfrancois pointed out in #348 (comment). Unregistering a tool doesn't cancel an execution that's already running, so if a page unregisters tool foo while an execution is in flight and then registers a different tool named foo, a later toolcancel for could refer to either registration, and the page can't tell which it refers to.
One option is to expose the Tool object on the event, but this has complications:
Several Tool objects can exist for the same registration, one per getTools() call. Which one should the event expose? Could we track which IDL object instance started each execution, and return that one?
The above doesn't work well since executions can start without a Tool object from this realm, e.g., from the "native" agent or from another document. This complicates things, and pushes me more towards doing nothing here and sticking with toolName.
We could create a new Tool for each event, but that seems unhelpful, since it wouldn't be === to anything the page holds, and might be the first instance of Tool that the page actually observes.
Activity