Skip to content

Remove experimental.runTools from the extension - #41

Merged
SamSamskies merged 4 commits into
mainfrom
remove-experimental-runtools
Aug 14, 2026
Merged

Remove experimental.runTools from the extension#41
SamSamskies merged 4 commits into
mainfrom
remove-experimental-runtools

Conversation

@SamSamskies

Copy link
Copy Markdown
Owner

Summary

  • Remove window.inference.experimental.runTools from the injected page API, shared implementation, and unit tests so Bridge no longer ships a page-side agent loop.
  • Keep tool calling on experimental.request; document a copy-paste runTools helper in the README for apps that want the loop in their own code.
  • Soften helper error paths in the docs sample (invalid args / unknown tools / non-JSON results) so the loop can continue instead of hard-failing mid-turn.

Test plan

  • Confirm window.inference.experimental.runTools is undefined after reload
  • Smoke experimental.request tool round-trip still works (tools → tool_callsrole: "tool" follow-up)
  • Paste the README runTools helper into DevTools and run the weather example
  • Run unit tests (npm test) and confirm the removed run-tools suite is gone with no regressions

Made with Cursor

- 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.
@SamSamskies
SamSamskies merged commit 40124dc into main Aug 14, 2026
1 check passed
@SamSamskies
SamSamskies deleted the remove-experimental-runtools branch August 14, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant