From fa7950121dbce5de9e84c63d8aa8f72a64479198 Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Sun, 8 Nov 2026 21:06:26 -0600 Subject: [PATCH] fix(native): move an interrupted bootstrap's session aside on the run's own created sandbox lease (#20154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - When restart recovery proves a remote bootstrap reached no provider work, it bootstraps the same run again in the same sandbox. Before relaunching, it stops the interrupted runner (#20103) > - The relaunch starts a fresh controller record, whose command ids restart at `command_prp_00000001`. The sandbox still held the interrupted runner's journal, which had already recorded that command id with different data > - The relaunched runnerd rejected it ("commandId was reused with different command data") and exited while waiting for `run.prepare`. Every same-run retry collided the same way until the retry budget ran out and the task blocked > - The proven interrupted-bootstrap session move (#20103) ran only for a resumed lease. A same-run retry on a per-turn sandbox reuses the run's own created lease, so nothing moved the interrupted session aside > - This pull request applies that same proof-gated session move on the run's own created lease > - The benefit is that a same-run bootstrap retry starts its runner on a clean journal, and the old journal is kept as evidence ## Linked Issues or Issue Description Refs #20103 **What happened?** Daytona per-turn restart-chaos M1 rerun w-20261109T013733-s9501 (master 8e3b64a257, image 34bc12bf): - **t10 (codex M1):** the codex subtask's run `f8a8f483` went through eleven same-run bootstrap retries between 01:56 and 02:07. - Each relaunched runnerd logged `paperclip-runnerd: commandId was reused with different command data` and exited about 12 s later while waiting for `run.prepare`. - The run then failed `native_session_retry_exhausted` ("Provider startup failed on 3 attempts before any provider work began"). The subtask blocked, and so did the parent. - **t02:** the same "runnerd exited while waiting for run.prepare" pattern appeared on retry run `2e13568f`. **Expected behavior** A same-run bootstrap retry moves the interrupted session aside, keeping it as a `.bootstrap-restart-