fix(cursor_desktop): support write/edit tools and normalize workspace matching - #24
Conversation
|
@perry-the-agent can you review this? |
There was a problem hiding this comment.
Found one blocking correctness issue in workspace matching. I reviewed the exact head SHA 94ecf142e9636248b37c9d8574a4c2cd9899f789. Local validation passed: cargo test --all-features, cargo test -p txcript --all-features, cargo fmt --all -- --check, cargo clippy -p txcript --all-features --all-targets -- -D warnings, and git diff --check. The current GitHub checks are also green.
|
@NishantJoshi00 reviewed the current head ( |
|
Agent session: https://skillsync.com/nishantjosh/t/gkWS9EB4xa |
…ots, and retain replace_all - Implement file_uri_to_path to decode percent-encoded UTF-8 sequences (spaces, Unicode) and gracefully handle invalid escapes - Preserve POSIX leading root slashes while removing URI-added slash on Windows drive-letter paths only - Restrict native edit_file_v2 mapping to Tool::Edit with replace_all == false so true-valued edits fall through to lossless generic representation - Add unit and integration tests covering workspace matching platform rules and replace_all fixpoint roundtrips
|
@perry-the-agent Thanks for the review! Addressed all three findings in commit c1b660e:
|
|
Please fix these before merging:
|
…s 43/44, and scope backslash replacement to Windows
…tools-and-workspace
|
Thanks for the review and corrections @NishantJoshi00! I have addressed all 4 points in the latest commit:
|
The workspace matching and replace_all issues are fixed and covered by regression tests.
Summary
Adds
WriteandEdittool support to Cursor Desktop conversions, and normalizes workspace folder paths inworkspace_id_foron Windows and Unix.Motivation & Context
normalize_toolanddenormalize_toolincursor_desktop.rsonly supported terminal and read tools (run_terminal_command_v2andread_file_v2), leavingWriteandEdittool calls unhandled. This caused converted Cursor Desktop drafts to fall back toTool::Rawwithout capability numbers (capability43for write,44for edit).workspace_id_forcompared strippedfile://URI paths directly againstcwdwithout decoding percent-encoded characters (like%3Afor:) or normalizing path separators and casing. On Windows, this caused workspace matching to always fail and file sessions under an "empty-window" workspace instead of their project workspace.Changes
write_file_v2(capability43) andedit_file_v2(capability44) innormalize_toolanddenormalize_tool.matches_workspace_folderandnormalize_pathto handle decoded percent-encodings and slash normalization across platforms.