Skip to content

Conversation

@Tanuj-Taneja1
Copy link
Collaborator

Description

It restores the required asynchronous behaviour in the Outlook Mail Toolkit by reintroducing async/await and updating the tests to support async execution. This is necessary because the msgraph-sdk does not support synchronous methods.

Also Merry Christmas Everyone

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

Reverts changes from enhancement pr
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 24, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/outlook-mail-toolkit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the Review Required PR need to be reviewed label Dec 24, 2025
Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Tanuj-Taneja1, thanks for this PR and Merry Christmas! 🎄

The reason we previously changed them to sync was to maintain API consistency for users - we wanted all toolkit methods to have a unified calling convention.

However, since msgraph-sdk doesn't support synchronous calls, I created one PR to update FunctionTool.__call__() in your branch: #3627
Now when async tools are called synchronously (e.g., via agent.step()), it will:

  1. Execute them correctly using asyncio.run() (or in a thread pool if already in an async context)
  2. Emit a RuntimeWarning suggesting users to use await tool.async_call() or await agent.astep() for better performance

This way we get the best of both worlds - async toolkits like this one will work correctly, and users who call them synchronously still get working code with a gentle nudge toward the async API

@Tanuj-Taneja1
Copy link
Collaborator Author

Hi @Tanuj-Taneja1, thanks for this PR and Merry Christmas! 🎄

The reason we previously changed them to sync was to maintain API consistency for users - we wanted all toolkit methods to have a unified calling convention.

However, since msgraph-sdk doesn't support synchronous calls, I created one PR to update FunctionTool.__call__() in your branch: #3627 Now when async tools are called synchronously (e.g., via agent.step()), it will:

  1. Execute them correctly using asyncio.run() (or in a thread pool if already in an async context)
  2. Emit a RuntimeWarning suggesting users to use await tool.async_call() or await agent.astep() for better performance

This way we get the best of both worlds - async toolkits like this one will work correctly, and users who call them synchronously still get working code with a gentle nudge toward the async API

Yes that makes perfect sense, I mentioned a issue in #3627 if you could reproduce the issue do let me know.
Thanks

@Wendong-Fan Wendong-Fan removed the Review Required PR need to be reviewed label Dec 28, 2025
@Wendong-Fan Wendong-Fan merged commit 0c7b935 into master Dec 28, 2025
12 of 13 checks passed
@Wendong-Fan Wendong-Fan deleted the fix/outlook-mail-toolkit branch December 28, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants