fix: practice fights send challenges to polling/webhook bots instead of forcing human mode
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
8076d860c7
commit
18e4b05399
@@ -300,9 +300,7 @@ fightsRouter.post('/practice/:botId', botRateLimit(10_000), async (c) => {
|
|||||||
|
|
||||||
let fightId: string
|
let fightId: string
|
||||||
try {
|
try {
|
||||||
// Polling bots play practice as human players (answer in browser)
|
fightId = await runFightAsync(botId, opponent.id, 'free')
|
||||||
const overrides = isPollingBot(bot.webhookUrl) ? { botAWebhookUrl: 'http://human.local/' } : undefined
|
|
||||||
fightId = await runFightAsync(botId, opponent.id, 'free', overrides)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const msg = sanitizeError(err, 'Fight failed to start')
|
const msg = sanitizeError(err, 'Fight failed to start')
|
||||||
return c.json({ error: msg }, 400)
|
return c.json({ error: msg }, 400)
|
||||||
|
|||||||
Reference in New Issue
Block a user