Where does the bug appear (feature/product)?
Cursor SDK
Describe the Bug
We run a long-lived Node.js HTTP service that wraps @cursor/sdk for platform automation (Background Agents API, local runtime). During an agent run that had already streamed 163 events over ~7.7 minutes, run.stream() emitted a terminal status=ERROR whose message is:
[deadline_exceeded] bidi_append_deadline_exceeded: append seqno=0 (6832 bytes) exceeded 60105ms deadline
run.wait() then resolved (did not throw) with the same message under error.message. Our host only forwards these SDK events — we do not synthesize bidi_append_deadline_exceeded anywhere in our code.
Steps to Reproduce
-
Install
@cursor/[email protected]on Node.js 22.x inside a containerized Linux sandbox (K8s pod, workspace on mounted volume). -
Create a local agent and start a multi-step agent run (reads + shell commands, resume/continue prompt):
import { Agent, Cursor } from "@cursor/sdk";
await Cursor.me({ apiKey: process.env.CURSOR_API_KEY! });
const agent = await Agent.create({
apiKey: process.env.CURSOR_API_KEY!,
model: { id: "auto" },
local: { cwd: "/workspace/apps/my-repo" },
});
const run = await agent.send("Continue the interrupted session from workspace state…", {
model: { id: "auto" },
});
for await (const event of run.stream()) {
if (event.type === "status" && event.status === "ERROR") {
console.log("terminal status:", JSON.stringify(event));
break;
}
}
const result = await run.wait();
console.log("wait:", JSON.stringify(result));
-
Let the run proceed through several tool calls (including
shell) for several minutes. -
Observe terminal
status=ERRORwithbidi_append_deadline_exceededandrun.wait()returningstatus: "error"with the same message — after substantial streamed output (not an instant startup failure).
We have not isolated a minimal repro yet — reporting with full IDs/logs first to confirm origin and recommended recovery before investing in a standalone repro script.
Expected Behavior
-
If a BidiAppend times out, the SDK should surface a structured, retryable error (or automatically retry/resume the bidi sequence) rather than failing the entire run after ~7 minutes of successful streaming.
-
If the root cause is event-stream delivery stall (shell already finished on the client),
run.wait()/ run state APIs should reflect completed work so callers canresumeinstead of discarding partial conversation. -
Documentation should clarify BidiAppend deadline semantics (
seqno, byte size, ~60s limit) for embedded SDK integrations.
Operating System
Linux
Version Information
SDK (not IDE/CLI — we embed @cursor/sdk in a long-running Node service):
@cursor/sdk: 1.0.26
@cursor/sdk-win32-x64: 1.0.26 (local dev; prod sandbox uses linux x64 package)
Node.js: 22.x
Host: Code Worker Agent (HTTP wrapper around Background Agents API, local runtime)
Integration: Agent.create() + agent.send() + run.stream() + run.wait() + run.conversation()
For AI issues: which model did you use?
{ id: "auto" } (server-routed Auto)
Wait result showed "model":{"id":"default"}.
Additional Information
requestId=95ab67a8-bc05-4325-966f-16aa3d0f20d5
run_id=run-3eaa6075-124c-404b-a9dc-c5e576bc6507
agent_id=agent-716de734-7699-4aef-8de4-06fb4006daac
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor