{"version":"2.1.271","anchor":"sandbox-scrubcleanup-now-deferred-until-the-spawned-process","canonical_anchor":"sandbox-scrubcleanup-now-deferred-until-the-spawned-process","heading":"Sandbox scrub\/cleanup now deferred until the spawned process actually exits","tier":"internal","area":"Sandbox","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271\/e\/sandbox-scrubcleanup-now-deferred-until-the-spawned-process","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271","markdown":"### Sandbox scrub\/cleanup now deferred until the spawned process actually exits\n\nSandbox cleanup now waits for the spawned process to actually exit before scrubbing\n\n**What**\n\nSandbox cleanup functions (`cleanupAfterCommand`, `scrubAfterCommand`) now run in response to a spawned process's `exit` or `error` events, instead of running immediately after the command is started. Snapshots of paths needing cleanup \u2014 such as bare git repositories and symlinked deny paths \u2014 are taken before scrubbing begins, so cleanup can use the state as it was prior to scrubbing.\n\n**Why**\n\nRunning cleanup only after the process truly exits avoids scrubbing sandbox state while the command might still be using it, making cleanup more reliable.\n\n- Area: Sandbox\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 2\/5"}