Remove experimental.runTools from the extension - #41
Merged
Conversation
- Removed the `runTools` function implementation from `src/run-tools.js` and `content/inject.js`, consolidating the tool execution logic into the README for clarity. - Updated the README.md to reflect the new structure and usage of the `runTools` helper, including detailed parameters and examples. - Enhanced documentation to clarify the page-side loop helper's functionality and its integration with the `window.inference` object. - Improved code organization and readability by eliminating redundant code and ensuring consistency across documentation and implementation. These changes streamline the tool interaction process and improve the overall clarity of the documentation.
- Added an error check to ensure that the request ends with a "done" chunk, improving robustness in handling tool execution. - Updated the tool result handling to return an error message for unknown tools, enhancing clarity in tool interactions. - Improved serialization of tool results to handle undefined values more gracefully, ensuring consistent output. These changes strengthen the reliability and clarity of the runTools function, facilitating better error management and user feedback during tool interactions.
- Added a check for aborted signals to enhance request management during tool execution. - Implemented robust error handling for invalid tool arguments, ensuring that users receive clear error messages when parsing fails. - Updated serialization of tool results to handle undefined values more gracefully, ensuring consistent output. These changes enhance the reliability and clarity of the runTools function, improving user feedback during tool interactions.
- Introduced a new makeError function to standardize error creation, improving clarity and consistency in error messages. - Updated error handling for aborted requests and missing "done" chunks to utilize the new makeError function, providing clearer feedback to users. - Improved serialization of tool results to handle various data types more effectively, ensuring consistent output. These changes strengthen the robustness of the runTools function, enhancing user experience during tool interactions.
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
window.inference.experimental.runToolsfrom the injected page API, shared implementation, and unit tests so Bridge no longer ships a page-side agent loop.experimental.request; document a copy-pasterunToolshelper in the README for apps that want the loop in their own code.Test plan
window.inference.experimental.runToolsis undefined after reloadexperimental.requesttool round-trip still works (tools →tool_calls→role: "tool"follow-up)runToolshelper into DevTools and run the weather examplenpm test) and confirm the removedrun-toolssuite is gone with no regressionsMade with Cursor