Fix workflow samples for bugbash: part 2 (#4061)

This commit is contained in:
Tao Chen
2026-02-18 20:20:56 -08:00
committed by GitHub
Unverified
parent 21769e2cd1
commit 396807ab17
3 changed files with 5 additions and 6 deletions
@@ -174,6 +174,8 @@ def create_writer_agent() -> Agent:
"""Creates a writer agent with tools."""
return AzureOpenAIResponsesClient(
project_endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"],
# This sample has been tested only on `gpt-5.1` and may not work as intended on other models
# This sample is known to fail on `gpt-5-mini` reasoning input (GH issue #4059)
deployment_name=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
credential=AzureCliCredential(),
).as_agent(
@@ -167,6 +167,8 @@ async def main() -> None:
# Create Azure OpenAI client
client = AzureOpenAIResponsesClient(
project_endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"],
# This sample has been tested only on `gpt-5.1` and may not work as intended on other models
# This sample is known to fail on `gpt-5-mini` reasoning input (GH issue #4059)
deployment_name=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
credential=AzureCliCredential(),
)
@@ -8,7 +8,6 @@ from typing import Any
from agent_framework import (
Agent,
AgentResponseUpdate,
Content,
FileCheckpointStorage,
Workflow,
@@ -120,7 +119,6 @@ def print_handoff_agent_user_request(request: HandoffAgentUserRequest, request_i
print(f"\n{'=' * 60}")
print("User input needed")
print(f"Request ID: {request_id}")
print(f"Awaiting agent: {request.agent_response.agent_id}")
response = request.agent_response
if not response.messages:
@@ -207,7 +205,7 @@ async def main() -> None:
# This creates a new workflow instance to simulate a fresh process start,
# but points it to the same checkpoint storage
while request_events:
print("=" * 60)
print("\n" + "=" * 60)
print("Simulating process restart...")
print("=" * 60)
@@ -240,11 +238,8 @@ async def main() -> None:
# Iterate through streamed events and collect request_info events
request_events: list[WorkflowEvent] = []
async for event in results:
event: WorkflowEvent
if event.type == "request_info":
request_events.append(event)
elif event.type == "output" and isinstance(event.data, AgentResponseUpdate):
print(event.data.text, end="", flush=True)
print("\n" + "=" * 60)
print("DEMO COMPLETE")