What 9 years of shipping iOS apps changed about how I build agents

Reddit r/AI_Agents News

Summary

An experienced iOS developer shares nine years of mobile engineering lessons applied to building AI agents, emphasizing tool output validation, stale-state handling, and treating the code around the model—not the model itself—as the reliability layer.

I've spent most of my career shipping iOS apps at scale. The first agents I built failed in ways that felt new, until I realised they were the same problems I'd already spent years fixing on mobile. A 200 from a tool is not success. In iOS, I never trusted a "success" API response without checking the payload. Agents do the same thing: they take a tool result at face value and keep going. I now validate tool output in code (types, required fields, whether an id actually exists) before the model sees it. If it's garbage, the model gets a specific error, not a blob. Stale state is worse than a crash. A crash is obvious. An agent following last month's instructions, or an outdated cache, looks confident and is wrong. Same as a mobile app showing yesterday's cart. I date every rule, and if the live system and the instructions disagree, the system wins and the agent stops. Silent retries will burn you. On mobile, retrying a 400 is a bug. Retrying a timeout is the client's job, not the user's. I put the same split in the agent loop: transient errors retry in code, and validation or permission errors never get the same call twice. The model is not the reliability layer. The checks around it are. That's the least glamorous lesson from mobile, and the one that transferred most cleanly.
Original Article

Similar Articles

What building AI agents taught me

Reddit r/AI_Agents

The author reflects on building AI agents, highlighting challenges like inconsistent outputs, context management, and the importance of using deterministic approaches when appropriate.