feat(opencode): surface server startup and recovery failures in-app

This commit is contained in:
Chris Scott committed 2026-10-01 16:13:11 -04:00
1 parent 53a70d8545
commit 7e9afc3da4
19 files changed
+454 -181

No files matched your search

+3 -2
View File
@@ -6,6 +6,7 @@ export { FetchError }
interface FetchWrapperOptions extends RequestInit {
timeout?: number
params?: Record<string, string | number | boolean | undefined>
acceptedStatuses?: number[]
}
function formatDetails(details: unknown): string | undefined {
@@ -71,7 +72,7 @@ async function fetchWithTimeout(
url: string,
options: FetchWrapperOptions = {}
): Promise<Response> {
const { timeout = 30000, params, ...fetchOptions } = options
const { timeout = 30000, params, acceptedStatuses, ...fetchOptions } = options
const urlObj = buildUrl(url, params)
const controller = new AbortController()
@@ -86,7 +87,7 @@ async function fetchWithTimeout(
if (timeoutId) clearTimeout(timeoutId)
if (!response.ok) {
if (!response.ok && !acceptedStatuses?.includes(response.status)) {
await handleResponse(response)
}