fix(opencode): keep Windows marker cleanup conservative

This commit is contained in:
777genius 2026-05-16 09:15:35 +03:00
parent f3a01d173f
commit 31bfd5ebb3
2 changed files with 3 additions and 4 deletions

View file

@ -102,7 +102,6 @@ export async function cleanupManagedOpenCodeServeProcesses(
isManagedByWindowsCommand || Boolean(details && isManagedOpenCodeServeProcessDetails(details));
const hasRequiredDetailsMarkers =
requiredDetailsMarkers.length === 0 ||
(isManagedByWindowsCommand && details === null) ||
Boolean(details && processDetailsIncludeMarkers(details, requiredDetailsMarkers));
if (!isManaged || !hasRequiredDetailsMarkers) {
result.candidates.push({

View file

@ -403,7 +403,7 @@ describe('OpenCodeManagedHostProcessCleanup', () => {
expect(result.diagnostics).toEqual([]);
});
it('does not require unreadable Windows details for app-managed command fallback cleanup', async () => {
it('honors required markers when Windows details are unavailable', async () => {
const killProcess = vi.fn();
const result = await cleanupManagedOpenCodeServeProcesses({
@ -425,8 +425,8 @@ describe('OpenCodeManagedHostProcessCleanup', () => {
killProcess,
});
expect(killProcess).toHaveBeenCalledWith(71629);
expect(result.candidates[0]).toMatchObject({ pid: 71629, action: 'killed' });
expect(killProcess).not.toHaveBeenCalled();
expect(result.candidates[0]).toMatchObject({ pid: 71629, action: 'kept_unmanaged' });
expect(result.diagnostics).toEqual([]);
});