You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cursor-cli: wire session resume with chat ID persistence #747
Cursor CLI supports cursor-agent --resume [chatId] and agent resume, but the module always starts fresh. Unlike the other agents, resume requires a chat ID from the prior session, and the module has no mechanism to capture or persist one.
--type cursor is already present. No --type change needed.
Desired outcome
On cold start: Cursor starts normally. The chat ID from the new session is captured and persisted.
On warm start: Cursor resumes the prior session using the stored chat ID. The task prompt (currently a positional arg) is not re-sent.
Expose enable_state_persistence in main.tf (default true) and pass it through to the module "agentapi" block so the Coder UI preserves chat history across restarts, matching the agent's resumed session.
Investigation needed first
The exact mechanism for capturing chat IDs is undocumented. Before implementation, test:
Parse cursor-agent ls output for the most recent chat ID.
Monitor ~/.cursor/chats/ for new entries after launch.
Capture from process stdout.
Also verify:
What happens when --resume <chatId> is called with an invalid or missing ID?
Does --resume work in non-interactive/headless mode (as launched by agentapi)?
The format of ~/.cursor/chats/ is undocumented and may change without notice.
If no reliable capture mechanism exists, this ticket is blocked.
Activity