Skip to content

Comments

Upgrade azure-ai-agentserver-agentframework to agent-framework 1.0.0b260212#45239

Open
eavanvalkenburg wants to merge 4 commits intoAzure:mainfrom
eavanvalkenburg:fix_agentserver_agentframework
Open

Upgrade azure-ai-agentserver-agentframework to agent-framework 1.0.0b260212#45239
eavanvalkenburg wants to merge 4 commits intoAzure:mainfrom
eavanvalkenburg:fix_agentserver_agentframework

Conversation

@eavanvalkenburg
Copy link
Contributor

Summary

Upgrades the agent-framework dependency from 1.0.0b251007 (Oct 2025) to 1.0.0b260212 (Feb 2026), applying all breaking changes from the official upgrade guide.

Breaking changes applied

  • AgentProtocolSupportsAgentRun
  • ChatMessage/Role/TextContentMessage/string roles/Content
  • AgentRunResponseAgentResponse, AgentRunResponseUpdateAgentResponseUpdate
  • run_stream()run(stream=True) returning ResponseStream
  • isinstance checks → Content.type string discriminator with match statements
  • .create_agent().as_agent() in samples
  • WorkflowBuilder constructor, WorkflowEvent, options pattern in workflow sample
  • setup_observability()configure_azure_monitor() + enable_instrumentation()

Refactoring

  • Replaced unnecessary classes with module-level functions and constants (Constants, AgentIdGenerator, AgentFrameworkInputConverter)
  • Python 3.10+ match statements throughout converters
  • Added text_reasoning content type support
  • Added warning logging for unknown content types
  • Streaming converter uses ResponseStream async iteration pattern

Testing

All 9 unit tests pass.

Copilot AI review requested due to automatic review settings February 18, 2026 16:34
@github-actions github-actions bot added Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Hosted Agents sdk/agentserver/* labels Feb 18, 2026
@github-actions
Copy link

Thank you for your contribution @eavanvalkenburg! We will review the pull request and get back to you soon.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the azure-ai-agentserver-agentframework package to use agent-framework version 1.0.0b260212 (February 2026 release), applying significant breaking changes from the upstream framework. The upgrade modernizes the codebase with Python 3.10+ features and simplifies the architecture.

Changes:

  • Upgraded agent-framework dependencies from 1.0.0b251007 to 1.0.0b260212
  • Refactored utility classes into module-level functions and constants
  • Replaced isinstance checks with Python 3.10+ match statements throughout converters
  • Updated streaming API from run_stream() to run(stream=True) returning ResponseStream
  • Modernized observability setup from setup_observability() to configure_azure_monitor() + enable_instrumentation()

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Updated agent-framework dependencies to version 1.0.0b260212
constants.py Converted Constants class to module-level constants
agent_id_generator.py Converted AgentIdGenerator class to generate_agent_id() function
agent_framework_input_converters.py Refactored AgentFrameworkInputConverter class to transform_input() function; replaced isinstance checks with match statements
agent_framework_output_streaming_converter.py Updated to use AgentResponseUpdate, Content types; added text_reasoning support; replaced isinstance with match statements
agent_framework_output_non_streaming_converter.py Updated to use AgentResponse, Content types; replaced isinstance with match statements
agent_framework.py Updated to use SupportsAgentRun; changed streaming API to run(stream=True); modernized observability setup; removed asyncio timeout logic
test_agent_framework_input_converter.py Updated tests to use transform_input function and new Message/Content APIs
workflow_agent_simple.py Updated to use new Message/Content APIs, WorkflowEvent, WorkflowBuilder(start_executor=...) pattern
minimal_async_example.py Changed create_agent() to as_agent()
mcp_simple.py Changed create_agent() to as_agent()
mcp_apikey.py Changed create_agent() to as_agent()
minimal_example.py Changed create_agent() to as_agent()

eavanvalkenburg and others added 3 commits February 19, 2026 09:59
Breaking changes applied:
- AgentProtocol → SupportsAgentRun
- ChatMessage/Role/TextContent → Message/string roles/Content
- AgentRunResponse → AgentResponse, AgentRunResponseUpdate → AgentResponseUpdate
- run_stream() → run(stream=True) returning ResponseStream
- isinstance checks → Content.type string discriminator with match statements
- .create_agent() → .as_agent() in samples
- WorkflowBuilder constructor, WorkflowEvent, options pattern in workflow sample
- setup_observability() → configure_azure_monitor() + enable_instrumentation()

Refactoring:
- Replace classes with module-level functions and constants
- Use Python 3.10+ match statements throughout converters
- Add text_reasoning content type support
- Add warning logging for unknown content types

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove unused _resolve_stream_timeout method (dead code after asyncio removal)
- Remove unused constants import from agent_framework.py
- Add explicit text_reasoning case in _TextContentStreamingState.convert_content

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Widen _coerce_to_strings return type to list[str | Message] for invariance
- Add explicit result type annotations in function output converters
- Fix str | list[str] union in streaming converter fallback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eavanvalkenburg eavanvalkenburg force-pushed the fix_agentserver_agentframework branch from 96e7cd6 to e6ea939 Compare February 19, 2026 08:59
- Add type annotation for response_data (mypy var-annotated)
- Add missing docstring params, returns, rtypes (pylint C4739/C4741/C4742)
- Initialize self.tracer in __init__ (pylint W0201)
- Change exception logging to debug level (pylint C4766)
- Suppress too-many-return-statements (pylint R0911)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eavanvalkenburg eavanvalkenburg force-pushed the fix_agentserver_agentframework branch from e6ea939 to 0c25128 Compare February 19, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. Hosted Agents sdk/agentserver/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant