mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Report the last plugin.list failure when plugins never load
This commit is contained in:
1 parent
68f67327fc
commit
3e92efd22e
1 file changed
+5
-2
@@ -51,15 +51,18 @@ export async function waitForOpenCodePluginsLoaded(
|
||||
timeoutMs: number = PLUGIN_LOAD_TIMEOUT_MS,
|
||||
): Promise<void> {
|
||||
const deadline = Date.now() + timeoutMs
|
||||
let lastFailure = 'no plugins reported'
|
||||
while (Date.now() < deadline) {
|
||||
try {
|
||||
const { data } = await client.api.plugin.list()
|
||||
if (data.length > 0) return
|
||||
} catch {
|
||||
lastFailure = 'no plugins reported'
|
||||
} catch (error) {
|
||||
lastFailure = String(error)
|
||||
}
|
||||
await delay(PLUGIN_POLL_INTERVAL_MS)
|
||||
}
|
||||
throw new Error(`OpenCode server plugins did not load within ${timeoutMs}ms`)
|
||||
throw new Error(`OpenCode server plugins did not load within ${timeoutMs}ms: ${lastFailure}`)
|
||||
}
|
||||
|
||||
export function readOpenCodeVersion(binary: string): string | null {
|
||||
|
||||
Reference in new issue
Block a user