fix(projectController): reconnect SSH before running deferred cleanups on manual clean (aicshud/WHEEL#1023) - #141
Merged
so5 merged 2 commits intoSep 16, 2026
Conversation
onCleanProject() must reconnect SSH for any remotehost with a pending deferred cleanup (left behind by stopProject(), aicshud/WHEEL#1020/#1021) before it can call runDeferredCleanups() - the SSH connection was already unconditionally torn down by stopProject(). - transferrer.js: getDeferredCleanupRemotehostIDs() does not exist yet. - handlers/projectController.js: onCleanProject() does not attempt any SSH reconnection, so a pending deferred cleanup is silently dropped once the project is cleaned instead of resumed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C3jKNM1qubomM8UTRdkEWu
…s on manual clean (aicshud/WHEEL#1023) stopProject() (aicshud/WHEEL#1020/#1021) unconditionally disconnects every SSH connection on stop, but deliberately leaves deferredCleanupRegistry populated: a not-yet-executed downstream task may still need the preserved remote-symlink target file if the project is resumed. If the user cleans the project instead of resuming it, that entry never gets a chance to run naturally - only runProject()'s own natural-completion path calls runDeferredCleanups() - permanently leaking the preserved remote files. - transferrer.js: add getDeferredCleanupRemotehostIDs(), a non-mutating peek at which remotehosts a project still has pending deferred cleanups for. - handlers/projectController.js: add reconnectAndRunDeferredCleanups(), called from onCleanProject() before cleanProject()'s git reset. It resolves each pending remotehostID's connection info the same way runDispatcher() does, reconnects via createSsh() (which may prompt for a password/passphrase - acceptable here since cleanProject is only ever triggered by an explicit user action), runs the deferred cleanups, then disconnects again. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C3jKNM1qubomM8UTRdkEWu
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
Fixes
aicshud/WHEEL#1023: when a project with a pending deferred remote-file cleanup (left behind bystopProject(), seeaicshud/WHEEL#1020/#1021, merged in #140) is cleaned instead of resumed, the preserved remote files were permanently leaked, sinceonCleanProject()never calledrunDeferredCleanups()and, even if it had, the SSH connection needed to run it was already disconnected bystopProject().What changed
transferrer.js: addedgetDeferredCleanupRemotehostIDs(), a non-mutating peek at which remotehosts a project still has pending deferred cleanups for.handlers/projectController.js: addedreconnectAndRunDeferredCleanups(), called fromonCleanProject()beforecleanProject()'s git reset. For each pending remotehost it resolves the connection info the same wayrunDispatcher()does, reconnects viacreateSsh()(which may prompt for a password/passphrase - acceptable sincecleanProjectis only ever triggered by an explicit user action), runs the deferred cleanups, then disconnects again.Testing
npm run testDocker -w server— full suite green (1662 passing, 15 pending, 0 failing), both before and after rebasing ontomainpost-fix: SSH-race and remote-resource-leak fixes around stopProject/runProject (aicshud/WHEEL#1020, #1021, #1022) #140-merge.Related
Filed against
aicshud/WHEEL#1023on GitLab (issue tracker for this project). Builds directly onaicshud/WHEEL#1020/#1021/#1022(merged in #140).🤖 Generated with Claude Code
https://claude.ai/code/session_01C3jKNM1qubomM8UTRdkEWu