vibeproxy icon indicating copy to clipboard operation
vibeproxy copied to clipboard

Cursor agent mode: Anthropic tool blocks rejected on OpenAI endpoint (upstream fix available)

Open HatriGt opened this issue 5 months ago • 1 comments

Summary

When using Cursor in agent / tool mode pointed at VibeProxy's OpenAI-compatible endpoint with a Claude (OAuth) model, tool calling fails. Normal chat works, but any tool use breaks with errors like:

messages.N: user messages must have non-empty content

or silently fails.

Root cause

Cursor sends Anthropic-native content blocks to the OpenAI /v1/chat/completions endpoint:

  • user.content with { "type": "tool_result", "tool_use_id": ..., "content": ... }
  • assistant.content with { "type": "tool_use", "id": ..., "name": ..., "input": {...} }
  • bare tool definitions { "name", "description", "input_schema" }

The OpenAI -> Claude translator expects standard OpenAI shapes (tool_calls, role:"tool", tools[].type=="function"), so these payloads are dropped. This is also tracked upstream in router-for-me/CLIProxyAPI#1165 and the Cursor forum report "Wrong tools handling on OpenAI compatible endpoint".

Today the only workaround is running an external request-rewriting proxy/shim in front of the proxy.

Upstream fix

I opened a PR against the core proxy that normalizes these Anthropic-native blocks into standard OpenAI shapes before translation (standard OpenAI payloads pass through untouched):

  • router-for-me/CLIProxyAPI#3804

Once that lands in a release, bundling the updated cli-proxy-api binary in VibeProxy would let Cursor agent mode work out of the box with no shim.

Minor: stale reference

The README links to https://github.com/router-for-me/CLIProxyAPIPlus, which now 404s (it appears to have been consolidated into router-for-me/CLIProxyAPI). Worth updating the README and the bundled binary source accordingly.

Environment

  • VibeProxy (latest), macOS
  • Client: Cursor (agent mode)
  • Model: Claude via OAuth

HatriGt avatar Jun 11 '26 10:06 HatriGt

Since this was filed, every release now bundles the latest upstream CLIProxyAPI (currently 7.3.18), so upstream-side fixes have been flowing in automatically with each build. Could you retest against the latest release and update this issue with the result? If there's no update within 30 days I'll close it as stale — it can always be reopened.

ranaroussi avatar Sep 26 '26 09:09 ranaroussi