Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from azure.ai.projects.models import (
PromptAgentDefinition,
WorkflowAgentDefinition,
ItemResourceType,
ItemResource,
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

ItemResource is imported but never used in this sample. This will trigger unused-import linting in many CI configurations. If the intent is to avoid string literals for the item type check, consider importing/using ItemResourceType instead; otherwise remove this import entirely.

Suggested change
ItemResource,

Copilot uses AI. Check for mistakes.
)

load_dotenv()
Expand Down Expand Up @@ -157,7 +157,7 @@
print(f"Event {event.sequence_number} type '{event.type}'", end="")
if (
event.type == "response.output_item.added" or event.type == "response.output_item.done"
) and event.item.type == ItemResourceType.WORKFLOW_ACTION:
) and event.item is not None and event.item.type == "workflow_action":
Comment on lines 158 to +160
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This condition hard-codes the item type as the string "workflow_action". The SDK already defines this value in ItemResourceType.WORKFLOW_ACTION, which is safer (avoids typos and stays aligned if the constant ever changes). You can keep the new event.item is not None guard, but compare event.item.type against the enum constant instead of a raw string.

Copilot uses AI. Check for mistakes.
print(
f": item action ID '{event.item.action_id}' is '{event.item.status}' (previous action ID: '{event.item.previous_action_id}')",
end="",
Expand Down
Loading