This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
A production agent run returns with status requires_action. What does requires_action indicate and what should the loop do next?
requires_action
The agent encountered an error and needs to be restarted with a new thread.
The agent paused to wait for tool call results; retrieve the required tool calls, execute them, and submit results back to continue the run.
The agent needs a new user message before it can proceed; add a follow-up message to the thread and create a new run.
Your production agent processes 20-30 turns in a long research session, and you observe that token costs are scaling linearly with session length. Which context management strategy best addresses this observation while preserving essential research context?
Delete the thread and start a new one when message count exceeds 20.
Set max_prompt_tokens on every run to cap the input regardless of thread length.
max_prompt_tokens
Periodically summarize older messages and inject the summary as a high-priority system message, then prune the raw messages it replaced.
An analyst wants to explore two investment hypotheses simultaneously from the same research starting point. Which pattern best supports this analysis while minimizing redundant computation?
Create two separate agents with identical system prompts and run them independently from the start.
Serialize the thread state at the divergence point as a checkpoint, restore it into two new threads, then run each with its diverging hypothesis instruction.
Add both hypothesis instructions as separate user messages in the same thread and run the agent once.
You call responses.create() in Agents v2 and the response contains one message item and two tool call items. What is the correct next step?
responses.create()
Check response.status for requires_action, retrieve the tool calls, and call submit_tool_outputs_and_poll() to resume the run.
response.status
submit_tool_outputs_and_poll()
Iterate response.output to find tool call items, execute the functions locally, and call responses.create() again passing the results as input items.
response.output
Display the message item to the user—tool calls in v2 execute server-side automatically without any client action.
Which two changes are most significant when migrating from Agents v1 to Agents v2?
Replace single AgentsClient with a split client (AIProjectClient + OpenAI client), and replace the run-polling loop with a synchronous responses.create() call that returns output items directly.
AgentsClient
AIProjectClient
Rename threads.create() to conversations.create() and rename runs.create() to responses.create()—all other code remains identical.
threads.create()
conversations.create()
runs.create()
Update the import path from azure.ai.agents to azure.ai.projects—the rest of the API is backward compatible.
azure.ai.agents
azure.ai.projects
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?