feat: support Cursor agent in history with resume and workspace recovery#263
feat: support Cursor agent in history with resume and workspace recovery#263
Conversation
Support Cursor's nested transcript layout and workspace metadata so imported sessions can reopen and resume from the right project state without broken Ghostty launches or stale path aliases. Made-with: Cursor
Backtrack Cursor's encoded workspace resolution and use the last recorded working directory as a hint so resume chooses the right project when flattened path tokens collide. Also share the JSONL scanning path for cwd extraction to reduce duplication and remove the shadowed loop variable. Made-with: Cursor
Compute Cursor's last working directory once per resume request and reuse it for both launch cwd and workspace resolution so large transcripts are not scanned repeatedly. Remove the unused Cursor directory wrapper helpers and cover the precomputed resume-path flow with a focused unit test. Made-with: Cursor
Resolve Cursor workspaces from the encoded transcript path first and only read transcript contents when multiple filesystem matches exist. Keep the existing resume cwd behavior while reducing unnecessary coupling between --workspace recovery and transcript scanning. Made-with: Cursor
Route resume launch and workspace lookup through the same Cursor path helpers so the lazy ambiguity handling lives in one place. This removes duplicate handler logic and keeps future workspace disambiguation changes confined to a single flow. Made-with: Cursor
roborev: Combined Review (
|
Format copied Cursor resume commands with the backend cwd so command-only and launch-failure fallbacks stay runnable without changing the API command field. Also fall back --workspace to the last known cwd when Cursor workspace recovery cannot resolve a project root. Made-with: Cursor
roborev: Combined Review (
|
Normalize expected paths and encode Cursor fixture directories without invalid drive-letter separators so the resume suite passes consistently across macOS and Windows. Made-with: Cursor
roborev: Combined Review (
|
Summary
--workspaceonly needs transcript scanning when multiple filesystem matches existcommand_onlyresume output, and Ghostty AppleScript launch behaviorTest plan
CGO_ENABLED=1 go test -tags fts5 ./internal/server/...go vet ./...make build--workspaceMade with Cursor