Five agent engineering problems, with the numbers behind them
The agent conversation on Reddit and in GitHub issues has moved. A year ago it was "what can agents do". Now it is "why does mine call the same tool nineteen times", and "what happens to my threads on August 26". Here are five problems that keep coming up, each with the specific fact I had to dig out to answer it. Every one of them has a number attached, because "it depends" is not an answer you…
1. Agents can get stuck in an infinite loop when the tool_choice setting remains active across model calls. This happens when tool_choice is set to required or a named function, causing the agent to repeatedly call the same tool. The merged fix in openai-agents-python resolves this issue by resetting tool_choice to auto after tool execution.
Step one is to upgrade, not apply workarounds. Step two, which is often overlooked, involves detecting repetitive tool calls by matching the tool name and identical arguments in succession, with a default limit of 8 sequential tool calls.
2. The Assistants API will be retired on August 26, 2026, causing existing threads to be left stranded without a platform. OpenAI's deprecation page specifies the removal date, and there will be no degraded mode or grace period. Migrating Threads to Conversations is straightforward, but the challenge lies in exporting the raw JSON data before the migration.
Notably, vector stores and files remain functional, but thread-created stores expire seven days after the last use, potentially leading to data loss. Additionally, Azure users should be aware that their migration destination is Microsoft's Foundry Agents rather than the Responses API.
3. The AutoGen framework is in maintenance mode, with no new features or enhancements planned. It will be community-managed going forward. Microsoft Agent Framework serves as the successor, incorporating elements from both AutoGen and Semantic Kernel. While single agents can be easily ported in a short period, multi-agent teams face challenges due to the structural differences between AutoGen's event-driven Team and Microsoft's graph-based Workflow.
Agents in the new framework are stateless and do not maintain history between calls, unlike AssistantAgent. Additionally, agents will continue calling tools until the task is completed instead of stopping at a predetermined count, providing more flexibility for simple tasks and potentially impacting pricing. It is crucial to verify model providers before initiating the migration process.
4. Balancing agent memory and prompt caching presents a significant challenge. Agent memory is often perceived as a storage issue, requiring vector stores and summarization when the window fills. However, this approach overlooks the cost implications. Prompt caching operates as a prefix match, with memory preferring to reside high in the prompt, adjacent to the system instructions.
This positioning incurs the highest cost in the request. Anthropic's caching reference provides cost comparisons: cache reads cost 0.1x of the base input, while five-minute and one-hour writes are 1.25x and 2x the cost, respectively. Swapping a read for a five-minute write can be 12.5x more expensive for the same tokens. Moreover, there is a minimum token threshold for cacheable prefixes, which varies depending on the model provider.
Clearing memory is different from summarizing context, as clearing simply drops old tool results without permanent loss of information. For agents with extensive tool usage, clearing is the recommended approach.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.