Merge pull request #86 from IronRookieCoder/fix-snip-tool

fix(builtin-tools): handle undefined message_ids in SnipTool.call()
This commit is contained in:
linkai0924 2026-05-15 17:01:26 +08:00 committed by GitHub
commit 0b271a7847
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View File

@ -114,7 +114,6 @@ export async function pollLoginToken(
throw new Error('Login cancelled')
}
if (error.message?.includes('Login failed')) throw error
continue
}
}

View File

@ -105,7 +105,7 @@ async function postJson(
let lastError: Error | undefined
for (let attempt = 0; attempt < 3; attempt++) {
if (attempt > 0) {
const delay = 5000 * Math.pow(2, attempt - 1) // 5s, 10s
const delay = 5000 * 2 ** (attempt - 1) // 5s, 10s
log.debug(`retrying ${endpoint} after ${delay}ms`, { attempt })
await new Promise((r) => setTimeout(r, delay))
}