DEV Community

Cover image for Why does an AI agent lose context on reboot?
Edward Izgorodin
Edward Izgorodin

Posted on

Why does an AI agent lose context on reboot?

An AI agent can lose its context on a reboot with the whole conversation still on disk, because nothing reads it back.

Local agents in Cursor's SDK, the npm package @cursor/sdk, lost context this way until Cursor announced a fix in August. Tom_Peck reported the bug on the Cursor forum on 30 April, against version 1.0.10 on macOS, with a two-message test anyone can copy. Tell the agent your favourite colour is teal and ask it to reply "noted", then ask for the colour. A cloud agent answered "noted" and then "teal". A local agent answered "noted" and then "Unknown", in the same Node process, across separate processes and with Agent.resume().

The reporter also looked at the disk. The local index.db "does show both runs in the runs table and full event payloads in run_events", while Agent.messages.list for the local runtime returned []. They summed it up as "data is being persisted; it just isn't loaded as context for follow-up sends".

Both runs on disk, messages.list() returning an empty list, and 114 days from the report on 30 April to the request for a recheck on 22 August

Cursor's deanrie wrote back the same day that "the write path to the local store works, but the read path isn't pulling history into the follow-up send()". The suggested workaround was to use a cloud agent or to "manually include prior turns in the prompt on each send()". On 5 May a second developer reproduced the bug on Linux with three other versions, and on 11 May deanrie agreed that the drawbacks a user had listed, "no context compression, prompt bloat, and lost tool call context", were valid. In June another user called the workaround "incredibly inefficient".

On 22 August, 114 days after the report, deanrie posted that local agents now save and reload conversation state differently and asked for a recheck on 1.0.28. Colin, also from Cursor, said on 27 August that it works on the latest version, "including after resuming the agent from a new process". None of the reporters has confirmed it in the threads.

The restart was not the cause. The bug showed up inside a single process too. Someone who first met it after a reboot would blame the reboot and start with the code that saves the context. Both runs were in the store, so a test that only checked the disk would have passed.

After every change that touches memory I would run the two-message test twice, once in the same process and once from a new one, and fail the build unless the answer is teal both times.

The quotes and dates come from the three forum threads (topics 159440, 159750 and 159798) and the npm entry for @cursor/sdk. I read all four on 19 November 2026. If a reporter has confirmed the fix since then, it is not in this note.

I work on Mnemoverse; I have not run Cursor's SDK myself, so the bug and the fix are as its users and staff reported them.

Top comments (0)