#4534: fix: packaging and OpenAI vision format conversion
gateway
Cluster:
OpenClaw Plugin Enhancements
This PR addresses two issues:
1. **Fix missing bin field in package.json**: Resolves the Windows installer ENOENT error by correctly specifying the bin path without the leading `./` which can cause issues on some environments/installers.
2. **Add image format conversion in OpenAI-compatible API**: Extracts `media_type` from data URIs in OpenAI vision format and converts them to the format expected by the internal agent command, enabling vision model support via the OpenAI-compatible endpoint.
Fixes #3787 and #3781.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates packaging metadata and the OpenAI-compatible HTTP gateway.
- **Packaging:** fixes the `bin` entries in `package.json` to point at `moltbot.mjs` without a leading `./`, addressing Windows installer `ENOENT` scenarios where the relative prefix is misinterpreted.
- **OpenAI gateway:** extends `src/gateway/openai-http.ts` to recognize OpenAI “vision” message parts (`content` arrays with `type: "image_url"`) by extracting `data:`-URI images (mimeType + base64 payload) and passing them through as `images?: ImageContent[]` into `agentCommand()` for both streaming and non-streaming requests.
Overall, the change fits the codebase’s pattern of translating gateway payloads into the internal `agentCommand` input shape, but the new message filtering/parsing introduces a couple of behavior edge cases that can lead to empty prompts or silently dropped images.
<h3>Confidence Score: 3/5</h3>
- This PR is reasonably safe to merge, but the OpenAI gateway change likely introduces an input-validation regression that can produce empty prompts or degraded history.
- The packaging change is low risk. The gateway change is small and localized, but the new role/content guard at src/gateway/openai-http.ts:107 appears incorrect versus the prior intent and can allow empty text messages into history / block image-only requests from working as intended. The remaining issues are compatibility/robustness gaps rather than outright crashes.
- src/gateway/openai-http.ts
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#10745: feat: Security improvements and Windows compatibility fixes
by lluviaoscuradeldoce-design · 2026-02-06
77.9%
#11048: fix: address repository issues (env, author, CI comments, security ...
by cavula · 2026-02-07
77.8%
#4300: Gateway: prevent OpenAI-compatible client crash on SSE termination
by perryraskin · 2026-01-30
76.9%
#11782: fix: resolve 403 auth error for GithubCopilot imageModel (#10277)
by adamkoncz · 2026-02-08
76.7%
#3973: fix: enhance npm package integrity checks and include critical files
by YeSuX · 2026-01-29
75.7%
#16777: feat(gateway): add multimodal image support to /v1/chat/completions
by dzianisv · 2026-02-15
75.6%
#15197: fix: allow OpenAI auth profiles for OpenAI-compatible providers
by bufordtjustice2918 · 2026-02-13
75.3%
#6638: fix: make Dockerfile work on container platforms (Render, Railway, ...
by kaizen403 · 2026-02-01
75.1%
#21745: tools: fix image inbound resolution and empty allowBundled
by AIflow-Labs · 2026-02-20
75.0%
#16018: feat: add image support to /v1/chat/completions endpoint
by sebastienb · 2026-02-14
74.9%