Skip to content

Conversation

@nomomon
Copy link
Owner

@nomomon nomomon commented Jan 31, 2026

Note

Medium Risk
Medium risk because it changes how tools are assembled and passed into Copilot session creation, which can affect runtime tool availability/behavior in both doGenerate and doStream. It’s mitigated by added unit coverage for conversion and merge behavior.

Overview
Enables call-level AI SDK tool() usage by introducing a copilotToolOptions(execute) helper and converting AI SDK function tools (when providerOptions['github-copilot'].execute is provided) into Copilot defineTool tools.

Updates session setup to merge model-level settings.tools with call-level converted tools before createSession, and adds an examples/tools-ai-sdk.ts, docs updates, and tests covering conversion/merging. CI is tweaked to run on PR opened/synchronize/reopened against main, and a new example:tools-ai-sdk script is added.

Written by Cursor Bugbot for commit 1cab98b. This will update automatically on new commits. Configure here.

Extract tools from AI SDK when execute is passed via
providerOptions['github-copilot'].execute and convert them
to Copilot defineTool format. Merge with settings.tools.

- Add convertAiSdkToolsToCopilotTools conversion
- Integrate into session setup and buildSessionConfig
- Add examples/tools-ai-sdk.ts and README docs
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

…ration

- Replace direct execution function passing in providerOptions with copilotToolOptions for better clarity and usability.
- Update README and example to reflect the new usage pattern for AI SDK tools with GitHub Copilot.
- Add new copilot-tool-options module to encapsulate the provider options logic.
…ions tests

- Refactor existing tests for GitHubCopilotLanguageModel to improve readability and structure.
- Add new tests for copilotToolOptions to verify provider options and execute handler functionality.
- Ensure comprehensive coverage of model properties and behavior in the tests.
… type safety

- Change the type of tools in GitHubCopilotSettings to accept a more specific object structure, enhancing type safety and clarity in tool configurations.
… for flexibility

- Modify the tools property in GitHubCopilotSettings to accept any type, allowing for greater flexibility in tool configurations while maintaining clarity in the documentation.
…ilotProviderOptions

- Adjust indentation for properties in GitHubCopilotSettings and GitHubCopilotProviderOptions to ensure consistent formatting and improve code readability.
…ed type safety

- Change the tools property in GitHubCopilotSettings to use unknown instead of any, enhancing type safety while maintaining flexibility in tool configurations.
- Update copilotToolOptions test to reflect the new type definition and ensure proper execution handling.
@nomomon nomomon merged commit 927ccb0 into main Jan 31, 2026
2 checks passed
@nomomon nomomon deleted the feat/ai-sdk-tools-provider-options branch January 31, 2026 06:36
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.

2 participants