Skip to content

fix(arena): keep PDF requests away from providers that take no files - #325

Open
vikas-bottomless wants to merge 2 commits into
mainfrom
fix/pdf-file-input-routing
Open

vikas-bottomless wants to merge 2 commits into
mainfrom
fix/pdf-file-input-routing

Conversation

@vikas-bottomless

Copy link
Copy Markdown
Contributor

What and why

A contestant that reads a PDF can fail with 404 No endpoints found that support file input: its encrypted reasoning pins the call to a provider that takes no files (GPT-6.1 Sol on Amazon Bedrock). Requests with a file now drop that encrypted reasoning on the way out, so OpenRouter can pick a provider that takes it. If a PDF is still refused with that 404, the proxy retries once with OCR. Takes effect once the control plane pins this arena-service.

Testing

  • [automated] bun test src/file-input-routing.test.ts src/openrouter.test.ts src/generation-capture.test.ts (arena-service, Bun 1.4.4): 115 passed, 1 skipped; 5 of the new tests fail with main's openrouter.ts
  • [automated] bun test src (arena-service): 252 passed, 1 skipped, 2 failed; the same 2 fail on main because they need OPENCODE_ARENA_MONGODB_URI
  • [automated] npm run typecheck, npm run lint, npm run format:check and arena-service's tsgo --noEmit: pass
  • [AI] Claude Code drove the macOS dev app against a local control plane. GPT-6.1 Sol vs GPT-6.2 Sol, order: ["amazon-bedrock"] set for the test, prompt: think, then read a PDF, then use tools. On main, both sides failed with the 404 above, pinned to Bedrock's endpoint (7 calls also failed earlier with a 502, cause unknown). With this PR, both finished with the right answer and no refusals; after the PDF their calls moved to Azure and OpenAI
  • [AI] Same setup, Gemini Carbon vs Gemini 4 Neon, one on Google AI Studio and one on Vertex: 13 of 13 calls succeeded, 7 with the PDF and no encrypted reasoning. A follow-up battle in that chat (Carbon vs Argon, both on Google AI Studio): right answers, no refusals
  • Not tested: the OCR retry in a real battle (tests only); the production control plane; Windows and Linux; whether dropping reasoning changes answer quality or cost. A PDF stays in the chat's history, so later calls in that chat drop encrypted reasoning too (seen in the follow-up battle)

Checklist

  • "What and why" is at most 500 characters
  • npm run typecheck, npm run lint and npm run format pass
  • Screenshots or video attached for UI changes
  • I agree to the contribution licensing policy and have authority to license my contribution.

@vikas-bottomless
vikas-bottomless requested a review from a team as a code owner December 3, 2026 12:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant