Cursor SDK agent.send() does not retain conversation context across runs

Hey, thanks for the detailed report and the minimal repro, it really helps. This is a confirmed bug: each agent.send() on a local agent starts a fresh run and does not pull in the previous conversation state. Cloud agents cloud: { repos } do this server-side and work correctly. We’re tracking this internally, but I can’t share an ETA for a fix yet.

The same bug is already being discussed here: [SDK] Local agents do not retain conversation context between agent.send() calls`. I’ll merge your post into that thread so all discussion stays in one place.

Workarounds until this is fixed:

  • If your use case allows it, switch to cloud: { repos }, multi-turn works out of the box there.
  • Otherwise, your approach of manually injecting history into the prompt is the right path. I get the downsides like prompt bloat, losing tool call context, and having to manage token limits by hand. The team is working on a native solution.

Once I have an update on the fix, I’ll post it in the main thread.