mirror of
https://github.com/7836246/cursor2api.git
synced 2026-04-26 11:35:57 +03:00
[GH-ISSUE #10] Vision mode not triggered when images selected in Claude CLI flow #7
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cursor2api#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @KlementMultiverse on GitHub (Mar 6, 2026).
Original GitHub issue: https://github.com/7836246/cursor2api/issues/10
Problem
When using
claudeCLI with image selection, the vision preprocessing is skipped even thoughvision.enabled: truein config.yaml. Images are passed directly to Cursor API without OCR/vision processing, causing:src/openai-handler.tsdoesn't detect that CLI requests contain imagesRoot Cause
The Anthropic Messages API flow (used by
claudeCLI) sends images in thecontentarray asImageBlockParamobjects. The current vision preprocessing inconverter.tsonly processes OpenAI-style image objects (withurlorbase64fields in specific locations), not Anthropic-style image blocks.src/index.tsroutes/v1/messagesrequests directly to the converter without checking for image content first. The vision check should happen before protocol conversion, but currently happens only inopenai-handler.ts(post-conversion).Expected Behavior
When Claude CLI sends a request with:
The system should:
messages[].content[]vision.modeconfig)Why This Matters
The vision feature (v2.3.0) is only functional for OpenAI clients (ChatBox, LobeChat) but broken for the primary use case: Claude CLI integration with Claude Code. This defeats the purpose of image support in a Claude-focused proxy.
Solution Scope
Add a
preprocessImages()function inconverter.tsthat:ImageBlockParamobjects in Anthropic message formatCall this in the Anthropic message handler before converting to Cursor format.
Contributed by Klement Gunndu
@7836246 commented on GitHub (Mar 6, 2026):
Fixed in v2.3.2
Thanks for reporting this! You're absolutely right — the vision preprocessing was only wired up for OpenAI-style image payloads and completely missed the Anthropic ImageBlockParam format used by Claude CLI / Claude Code.