Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

fix(report-bug): describe the machine and runtime when the backend is down (#3156)

velixiodeef5595611d
diff --git a/electron/src/renderer/src/components/report-bug.test.tsx b/electron/src/renderer/src/components/report-bug.test.tsx
index ff36d3b1f..270db09b1 100644
--- a/electron/src/renderer/src/components/report-bug.test.tsx
+++ b/electron/src/renderer/src/components/report-bug.test.tsx
@@ -26,6 +26,7 @@ const mock = vi.hoisted(() => ({
open: vi.fn().mockResolvedValue(undefined),
updateState: vi.fn(),
backendStatus: vi.fn(),
+ hostSnapshot: vi.fn(),
navigate: vi.fn(),
}));
vi.mock('@/lib/api/client', () => ({ apiJson: mock.api }));
@@ -35,7 +36,7 @@ vi.mock('./bridge', () => ({
? {
files: { openExternal: mock.open },
updates: { getState: mock.updateState },
- backend: { getStatus: mock.backendStatus },
+ backend: { getStatus: mock.backendStatus, getHostSnapshot: mock.hostSnapshot },
}
: null,
}));
@@ -52,6 +53,7 @@ beforeEach(() => {
progress: 0,
});
mock.backendStatus.mockResolvedValue(null);
+ mock.hostSnapshot.mockResolvedValue(null);
});
afterEach(() => {
cleanup();
@@ -155,6 +157,38 @@ it('includes the durable native crash journal when the backend API is unavailabl
expect(body).toContain('durable native failure');
});
+it('describes the machine and runtime from the app when the backend never started (#3156)', async () => {
+ mock.api.mockRejectedValue(new Error('offline'));
+ mock.hostSnapshot.mockResolvedValue({
+ os: 'win32 Windows 11 Pro (10.0.26100)',
+ arch: 'x64',
+ ramGb: 32,
+ diskFreeGb: 12.5,
+ runtime: { pythonPresent: false, uvPresent: true, pathFlags: ['onedrive', 'non-ascii'] },
+ });
+ render(<ReportBug />);
+ fireEvent.click(screen.getByRole('button', { name: 'reportBug.label' }));
+ await waitFor(() => expect(mock.open).toHaveBeenCalledTimes(1));
+ const body = new URL(mock.open.mock.calls[0]![0]).searchParams.get('body')!;
+ expect(body).toContain('os (app): win32 Windows 11 Pro (10.0.26100)');
+ expect(body).toContain('runtime python: MISSING');
+ expect(body).toContain('runtime path flags: onedrive, non-ascii');
+});
+it('does not repeat machine facts the backend already reported', async () => {
+ mock.api.mockImplementation((path: string) =>
+ Promise.resolve(path === '/system/info' ? { platform: 'linux' } : {}),
+ );
+ mock.hostSnapshot.mockResolvedValue({
+ os: 'linux 6.1',
+ runtime: { pythonPresent: true, uvPresent: true, pathFlags: [] },
+ });
+ render(<ReportBug />);
+ fireEvent.click(screen.getByRole('button', { name: 'reportBug.label' }));
+ await waitFor(() => expect(mock.open).toHaveBeenCalledTimes(1));
+ const body = new URL(mock.open.mock.calls[0]![0]).searchParams.get('body')!;
+ expect(body).not.toContain('os (app)');
+ expect(body).toContain('runtime python: present');
+});
it('labels the previous unclean shutdown separately and does not acknowledge it', async () => {
mock.api.mockImplementation((path: string) =>
Promise.resolve(
diff --git a/electron/src/renderer/src/components/report-bug.tsx b/electron/src/renderer/src/components/report-bug.tsx
index 9c363a6be..4d0631987 100644
--- a/electron/src/renderer/src/components/report-bug.tsx
+++ b/electron/src/renderer/src/components/report-bug.tsx
@@ -5,6 +5,7 @@ import { formatBreadcrumbs } from '@shared/utils/breadcrumbs';
import { contactAge, lastBackendContact } from '@shared/utils/backendContact';
import { clampCrashTail } from '@shared/utils/crashReport';
import { scrubText } from '@shared/utils/scrub';
+import { formatHostSnapshot } from '@shared/utils/hostSnapshot';
import { describeExitCode, isNativeFaultExit } from '@shared/utils/nativeExit';
import {
_adaptLastRunCrash,
@@ -98,7 +99,7 @@ export function ReportBug({ error }: { error?: Error | string }) {
popup.opener = null;
}
const signal = AbortSignal.timeout(2500);
- const [system, engines, previous, nativeStatus, currentLogs] = await Promise.allSettled([
+ const [system, engines, previous, nativeStatus, currentLogs, host] = await Promise.allSettled([
apiJson<Record<string, unknown>>('/system/info', { signal }),
apiJson<{ tts?: { active?: string }; asr?: { active?: string } }>('/engines', { signal }),
apiJson<{ record: LastRunCrashRecord | null; acknowledged: boolean }>(
@@ -109,6 +110,7 @@ export function ReportBug({ error }: { error?: Error | string }) {
error
? apiJson<{ lines?: unknown[] }>('/system/logs?tail=120', { signal })
: Promise.resolve(null),
+ bridge?.backend?.getHostSnapshot?.() ?? Promise.resolve(null),
]);
const backend =
nativeStatus.status === 'fulfilled' && nativeStatus.value
@@ -138,6 +140,12 @@ export function ReportBug({ error }: { error?: Error | string }) {
context.push(key + ': ' + value);
}
}
+ // Read by the app itself, so it survives a backend that never started.
+ context.push(
+ ...formatHostSnapshot(host.status === 'fulfilled' ? host.value : null, {
+ machine: system.status !== 'fulfilled',
+ }).map((line) => scrubText(line)),
+ );
if (engines.status === 'fulfilled' && engines.value.tts?.active)
context.push('TTS: ' + engines.value.tts.active);
if (engines.status === 'fulfilled' && engines.value.asr?.active)