Skip to content

🤖 fix: roll back create/fork/rename artifacts when the registration config write rejects #4745

Description

@ThomasK33

Problem

When the registration config edit rejects, WorkspaceService.create, createMultiProject, fork and rename return Err, but they do not roll back what already exists:

  • create / createMultiProject (src/node/services/workspaceService.ts ~5667 / ~6108): the worktree(s) or container directory, the session, the init state and the abort controller stay behind.
  • fork (~11456, via config.addWorkspace): the same leftovers.
  • rename (~8282): the runtime has already renamed the directory and branch on disk. The rename is not reverted, so disk and config disagree.

This already happens for every existing editConfig rejection source (the corrupt-file gate, a lost registration lock, a throwing transform). With #4444, a failed save rejects too, so disk-full or unwritable-root cases hit these paths.

Suggested direction

Give each flow one cleanup path for "registration edit rejected" that reuses the existing failure cleanup (createScratch already does this at ~5372). Keep it to one design that covers success, failure, cancellation and opt-outs; see #4440 for why per-path fixes did not converge.

Refs #4444 (follow-up F1 from its plan).


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $34.57

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions