feat: vision/image support via stream-json + CLI isolation#14
Open
rjabalosiii wants to merge 1 commit intoatalovesyou:mainfrom
Open
feat: vision/image support via stream-json + CLI isolation#14rjabalosiii wants to merge 1 commit intoatalovesyou:mainfrom
rjabalosiii wants to merge 1 commit intoatalovesyou:mainfrom
Conversation
Adds multimodal (text + image) support for OpenAI-compatible clients like Browser Use that send base64 screenshots via the chat completions endpoint. Changes: - Support OpenAI content arrays with text and image_url parts - Auto-detect images and switch to --input-format stream-json mode (text-only requests still use the fast CLI argument path) - Convert data URI images to Claude CLI base64 format via stdin piping - Strip code fences from model responses (Claude wraps JSON in fences) - Isolate CLI subprocess: --tools "", --disable-slash-commands, --setting-sources "", --system-prompt override, cwd /tmp - Bump body limit to 50mb for base64 image payloads Tested with Browser Use v0.11.9 running vision-enabled browser automation tasks (screenshots piped as base64 PNG). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bwiedmann
added a commit
to bwiedmann/claude-max-api-proxy
that referenced
this pull request
Feb 15, 2026
…am-json + CLI isolation # Conflicts: # src/adapter/cli-to-openai.ts # src/adapter/openai-to-cli.ts # src/server/routes.ts # src/subprocess/manager.ts # src/types/openai.ts
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds multimodal (text + image) support for OpenAI-compatible clients that send base64 screenshots, such as Browser Use. Also fixes several compatibility issues discovered during real-world testing.
What changed
image_urlcontent parts in OpenAI requests and switches to--input-format stream-jsonmode, piping NDJSON with base64 image blocks via stdin. Text-only requests still use the fast CLI argument path (zero overhead when no images).contentfield as bothstringandArray<{type, text?, image_url?}>— required for any client sending screenshots or structured content.\``json...). AddedstripCodeFences()` to extract clean JSON for clients expecting raw JSON (e.g., Browser Use's structured output).--tools "",--disable-slash-commands,--setting-sources "", custom--system-prompt,cwd: /tmp.10mb → 50mbto accommodate base64-encoded screenshots.How it works
Backward compatibility
Test plan
🤖 Generated with Claude Code