tweak: add abort signal timeout to the github copilot model fetch to prevent infinite blocking (#20705)

pull/20242/merge
Aiden Cline 2026-04-02 10:53:08 -05:00 committed by GitHub
parent c3dfd08ba8
commit 10ca1ace6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -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}`)