Files
PaperClipAI/server
Priya RamanandPaperclip 81951535e9 feat(server): reopen an archived isolated execution workspace in place
Make an archived isolated execution workspace usable again, so a terminal
issue can resume without a dead end. Reopen the same workspace row: flip it
back to active and rebuild the worktree. Do not create a new row and do not
change any issue-to-workspace link, so every issue that shares the row keeps
access.

Add reopenClosedIsolatedExecutionWorkspaceForIssue in the execution workspace
service. It binds the workspace to the issue company and project, accepts only
an isolated workspace in a closed state, and fails closed with no workspace
detail on a mismatch. It rebuilds the worktree first and publishes active only
on success. A rebuild failure keeps the row closed and returns an error, so the
caller never dispatches a run against a broken workspace.

Fence a cleanup against a concurrent reopen. Every archive and every reopen
raises a lifecycle generation stored in the workspace metadata. Reopen and the
destructive cleanup paths take the same transaction-scoped Postgres advisory
lock. A cleanup captures the generation it archived at and re-checks it under
the lock before it deletes the worktree. A reopen that ran in between raises the
generation, so the stale cleanup does nothing. The terminal-workspace reaper and
the archive route both use this fence.

Wire the reopen at the resume, checkout, and comment guards. Each guard runs
after the route authorizes the request on the issue. A closed isolated workspace
now reopens and the request continues, instead of a 409 dead end. A
non-reopenable workspace returns 409 and a rebuild failure returns 503.

Enable the comment composer for a reopened issue and show a hint that the next
comment or resume rebuilds the worktree.

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-08-13 01:18:02 +00:00
..
2026-03-12 13:09:22 -05:00