Skip to content

Migrate from AutoGen 0.4 to Microsoft Agent Framework#8

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/rewrite-codebase-to-microsoft-agent
Draft

Migrate from AutoGen 0.4 to Microsoft Agent Framework#8
Copilot wants to merge 6 commits intomainfrom
copilot/rewrite-codebase-to-microsoft-agent

Conversation

Copy link

Copilot AI commented Nov 9, 2025

AutoGen 0.4 is in maintenance mode. Microsoft Agent Framework is the actively developed successor combining AutoGen's multi-agent orchestration with Semantic Kernel's enterprise features.

Changes

Core Migration

  • Dependencies: autogen-agentchatagent-framework
  • Agents: AssistantAgentChatAgent with AzureOpenAIChatClient
  • Parameters: system_messageinstructions, removed model_capabilities dict
  • Auth: Added Azure CLI credential support with API key fallback

Group Chat Orchestration

MAF lacks AutoGen's SelectorGroupChat. Implemented custom orchestration:

  • Orchestrator agent selects next speaker via LLM call
  • Message history maintained across turns
  • User interaction handled directly in loop
  • Termination on "TERMINATE" from orchestrator

Before (AutoGen):

team = SelectorGroupChat(
    [agent1, agent2, agent3],
    model_client=AzureOpenAIChatCompletionClient(...),
    termination_condition=TextMentionTermination("TERMINATE")
)
stream = team.run_stream(task=prompt)

After (MAF):

chat_client = AzureOpenAIChatClient(
    endpoint=endpoint,
    model=model,
    credential=DefaultAzureCredential()  # or api_key
)
agent = ChatAgent(name="...", chat_client=chat_client, instructions="...")

# Custom orchestration loop
while active:
    selector_result = await orchestrator.run(messages + [selector_prompt])
    next_agent = find_agent(selector_result.text)
    result = await next_agent.run(messages=messages)
    messages.append({"role": "assistant", "name": next_agent.name, "content": result.text})

Files Modified

  • journalism_research.py, shopping.py: Full MAF migration with custom orchestration
  • requirements.txt: Updated to agent-framework, azure-identity
  • README.md: New auth instructions, MAF references
  • MIGRATION.md: Technical migration guide with before/after patterns
  • test_migration.py: Import and syntax validation

Validation

  • ✅ All imports functional
  • ✅ CodeQL: 0 alerts
  • ✅ No dependency vulnerabilities

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • learn.microsoft.com
    • Triggering command: curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Rewrite this entire codebase using the Microsoft Agent Framework instead of AutoGen 0.4</issue_title>
<issue_description>Update this code (specifically the journalism_research.py script) of multiple agents collaborating to craft an article for a journalist, to use Microsoft Agent Framework instead of AutoGen 0.4. Please also update the requirements.txt and the README with any requirements for proper installation to run it.

There is a migration guide from AutoGen to Microsoft Agent Framework at https://learn.microsoft.com/en-us/agent-framework/migration-guide/from-autogen/. Other Microsoft Agent Framework documentation is at https://learn.microsoft.com/en-us/agent-framework/user-guide/overview.
</issue_description>

<agent_instructions>Change the minimal amount of code necessary to complete the request. Only make sweeping changes if they are necessary. Consider performance and security in your solution. </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits November 9, 2025 22:31
Co-authored-by: jennifermarsman <10062762+jennifermarsman@users.noreply.github.com>
Co-authored-by: jennifermarsman <10062762+jennifermarsman@users.noreply.github.com>
Co-authored-by: jennifermarsman <10062762+jennifermarsman@users.noreply.github.com>
Co-authored-by: jennifermarsman <10062762+jennifermarsman@users.noreply.github.com>
Co-authored-by: jennifermarsman <10062762+jennifermarsman@users.noreply.github.com>
Copilot AI changed the title [WIP] Rewrite codebase to use Microsoft Agent Framework Migrate from AutoGen 0.4 to Microsoft Agent Framework Nov 9, 2025
Copilot AI requested a review from jennifermarsman November 9, 2025 22:44
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.

Rewrite this entire codebase using the Microsoft Agent Framework instead of AutoGen 0.4

2 participants