agents: replay event log from Run.conversation() on worker crash (cursor only) #956
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Depends on
Reference
charles/claude-hooks#956
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As an operator whose service occasionally hard-restarts mid-task, I want cursor-backed sessions to recover their event timeline from
Run.conversation()rather than being a black hole between restart and the next operator action, so I don't lose visibility into what the agent already did.Context
@cursor/sdkexposesRun.conversation(): Promise<ConversationTurn[]>— the structured per-turn history of a run. Today after a crash + restart,redispatch-interruptedre-queues the task, but the old event log is gone (in-memory ring buffer + nothing rebuilt). For claude-code there's no equivalent fallback (the SDK doesn't expose a transcript replay endpoint), so this issue scopes to cursor only.Acceptance criteria
Cursor adapter
Agent.resume(...)— when there is a stored cursor session — callRun.conversation()against the most recent run for that agent and translate eachConversationTurninto the existingTaskEventtypes:assistant,user,tool_progress,tool_summary. Yield them at the head of the run's event stream so the operator immediately sees the prior context.replayed: true) so the event-log + UI can render them differently (faded / dimmed / "from previous run" divider).Event log
TaskRecord.events[i].replayed: booleanfield. Defaultfalse.Frontend
Tests
Run.conversation()result; assert correct event-stream prefix.Out of scope
References
Run.conversation()innode_modules/.bun/@cursor+sdk@1.0.12/node_modules/@cursor/sdk/dist/cjs/run.d.tsjust redispatch-interrupted🤖 Auto-assigned to code-lead (heuristic: area:agents → code-lead (architecture-touching)). Reply
/unassignto reroute.🧹 janitor: this ticket has been idle-assigned since 2026-05-08T15:36:14.000Z. Re-dispatching.
🦵 @charles kicked the queue — re-running implement on @code-lead.