feat(remote): complete typed mutation protocol - #419
Merged
Merged
Conversation
Contributor
|
🚀 Web preview: https://preview-419.treq-9zy.pages.dev |
Ziinc
marked this pull request as ready for review
September 4, 2026 19:32
Expose matching TreqCommandRequest variants in Rust, CLI, Tauri IPC, and TypeScript for clone/init, workspace/file/commit/conflict/git/agent mutations. Require idempotency keys on non-naturally-idempotent mutations, implement non-interactive SplitCommit with explicit files/hunks, and send AgentInput through the VM-local supervisor FIFO. Co-authored-by: ty <ty@tzeyiing.com>
Windows has no FIFO, so the stdin-echo assertion is Unix-only. Always stop the helper process on Drop so a failed assertion cannot leak ping.exe. Co-authored-by: ty <ty@tzeyiing.com>
Ziinc
force-pushed
the
cursor/typed-remote-mutation-protocol-40f6
branch
from
September 5, 2026 19:26
37781fb to
e647875
Compare
…_deref PR 419 made idempotency_key a required String (validated at the CLI boundary) rather than main's prior Option<String>. The 5-arg with_idempotency_key call sites and two test fixtures still assumed the old Option shape after the rebase.
…ype drift main had advanced past this branch's rebase point with several more merged PRs, including native SSH config alias resolution which added clone_repo_native() still using the old Option<String> idempotency_key shape. Updated it to the required String this branch introduced.
The merge with main left duplicate CloneRepo/InitRepo TypeScript union members: an old shape with idempotency_key optional alongside the new required-string shape this branch introduced. The optional variant let callers (and the remote-ssh integration test) omit the field entirely, which the Rust side now rejects with "missing field idempotency_key" since the field is a required String there.
IdempotencyStore::open() eagerly creates <repo>/.treq/ when opened. Scoping it at the clone destination itself meant that directory existed (non-empty) by the time git clone ran, so git refused with "destination path already exists and is not an empty directory" on every clone. The destination is supposed to not exist yet; its parent is what's guaranteed to be there.
Ziinc
pushed a commit
that referenced
this pull request
Sep 6, 2026
main's typed mutation protocol (#419) removed isRemoteActionSupported and wired SplitCommit/AgentInput end-to-end, so remote-capabilities.ts marks them supported instead of reading a removed helper.
Ziinc
pushed a commit
that referenced
this pull request
Sep 6, 2026
PR #419 changed TreqCommandRequest's idempotency_key fields from Option<String> to required String; update the native e2e test's InitRepo/CreateWorkspace calls to match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the Phase 5 gap between Rust
TreqCommandRequestand the TypeScript IPC union. SplitCommit is a non-interactive typed mutation (selected files/hunks). AgentInput writes to the VM-local supervisor FIFO. Arbitrary command strings stay out of frontend and IPC types.Supported commands
Reads: InspectRepository, RepositoryStatus, ListBranches, ListWorkspaces, InspectWorkspace, ListChanges, DiffFile, ReadFile, ListCommits, ListConflicts, WorkspaceChangeMarker, ProbeRepo, AgentStatus, AgentLogs
Naturally idempotent mutations / ops (no key): UpdateWorkspace, DeleteWorkspace, RestoreFile, DescribeCommit, GitFetch, GitBookmarkTrack, AgentStop
Mutations that require an idempotency key: CloneRepo, InitRepo, CreateWorkspace, RenameWorkspace, MoveWorkspaceChanges, RebaseWorkspace, PatchFile, CreateCommit, SplitCommit, MoveCommit, AbandonCommit, ResolveConflict, GitPush, AgentStart, AgentInput
Idempotency
Non-naturally-idempotent mutations require a non-empty
idempotency_key. Replay uses the existing in-process map (not durable storage). Empty keys are rejected.SplitCommit
Request carries
filesandhunks. Execution unions those paths and calls existingjj_split. Empty files and hunks isinvalid_arguments. No interactive hunk selector.AgentInput
Start opens a Unix FIFO plus a keeper process so stdin survives CLI process exit. Missing record →
agent_not_found. Stopped process →agent_not_running. Windows has no FIFO; input is written to a file while the process is alive.Intentional limitations
jj_split.Tests run
npm run build:napivitest src/lib/remote-dispatch.test.tscargo test --libin this VMjjis missing (No such file or directory)rust / test / ubuntu-22.04andmacos-latestrust / test / windows-latestsend_agent_input_reaches_a_running_process(ping leak + no FIFO echo); fixed in follow-up commitcheck-conventional-title