mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-23 22:34:53 +00:00
tweak: add abort signal timeout to the github copilot model fetch to prevent infinite blocking (#20705)
This commit is contained in:
@@ -112,6 +112,7 @@ export namespace CopilotModels {
|
||||
): Promise<Record<string, Model>> {
|
||||
const data = await fetch(`${baseURL}/models`, {
|
||||
headers,
|
||||
signal: AbortSignal.timeout(5_000),
|
||||
}).then(async (res) => {
|
||||
if (!res.ok) {
|
||||
throw new Error(`Failed to fetch models: ${res.status}`)
|
||||
|
||||
Reference in New Issue
Block a user