Aiden Agent

A physical mobile AI agent device that plugs into any phone

Visit Website
August 25, 2026 How Aiden Agents Survive Running Out of Context Mid-Task

Shipped something this week I want to talk through, because it's the kind of unglamorous infra work that never makes a good demo but matters a lot once real users hit it.

We're building Aiden, a physical device that lets an AI agent operate your phone/computer directly, still dev-board stage, still very much a work in progress. One problem we kept running into internally: long-running agent tasks eventually hit a wall. Either the context window fills up, or a tool call hands back more data than fits in what's left of it.

Here's the thing nobody tells you when you start building agents: the "obvious" fixes are both bad. Just fail the task? Terrible UX, especially for anything that took real time to get partway through. Just restart and hope for the best? Worse, actually, because the agent quietly repeats work it already did, or worse, on a device-control agent like ours, might re-attempt an action that already happened.

So this week we shipped a real fix. When a task hits a context limit, the agent now compresses context, can switch sessions if needed, and recovers from a saved result file, reading back a continuation ID, the prior state, any errors, and the tail of the last output, before deciding whether it's actually safe to continue.

The part I think is worth sharing beyond just "we fixed a bug": we made recovery a decision, not a default. The agent doesn't just assume "compress and keep going" is always right. It reads what actually happened first. That's a small design choice with a big effect on trust, especially for something that's physically tapping buttons on your phone.

Real PRs if you want to see the actual implementation: #497, #498, #530. Firmware's fully open source.

Being honest about scope: this doesn't give us unlimited context, and it's not a fix for every way a long task can fail (network issues, provider outages, and changed device state are all still real problems). It's specifically about not losing your place when you hit this one common wall.

Curious if other folks building agent products have run into the same "restart vs. silently repeat work" problem, and how you've handled it. Feels like one of those things that's invisible until it isn't.

Firmware: github.com/AidenAI-IO/aiden-firmware Discord if you want to talk shop: discord.com/invite/bcJavjcnYz

1 Comment

  1. 1

    The strongest part is making recovery conditional on understanding what already happened. For an agent operating a real device, blindly restarting can be much worse than stopping, so treating recovery as a decision rather than a default seems important.

About

AI can talk, but it can't act on your phone, since most apps have no API for it. Aiden fixes that now: it plugs in and operates your phone directly, no API, no waiting for 2028, and preserved privacy.