fix: pr-bug-scan validated finding from #2274 (#2296)

Co-authored-by: orca-bug-scan-bot <orca-bug-scan-bot@stably.ai>
This commit is contained in:
buf0-bot[bot]
2026-05-19 11:09:33 -07:00
committed by GitHub
co-authored by orca-bug-scan-bot
parent 4b86fe8292
commit fd2b782b19
+4
View File
@@ -730,6 +730,10 @@ export function registerSshHandlers(
clearProviderPtyState(ptyId)
deletePtyOwnership(ptyId)
}
// Why: reset's connect() can trip onCredentialRequest, which adds to
// credentialRequestedForTarget. Without this delete, a later doConnect
// that doesn't prompt would still persist lastRequiredPassphrase=true.
credentialRequestedForTarget.delete(targetId)
await connectionManager!.disconnect(targetId)
}
}