Skip to content

Commit 1c88699

Browse files
rekram1-nodehugojosefson
authored andcommitted
tweak: add abort signal timeout to the github copilot model fetch to prevent infinite blocking (anomalyco#20705)
1 parent 44ea81a commit 1c88699

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • packages/opencode/src/plugin/github-copilot

packages/opencode/src/plugin/github-copilot/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export namespace CopilotModels {
112112
): Promise<Record<string, Model>> {
113113
const data = await fetch(`${baseURL}/models`, {
114114
headers,
115+
signal: AbortSignal.timeout(5_000),
115116
}).then(async (res) => {
116117
if (!res.ok) {
117118
throw new Error(`Failed to fetch models: ${res.status}`)

0 commit comments

Comments
 (0)