-
Notifications
You must be signed in to change notification settings - Fork 84
Description
Potentially out of scope as it is related to the navigator.modelContextTesting - When executeTool updates the UI normal hooks to pick up on changes to input values don't work. change and input events explicitly call out user interactions and MutationObservers won't pick up the change because element.value changes aren't DOM changes. This leaves no common way to watch for MCP driven changes resulting in potential UI desync which could hamper AI/Human hybrid workflows.
This was specifically when using the Declarative API. It may be possible in the imperative API to manually fire onChange or onInput handlers there's not a great way to hook that up in Declarative.
I'm not a browser internals expert - but the most naive approach would be flagging the changes by executeTool as user interaction which would hook into the usual event cycle. Another option could be to add an attribute data-tool-call-updated=[uuid] (or use an appropriate tooluse attribute) which would allow watching for DOM changes using a mutation observer.