File bug directly (#6413)
Co-authored-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2531,6 +2531,26 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/system_info": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"super::routes::status"
|
||||
],
|
||||
"operationId": "system_info",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "System information",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/SystemInfo"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/telemetry/event": {
|
||||
"post": {
|
||||
"tags": [
|
||||
@@ -5711,6 +5731,44 @@
|
||||
"propertyName": "type"
|
||||
}
|
||||
},
|
||||
"SystemInfo": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"app_version",
|
||||
"os",
|
||||
"os_version",
|
||||
"architecture",
|
||||
"enabled_extensions"
|
||||
],
|
||||
"properties": {
|
||||
"app_version": {
|
||||
"type": "string"
|
||||
},
|
||||
"architecture": {
|
||||
"type": "string"
|
||||
},
|
||||
"enabled_extensions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"model": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"os": {
|
||||
"type": "string"
|
||||
},
|
||||
"os_version": {
|
||||
"type": "string"
|
||||
},
|
||||
"provider": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"SystemNotificationContent": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import type { Client, Options as Options2, TDataShape } from './client';
|
||||
import { client } from './client.gen';
|
||||
import type { AddExtensionData, AddExtensionErrors, AddExtensionResponses, AgentAddExtensionData, AgentAddExtensionErrors, AgentAddExtensionResponses, AgentRemoveExtensionData, AgentRemoveExtensionErrors, AgentRemoveExtensionResponses, BackupConfigData, BackupConfigErrors, BackupConfigResponses, CallToolData, CallToolErrors, CallToolResponses, CheckProviderData, ConfirmToolActionData, ConfirmToolActionErrors, ConfirmToolActionResponses, CreateCustomProviderData, CreateCustomProviderErrors, CreateCustomProviderResponses, CreateRecipeData, CreateRecipeErrors, CreateRecipeResponses, CreateScheduleData, CreateScheduleErrors, CreateScheduleResponses, DecodeRecipeData, DecodeRecipeErrors, DecodeRecipeResponses, DeleteRecipeData, DeleteRecipeErrors, DeleteRecipeResponses, DeleteScheduleData, DeleteScheduleErrors, DeleteScheduleResponses, DeleteSessionData, DeleteSessionErrors, DeleteSessionResponses, DetectProviderData, DetectProviderErrors, DetectProviderResponses, DiagnosticsData, DiagnosticsErrors, DiagnosticsResponses, EditMessageData, EditMessageErrors, EditMessageResponses, EncodeRecipeData, EncodeRecipeErrors, EncodeRecipeResponses, ExportSessionData, ExportSessionErrors, ExportSessionResponses, GetCustomProviderData, GetCustomProviderErrors, GetCustomProviderResponses, GetExtensionsData, GetExtensionsErrors, GetExtensionsResponses, GetPricingData, GetPricingResponses, GetProviderModelsData, GetProviderModelsErrors, GetProviderModelsResponses, GetSessionData, GetSessionErrors, GetSessionExtensionsData, GetSessionExtensionsErrors, GetSessionExtensionsResponses, GetSessionInsightsData, GetSessionInsightsErrors, GetSessionInsightsResponses, GetSessionResponses, GetSlashCommandsData, GetSlashCommandsResponses, GetToolsData, GetToolsErrors, GetToolsResponses, GetTunnelStatusData, GetTunnelStatusResponses, ImportSessionData, ImportSessionErrors, ImportSessionResponses, InitConfigData, InitConfigErrors, InitConfigResponses, InspectRunningJobData, InspectRunningJobErrors, InspectRunningJobResponses, KillRunningJobData, KillRunningJobResponses, ListRecipesData, ListRecipesErrors, ListRecipesResponses, ListSchedulesData, ListSchedulesErrors, ListSchedulesResponses, ListSessionsData, ListSessionsErrors, ListSessionsResponses, McpUiProxyData, McpUiProxyErrors, McpUiProxyResponses, ParseRecipeData, ParseRecipeErrors, ParseRecipeResponses, PauseScheduleData, PauseScheduleErrors, PauseScheduleResponses, ProvidersData, ProvidersResponses, ReadAllConfigData, ReadAllConfigResponses, ReadConfigData, ReadConfigErrors, ReadConfigResponses, ReadResourceData, ReadResourceErrors, ReadResourceResponses, RecipeToYamlData, RecipeToYamlErrors, RecipeToYamlResponses, RecoverConfigData, RecoverConfigErrors, RecoverConfigResponses, RemoveConfigData, RemoveConfigErrors, RemoveConfigResponses, RemoveCustomProviderData, RemoveCustomProviderErrors, RemoveCustomProviderResponses, RemoveExtensionData, RemoveExtensionErrors, RemoveExtensionResponses, ReplyData, ReplyErrors, ReplyResponses, RestartAgentData, RestartAgentErrors, RestartAgentResponses, ResumeAgentData, ResumeAgentErrors, ResumeAgentResponses, RunNowHandlerData, RunNowHandlerErrors, RunNowHandlerResponses, SaveRecipeData, SaveRecipeErrors, SaveRecipeResponses, ScanRecipeData, ScanRecipeResponses, ScheduleRecipeData, ScheduleRecipeErrors, ScheduleRecipeResponses, SendTelemetryEventData, SendTelemetryEventResponses, SessionsHandlerData, SessionsHandlerErrors, SessionsHandlerResponses, SetConfigProviderData, SetRecipeSlashCommandData, SetRecipeSlashCommandErrors, SetRecipeSlashCommandResponses, StartAgentData, StartAgentErrors, StartAgentResponses, StartOpenrouterSetupData, StartOpenrouterSetupResponses, StartTetrateSetupData, StartTetrateSetupResponses, StartTunnelData, StartTunnelErrors, StartTunnelResponses, StatusData, StatusResponses, StopTunnelData, StopTunnelErrors, StopTunnelResponses, UnpauseScheduleData, UnpauseScheduleErrors, UnpauseScheduleResponses, UpdateAgentProviderData, UpdateAgentProviderErrors, UpdateAgentProviderResponses, UpdateCustomProviderData, UpdateCustomProviderErrors, UpdateCustomProviderResponses, UpdateFromSessionData, UpdateFromSessionErrors, UpdateFromSessionResponses, UpdateScheduleData, UpdateScheduleErrors, UpdateScheduleResponses, UpdateSessionNameData, UpdateSessionNameErrors, UpdateSessionNameResponses, UpdateSessionUserRecipeValuesData, UpdateSessionUserRecipeValuesErrors, UpdateSessionUserRecipeValuesResponses, UpdateWorkingDirData, UpdateWorkingDirErrors, UpdateWorkingDirResponses, UpsertConfigData, UpsertConfigErrors, UpsertConfigResponses, UpsertPermissionsData, UpsertPermissionsErrors, UpsertPermissionsResponses, ValidateConfigData, ValidateConfigErrors, ValidateConfigResponses } from './types.gen';
|
||||
import type { AddExtensionData, AddExtensionErrors, AddExtensionResponses, AgentAddExtensionData, AgentAddExtensionErrors, AgentAddExtensionResponses, AgentRemoveExtensionData, AgentRemoveExtensionErrors, AgentRemoveExtensionResponses, BackupConfigData, BackupConfigErrors, BackupConfigResponses, CallToolData, CallToolErrors, CallToolResponses, CheckProviderData, ConfirmToolActionData, ConfirmToolActionErrors, ConfirmToolActionResponses, CreateCustomProviderData, CreateCustomProviderErrors, CreateCustomProviderResponses, CreateRecipeData, CreateRecipeErrors, CreateRecipeResponses, CreateScheduleData, CreateScheduleErrors, CreateScheduleResponses, DecodeRecipeData, DecodeRecipeErrors, DecodeRecipeResponses, DeleteRecipeData, DeleteRecipeErrors, DeleteRecipeResponses, DeleteScheduleData, DeleteScheduleErrors, DeleteScheduleResponses, DeleteSessionData, DeleteSessionErrors, DeleteSessionResponses, DetectProviderData, DetectProviderErrors, DetectProviderResponses, DiagnosticsData, DiagnosticsErrors, DiagnosticsResponses, EditMessageData, EditMessageErrors, EditMessageResponses, EncodeRecipeData, EncodeRecipeErrors, EncodeRecipeResponses, ExportSessionData, ExportSessionErrors, ExportSessionResponses, GetCustomProviderData, GetCustomProviderErrors, GetCustomProviderResponses, GetExtensionsData, GetExtensionsErrors, GetExtensionsResponses, GetPricingData, GetPricingResponses, GetProviderModelsData, GetProviderModelsErrors, GetProviderModelsResponses, GetSessionData, GetSessionErrors, GetSessionExtensionsData, GetSessionExtensionsErrors, GetSessionExtensionsResponses, GetSessionInsightsData, GetSessionInsightsErrors, GetSessionInsightsResponses, GetSessionResponses, GetSlashCommandsData, GetSlashCommandsResponses, GetToolsData, GetToolsErrors, GetToolsResponses, GetTunnelStatusData, GetTunnelStatusResponses, ImportSessionData, ImportSessionErrors, ImportSessionResponses, InitConfigData, InitConfigErrors, InitConfigResponses, InspectRunningJobData, InspectRunningJobErrors, InspectRunningJobResponses, KillRunningJobData, KillRunningJobResponses, ListRecipesData, ListRecipesErrors, ListRecipesResponses, ListSchedulesData, ListSchedulesErrors, ListSchedulesResponses, ListSessionsData, ListSessionsErrors, ListSessionsResponses, McpUiProxyData, McpUiProxyErrors, McpUiProxyResponses, ParseRecipeData, ParseRecipeErrors, ParseRecipeResponses, PauseScheduleData, PauseScheduleErrors, PauseScheduleResponses, ProvidersData, ProvidersResponses, ReadAllConfigData, ReadAllConfigResponses, ReadConfigData, ReadConfigErrors, ReadConfigResponses, ReadResourceData, ReadResourceErrors, ReadResourceResponses, RecipeToYamlData, RecipeToYamlErrors, RecipeToYamlResponses, RecoverConfigData, RecoverConfigErrors, RecoverConfigResponses, RemoveConfigData, RemoveConfigErrors, RemoveConfigResponses, RemoveCustomProviderData, RemoveCustomProviderErrors, RemoveCustomProviderResponses, RemoveExtensionData, RemoveExtensionErrors, RemoveExtensionResponses, ReplyData, ReplyErrors, ReplyResponses, RestartAgentData, RestartAgentErrors, RestartAgentResponses, ResumeAgentData, ResumeAgentErrors, ResumeAgentResponses, RunNowHandlerData, RunNowHandlerErrors, RunNowHandlerResponses, SaveRecipeData, SaveRecipeErrors, SaveRecipeResponses, ScanRecipeData, ScanRecipeResponses, ScheduleRecipeData, ScheduleRecipeErrors, ScheduleRecipeResponses, SendTelemetryEventData, SendTelemetryEventResponses, SessionsHandlerData, SessionsHandlerErrors, SessionsHandlerResponses, SetConfigProviderData, SetRecipeSlashCommandData, SetRecipeSlashCommandErrors, SetRecipeSlashCommandResponses, StartAgentData, StartAgentErrors, StartAgentResponses, StartOpenrouterSetupData, StartOpenrouterSetupResponses, StartTetrateSetupData, StartTetrateSetupResponses, StartTunnelData, StartTunnelErrors, StartTunnelResponses, StatusData, StatusResponses, StopTunnelData, StopTunnelErrors, StopTunnelResponses, SystemInfoData, SystemInfoResponses, UnpauseScheduleData, UnpauseScheduleErrors, UnpauseScheduleResponses, UpdateAgentProviderData, UpdateAgentProviderErrors, UpdateAgentProviderResponses, UpdateCustomProviderData, UpdateCustomProviderErrors, UpdateCustomProviderResponses, UpdateFromSessionData, UpdateFromSessionErrors, UpdateFromSessionResponses, UpdateScheduleData, UpdateScheduleErrors, UpdateScheduleResponses, UpdateSessionNameData, UpdateSessionNameErrors, UpdateSessionNameResponses, UpdateSessionUserRecipeValuesData, UpdateSessionUserRecipeValuesErrors, UpdateSessionUserRecipeValuesResponses, UpdateWorkingDirData, UpdateWorkingDirErrors, UpdateWorkingDirResponses, UpsertConfigData, UpsertConfigErrors, UpsertConfigResponses, UpsertPermissionsData, UpsertPermissionsErrors, UpsertPermissionsResponses, ValidateConfigData, ValidateConfigErrors, ValidateConfigResponses } from './types.gen';
|
||||
|
||||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
||||
/**
|
||||
@@ -435,6 +435,8 @@ export const updateSessionUserRecipeValues = <ThrowOnError extends boolean = fal
|
||||
|
||||
export const status = <ThrowOnError extends boolean = false>(options?: Options<StatusData, ThrowOnError>) => (options?.client ?? client).get<StatusResponses, unknown, ThrowOnError>({ url: '/status', ...options });
|
||||
|
||||
export const systemInfo = <ThrowOnError extends boolean = false>(options?: Options<SystemInfoData, ThrowOnError>) => (options?.client ?? client).get<SystemInfoResponses, unknown, ThrowOnError>({ url: '/system_info', ...options });
|
||||
|
||||
export const sendTelemetryEvent = <ThrowOnError extends boolean = false>(options: Options<SendTelemetryEventData, ThrowOnError>) => (options.client ?? client).post<SendTelemetryEventResponses, unknown, ThrowOnError>({
|
||||
url: '/telemetry/event',
|
||||
...options,
|
||||
|
||||
@@ -988,6 +988,16 @@ export type SuccessCheck = {
|
||||
type: 'Shell';
|
||||
};
|
||||
|
||||
export type SystemInfo = {
|
||||
app_version: string;
|
||||
architecture: string;
|
||||
enabled_extensions: Array<string>;
|
||||
model?: string | null;
|
||||
os: string;
|
||||
os_version: string;
|
||||
provider?: string | null;
|
||||
};
|
||||
|
||||
export type SystemNotificationContent = {
|
||||
msg: string;
|
||||
notificationType: SystemNotificationType;
|
||||
@@ -3137,6 +3147,22 @@ export type StatusResponses = {
|
||||
|
||||
export type StatusResponse = StatusResponses[keyof StatusResponses];
|
||||
|
||||
export type SystemInfoData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/system_info';
|
||||
};
|
||||
|
||||
export type SystemInfoResponses = {
|
||||
/**
|
||||
* System information
|
||||
*/
|
||||
200: SystemInfo;
|
||||
};
|
||||
|
||||
export type SystemInfoResponse = SystemInfoResponses[keyof SystemInfoResponses];
|
||||
|
||||
export type SendTelemetryEventData = {
|
||||
body: TelemetryEventRequest;
|
||||
path?: never;
|
||||
|
||||
@@ -26,7 +26,7 @@ import { DroppedFile, useFileDrop } from '../hooks/useFileDrop';
|
||||
import { Recipe } from '../recipe';
|
||||
import MessageQueue from './MessageQueue';
|
||||
import { detectInterruption } from '../utils/interruptionDetector';
|
||||
import { DiagnosticsModal } from './ui/DownloadDiagnostics';
|
||||
import { DiagnosticsModal } from './ui/Diagnostics';
|
||||
import { getSession, Message } from '../api';
|
||||
import CreateRecipeFromSessionModal from './recipes/CreateRecipeFromSessionModal';
|
||||
import CreateEditRecipeModal from './recipes/CreateEditRecipeModal';
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
import React, { useState } from 'react';
|
||||
import { AlertTriangle, Download, Github } from 'lucide-react';
|
||||
import { Button } from './button';
|
||||
import { toastError } from '../../toasts';
|
||||
import { diagnostics, systemInfo } from '../../api';
|
||||
|
||||
interface DiagnosticsModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export const DiagnosticsModal: React.FC<DiagnosticsModalProps> = ({
|
||||
isOpen,
|
||||
onClose,
|
||||
sessionId,
|
||||
}) => {
|
||||
const [isDownloading, setIsDownloading] = useState(false);
|
||||
const [isFilingBug, setIsFilingBug] = useState(false);
|
||||
|
||||
const handleDownload = async () => {
|
||||
setIsDownloading(true);
|
||||
|
||||
try {
|
||||
const response = await diagnostics({
|
||||
path: { session_id: sessionId },
|
||||
throwOnError: true,
|
||||
});
|
||||
|
||||
const blob = new Blob([response.data], { type: 'application/zip' });
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `diagnostics_${sessionId}.zip`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(url);
|
||||
|
||||
onClose();
|
||||
} catch {
|
||||
toastError({
|
||||
title: 'Diagnostics Error',
|
||||
msg: 'Failed to download diagnostics',
|
||||
});
|
||||
} finally {
|
||||
setIsDownloading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleFileGitHubIssue = async () => {
|
||||
setIsFilingBug(true);
|
||||
|
||||
try {
|
||||
const response = await systemInfo({ throwOnError: true });
|
||||
const info = response.data;
|
||||
|
||||
const providerModel =
|
||||
info.provider && info.model
|
||||
? `${info.provider} – ${info.model}`
|
||||
: info.provider || info.model || '[e.g. Google – gemini-1.5-pro]';
|
||||
|
||||
const extensions =
|
||||
info.enabled_extensions.length > 0
|
||||
? info.enabled_extensions.join(', ')
|
||||
: '[e.g. Computer Controller, Figma]';
|
||||
|
||||
const body = `**Describe the bug**
|
||||
|
||||
💡 Before filing, please check common issues:
|
||||
https://block.github.io/goose/docs/troubleshooting
|
||||
|
||||
📦 To help us debug faster, attach your **diagnostics zip** if possible.
|
||||
👉 How to capture it: https://block.github.io/goose/docs/troubleshooting/diagnostics-and-reporting/
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
---
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
---
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
---
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
---
|
||||
|
||||
**Please provide the following information**
|
||||
- **OS & Arch:** ${info.os} ${info.os_version} ${info.architecture}
|
||||
- **Interface:** UI
|
||||
- **Version:** ${info.app_version}
|
||||
- **Extensions enabled:** ${extensions}
|
||||
- **Provider & Model:** ${providerModel}
|
||||
|
||||
---
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
`;
|
||||
|
||||
const params = new URLSearchParams({
|
||||
template: 'bug_report.md',
|
||||
body: body,
|
||||
labels: 'bug',
|
||||
});
|
||||
|
||||
window.open(`https://github.com/block/goose/issues/new?${params.toString()}`, '_blank');
|
||||
onClose();
|
||||
} catch {
|
||||
toastError({
|
||||
title: 'Error',
|
||||
msg: 'Failed to get system information',
|
||||
});
|
||||
} finally {
|
||||
setIsFilingBug(false);
|
||||
}
|
||||
};
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
||||
<div className="bg-background-default border border-borderStandard rounded-lg p-6 max-w-md mx-4">
|
||||
<div className="flex items-start gap-3 mb-4">
|
||||
<AlertTriangle className="text-orange-500 flex-shrink-0 mt-1" size={20} />
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold text-textStandard mb-2">Report a Problem</h3>
|
||||
<p className="text-sm text-textSubtle mb-3">
|
||||
You can download a diagnostics zip file to share with the team, or file a bug directly
|
||||
on GitHub with your system details pre-filled. A diagnostics report contains the
|
||||
following:
|
||||
</p>
|
||||
<ul className="text-sm text-textSubtle list-disc list-inside space-y-1 mb-3">
|
||||
<li>Basic system info</li>
|
||||
<li>Your current session messages</li>
|
||||
<li>Recent log files</li>
|
||||
<li>Configuration settings</li>
|
||||
</ul>
|
||||
<p className="text-sm text-textSubtle">
|
||||
<strong>Warning:</strong> If your session contains sensitive information, do not share
|
||||
the diagnostics file publicly.
|
||||
</p>
|
||||
<p className="text-sm text-textSubtle">
|
||||
If you file a bug, consider attaching the diagnostics report to it.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2 justify-end">
|
||||
<Button
|
||||
onClick={onClose}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={isDownloading || isFilingBug}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleDownload}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={isDownloading || isFilingBug}
|
||||
>
|
||||
<Download size={16} className="mr-1" />
|
||||
{isDownloading ? 'Downloading...' : 'Download'}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleFileGitHubIssue}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={isDownloading || isFilingBug}
|
||||
className="bg-slate-600 text-white hover:bg-slate-700"
|
||||
>
|
||||
<Github size={16} className="mr-1" />
|
||||
{isFilingBug ? 'Opening...' : 'File Bug on GitHub'}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,93 +0,0 @@
|
||||
import React, { useState } from 'react';
|
||||
import { AlertTriangle } from 'lucide-react';
|
||||
import { Button } from './button';
|
||||
import { toastError } from '../../toasts';
|
||||
import { diagnostics } from '../../api';
|
||||
|
||||
interface DiagnosticsModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export const DiagnosticsModal: React.FC<DiagnosticsModalProps> = ({
|
||||
isOpen,
|
||||
onClose,
|
||||
sessionId,
|
||||
}) => {
|
||||
const [isDownloading, setIsDownloading] = useState(false);
|
||||
|
||||
const handleDownload = async () => {
|
||||
setIsDownloading(true);
|
||||
|
||||
try {
|
||||
const response = await diagnostics({
|
||||
path: { session_id: sessionId },
|
||||
throwOnError: true,
|
||||
});
|
||||
|
||||
const blob = new Blob([response.data], { type: 'application/zip' });
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `diagnostics_${sessionId}.zip`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(url);
|
||||
|
||||
onClose();
|
||||
} catch {
|
||||
toastError({
|
||||
title: 'Diagnostics Error',
|
||||
msg: 'Failed to download diagnostics',
|
||||
});
|
||||
} finally {
|
||||
setIsDownloading(false);
|
||||
}
|
||||
};
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
||||
<div className="bg-background-default border border-borderStandard rounded-lg p-6 max-w-md mx-4">
|
||||
<div className="flex items-start gap-3 mb-4">
|
||||
<AlertTriangle className="text-orange-500 flex-shrink-0 mt-1" size={20} />
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold text-textStandard mb-2">Download Diagnostics</h3>
|
||||
<p className="text-sm text-textSubtle mb-3">
|
||||
Hit the download button to get a zip file containing all the important information to
|
||||
diagnose a problem in goose. You can share this file with the team or if you are a
|
||||
developer look at it yourself.
|
||||
</p>
|
||||
<ul className="text-sm text-textSubtle list-disc list-inside space-y-1 mb-3">
|
||||
<li>Basic system info</li>
|
||||
<li>Your current session messages</li>
|
||||
<li>Recent log files</li>
|
||||
<li>Configuration settings</li>
|
||||
</ul>
|
||||
<p className="text-sm text-textSubtle">
|
||||
<strong>Warning:</strong> If your session contains sensitive information, do not share
|
||||
this file publicly.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2 justify-end">
|
||||
<Button onClick={onClose} variant="outline" size="sm" disabled={isDownloading}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleDownload}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={isDownloading}
|
||||
className="bg-slate-600 text-white hover:bg-slate-700"
|
||||
>
|
||||
{isDownloading ? 'Downloading...' : 'Download'}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user