Have you checked that your issue isn't already filed?
Bug description
When creating a new chat in Direct mode (/c/new?mode=direct), the frontend sends mode: "direct-battle" instead of mode: "direct" in the POST request body to /nextjs-api/stream/create-evaluation. The first message succeeds because create-evaluation accepts this hybrid mode value. However, when sending a second message via POST /nextjs-api/stream/post-to-evaluation/[sessionId], the backend sees that the session was created with a "battle" mode and expects a BATTLE turn (vote/evaluation), not a regular chat message. This results in a 400 error: Bad next turn request in Battles in Direct mode. DIRECT was requested, but expected a BATTLE turn Once this error occurs, the session is permanently broken — no further messages can be sent to that chat. The user loses the entire conversation history. Root cause: The frontend sends mode: "direct-battle" instead of mode: "direct" in the request body when creating a new evaluation session. The backend state machine then categorizes the session as a battle, creating an unrecoverable conflict on subsequent turns. Impact: - Users lose conversations permanently (session becomes unrecoverable) - Each failed retry consumes a reCAPTCHA v3 token, which can trigger verification challenges - The bug is intermittent, making it difficult for users to identify the cause
How to reproduce the bug
- Go to
https://arena.ai/ru/c/new?mode=direct (or any locale with ?mode=direct)
- Select any single model (e.g.,
gemini-3-pro)
- Send a first message — it succeeds via
POST /nextjs-api/stream/create-evaluation
- Open DevTools (F12) → Network tab
- Send a second message in the same chat
- Observe the request to
POST /nextjs-api/stream/post-to-evaluation/[session-id]
- Response:
400 Bad Request
Key observation from the first request body (create-evaluation):
{
"id": "019ccf8a-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"modality": "chat",
"mode": "direct-battle", // ← BUG: should be "direct"
"modelAId": "019c7820-5480-78b6-9fef-04c0d7004054"
}
The mode field is set to "direct-battle" even though the user explicitly selected Direct mode. This causes the backend to register the session as a battle, which then rejects non-battle turns.
### Error messages and logs
HTTP/3 400
Response body:
{
"error": "Bad next turn request in Battles in Direct mode. DIRECT was requested, but expected a BATTLE turn | sessionId: 019cccf7-fefb-7c81-9ea1-fb0704305634 | userMessageId: 019ccf6a-59a1-7590-bcbd-5fffb2db29b2"
}
Request URL: POST https://arena.ai/nextjs-api/stream/post-to-evaluation/019cccf7-fefb-7c81-9ea1-fb0704305634
x-matched-path: /nextjs-api/stream/post-to-evaluation/[id]
**Workaround (client-side Tampermonkey patch):**
Intercepting `fetch()` and replacing `mode: "direct-battle"` with `mode: "direct"` in the request body before it reaches the server resolves the issue completely. This confirms the bug is in the frontend request construction, not in backend logic.
```js
// Minimal reproduction of the fix:
if (json.mode === 'direct-battle') {
json.mode = 'direct';
}
What operating system are you using?
Windows
Where are you seeing the problem on?
Deployed site
More info
- Browser: Firefox 146.0 (also reproducible in Chromium-based browsers)
- Deployment ID from response headers:
fra1:fra1:fra1::sfo1::fra1::gfrzl-1773008262672-d453e034e30e
- Frontend framework: Next.js (confirmed via
x-matched-path and x-vercel-cache headers)
- Suggested fix: In the frontend code that constructs the request body for
create-evaluation, ensure that when the user selects Direct mode, the mode field is set to "direct" - not "direct-battle". The "direct-battle" value appears to be a hybrid/legacy mode that conflicts with the backend state machine for subsequent turns.
- Severity: High - causes permanent data loss (unrecoverable chat sessions) with no user-facing error explanation.
Have you checked that your issue isn't already filed?
Bug description
When creating a new chat in Direct mode (
/c/new?mode=direct), the frontend sendsmode: "direct-battle"instead ofmode: "direct"in the POST request body to/nextjs-api/stream/create-evaluation. The first message succeeds becausecreate-evaluationaccepts this hybrid mode value. However, when sending a second message viaPOST /nextjs-api/stream/post-to-evaluation/[sessionId], the backend sees that the session was created with a "battle" mode and expects a BATTLE turn (vote/evaluation), not a regular chat message. This results in a400error: Bad next turn request in Battles in Direct mode. DIRECT was requested, but expected a BATTLE turn Once this error occurs, the session is permanently broken — no further messages can be sent to that chat. The user loses the entire conversation history. Root cause: The frontend sendsmode: "direct-battle"instead ofmode: "direct"in the request body when creating a new evaluation session. The backend state machine then categorizes the session as a battle, creating an unrecoverable conflict on subsequent turns. Impact: - Users lose conversations permanently (session becomes unrecoverable) - Each failed retry consumes a reCAPTCHA v3 token, which can trigger verification challenges - The bug is intermittent, making it difficult for users to identify the causeHow to reproduce the bug
https://arena.ai/ru/c/new?mode=direct(or any locale with?mode=direct)gemini-3-pro)POST /nextjs-api/stream/create-evaluationPOST /nextjs-api/stream/post-to-evaluation/[session-id]400 Bad RequestKey observation from the first request body (create-evaluation):
{ "id": "019ccf8a-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "modality": "chat", "mode": "direct-battle", // ← BUG: should be "direct" "modelAId": "019c7820-5480-78b6-9fef-04c0d7004054" } The mode field is set to "direct-battle" even though the user explicitly selected Direct mode. This causes the backend to register the session as a battle, which then rejects non-battle turns. ### Error messages and logsHTTP/3 400
Response body:
{
"error": "Bad next turn request in Battles in Direct mode. DIRECT was requested, but expected a BATTLE turn | sessionId: 019cccf7-fefb-7c81-9ea1-fb0704305634 | userMessageId: 019ccf6a-59a1-7590-bcbd-5fffb2db29b2"
}
Request URL: POST https://arena.ai/nextjs-api/stream/post-to-evaluation/019cccf7-fefb-7c81-9ea1-fb0704305634
x-matched-path: /nextjs-api/stream/post-to-evaluation/[id]
What operating system are you using?
Windows
Where are you seeing the problem on?
Deployed site
More info
fra1:fra1:fra1::sfo1::fra1::gfrzl-1773008262672-d453e034e30ex-matched-pathandx-vercel-cacheheaders)create-evaluation, ensure that when the user selects Direct mode, themodefield is set to"direct"- not"direct-battle". The"direct-battle"value appears to be a hybrid/legacy mode that conflicts with the backend state machine for subsequent turns.