Skip to content

Treat partial UDS writes as TransportAmbiguous - #47

Merged
novelKR merged 1 commit into
mainfrom
cursor/p0-write-ambiguity
Sep 17, 2026
Merged

novelKR merged 1 commit into
mainfrom
cursor/p0-write-ambiguity

Conversation

@novelKR

@novelKR novelKR commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Issue

Follow-up to #46. Remaining P0 correctness: a partial UDS frame write must not be classified as TransportBeforeDispatch, and --runner must not silently fall back to in-process.

Summary

UdsRunner::call now probes whether write_frame reached socket I/O. Encode or !alive stays TransportBeforeDispatch. Any write_all / flush error after poll_write is TransportAmbiguous and closes the torn connection so exec keeps the workspace lease. --runner / CODESPACE_RUNNER is a clap ValueEnum (in-process | uds); unknown values are rejected.

Contract changes

None. MCP tool schemas, ErrorCode, and LIVE_TOOLS are unchanged.

Tests

  • cargo fmt --all
  • cargo check --offline --all-targets
  • cargo clippy --offline --all-targets -- -D warnings
  • python3 -B scripts/check_docs.py (operations hashes recorded)
  • cargo test could not run here: linking failed with Xcode license (cc exit 69). New tests compile under clippy --all-targets.

Security scenarios

A write that may have reached the worker is no longer mapped to BeforeDispatch, so exec_command does not release_process() while the worker might still be running. Unknown --runner values (udss, container) fail closed instead of running in-process.

Out of scope

PTY / process_resize, linux-sandbox, network, reconnect, approval. This PR is not merged; #46 is already on main.

Open in Web Open in Cursor 

write_frame I/O after poll_write may have put bytes on the socket, so
exec must keep the workspace lease. Encode and !alive stay
BeforeDispatch. --runner is a ValueEnum so unknown values are rejected
instead of silently using in-process.

Co-authored-by: Cursor <cursoragent@cursor.com>
@novelKR
novelKR marked this pull request as ready for review September 17, 2026 15:28
@novelKR
novelKR merged commit 5a6cb61 into main Sep 17, 2026
4 checks passed
@novelKR
novelKR deleted the cursor/p0-write-ambiguity branch September 17, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant