Upgrade agent-framework to latest RC#50
Conversation
# Conflicts: # pyproject.toml # uv.lock
There was a problem hiding this comment.
Pull request overview
This PR upgrades the project’s agent-framework dependency to the 1.0.0rc5 release candidate and updates the example agent scripts to align with the newer agent-framework API and dependency graph.
Changes:
- Bump
agent-frameworkfrom1.0.0b251016to1.0.0rc5inpyproject.tomland refreshuv.lock. - Update
agentframework_*examples to useAgent+OpenAIChatClient(including async Azure credential/token provider flow). - Adjust Tavily MCP configuration to pass the Tavily API key via URL query parameters.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Updates lockfile for agent-framework==1.0.0rc5, introducing new transitive deps/integrations. |
pyproject.toml |
Bumps project dependency requirement to agent-framework>=1.0.0rc5. |
agents/langchainv1_tavily.py |
Updates Tavily MCP connection URL construction (now includes API key in query string). |
agents/agentframework_tavily.py |
Migrates to new agent-framework API and updates Tavily MCP usage. |
agents/agentframework_learn.py |
Migrates to new agent-framework API and updates MCP tool usage. |
agents/agentframework_http.py |
Migrates to new agent-framework API and updates MCP tool usage / long-running behavior. |
Comments suppressed due to low confidence (1)
agents/agentframework_tavily.py:72
async_credential.close()is only reached on the success path; if an exception occurs during MCP/tool setup oragent.run(), the credential won't be closed. Wrap the agent execution in atry/finally(or use an async context manager, if available) to ensure the Azure credential is always closed.
if async_credential:
await async_credential.close()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| client = OpenAIChatClient( | ||
| base_url=f"{os.environ['AZURE_OPENAI_ENDPOINT']}/openai/v1/", |
There was a problem hiding this comment.
AZURE_OPENAI_ENDPOINT in .env-sample includes a trailing slash, so base_url=f"{os.environ['AZURE_OPENAI_ENDPOINT']}/openai/v1/" will end up with //openai/v1/. Consider stripping any trailing / from the endpoint before appending /openai/v1/.
| client = OpenAIChatClient( | |
| base_url=f"{os.environ['AZURE_OPENAI_ENDPOINT']}/openai/v1/", | |
| azure_endpoint = os.environ["AZURE_OPENAI_ENDPOINT"].rstrip("/") | |
| client = OpenAIChatClient( | |
| base_url=f"{azure_endpoint}/openai/v1/", |
| "langchain-mcp-adapters>=0.1.11", | ||
| "azure-ai-agents>=1.1.0", | ||
| "agent-framework>=1.0.0b251016", | ||
| "agent-framework>=1.0.0rc5", |
There was a problem hiding this comment.
Depending on the agent-framework meta-package now pulls in agent-framework-core[all] (see uv.lock), which brings a large set of optional integrations and heavy transitive deps (e.g., pythonnet, durabletask, etc.). If these examples only need the core OpenAI client + MCP tool support, consider depending on agent-framework-core (or a smaller extra set) instead to keep installs lighter and reduce platform-specific dependency risk.
| "agent-framework>=1.0.0rc5", | |
| "agent-framework-core>=1.0.0rc5", |
| client = OpenAIChatClient( | ||
| base_url=f"{os.environ['AZURE_OPENAI_ENDPOINT']}/openai/v1/", |
There was a problem hiding this comment.
AZURE_OPENAI_ENDPOINT in .env-sample ends with a trailing slash, so building base_url as f"{os.environ['AZURE_OPENAI_ENDPOINT']}/openai/v1/" produces a double-slash (...azure.com//openai/v1/). This can break request routing in some HTTP stacks. Consider normalizing the endpoint first (e.g., rstrip('/')) before appending the path.
| client = OpenAIChatClient( | |
| base_url=f"{os.environ['AZURE_OPENAI_ENDPOINT']}/openai/v1/", | |
| azure_endpoint = os.environ["AZURE_OPENAI_ENDPOINT"].rstrip("/") | |
| client = OpenAIChatClient( | |
| base_url=f"{azure_endpoint}/openai/v1/", |
|
I'm okay with those comments. |
Summary
This PR updates the Microsoft Agent Framework examples to the latest API shape and refreshes the related dependencies.
What changed
agent-frameworkto>=1.0.0rc5uv.lockfor the updated Agent Framework dependency graphChatAgentpattern toAgentOpenAIChatClient+ asyncDefaultAzureCredential/get_bearer_token_providerpatterntools=[mcp_server]) instead of passing tools atrun(...)timeresult.textgpt-4.1-miniTavily removal
The Tavily examples were deleted because the Tavily API key was not being handled in a secure way for these samples, and the Tavily examples were not referenced from the README or slide materials.
Files updated
agents/agentframework_http.pyagents/agentframework_learn.pypyproject.tomluv.lockFiles removed
agents/agentframework_tavily.pyagents/langchainv1_tavily.pyNotes
This branch also includes a merge from
upstream/main. If GitHub shows additional changes relative to this repository'smain, those are from bringing the branch up to date with upstream before applying the Agent Framework migration.Validation
uv syncThe Tavily examples were removed after confirming they were not referenced by the project README or slide-like documentation files.