refactor: remove unneeded sidecar refresh restart logic

Drop the refresh-time sidecar restart workaround and its helper/tests now that the verified fix is in the sidecar subprocess launcher itself. This keeps the runtime simpler and leaves only the changes required for correct Copilot version detection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-22 18:09:35 +01:00
co-authored by Copilot
parent 64a987b48a
commit 91984e9dca
4 changed files with 4 additions and 83 deletions
-31
View File
@@ -1,31 +0,0 @@
import { describe, expect, test } from 'bun:test';
import {
shouldHandleSidecarExit,
shouldRestartSidecarOnCapabilityRefresh,
} from '@main/sidecar/sidecarRefresh';
describe('shouldRestartSidecarOnCapabilityRefresh', () => {
test('restarts the sidecar when no run-turn is active', () => {
expect(shouldRestartSidecarOnCapabilityRefresh(false)).toBe(true);
});
test('keeps the existing sidecar when a run-turn is active', () => {
expect(shouldRestartSidecarOnCapabilityRefresh(true)).toBe(false);
});
});
describe('shouldHandleSidecarExit', () => {
test('handles exit events from the currently active sidecar process', () => {
expect(shouldHandleSidecarExit(1234, 1234)).toBe(true);
});
test('ignores exit events from a stale sidecar process', () => {
expect(shouldHandleSidecarExit(1234, 5678)).toBe(false);
});
test('ignores exit events when either process id is missing', () => {
expect(shouldHandleSidecarExit(undefined, 5678)).toBe(false);
expect(shouldHandleSidecarExit(1234, undefined)).toBe(false);
});
});