Revert: trust user-declared modalities in openai-compatible
Reverts #83 (merge 8f9db1737). Restores unsupportedParts to its pre-#83 behavior.
Why revert
#83 added an early-return for @ai-sdk/openai-compatible providers in unsupportedParts, intended as a defense against the gateway dropping screenshots when models.dev had no entry to seed image capability. After cutting v0.1.9-rc1 from this branch we discovered:
- The defensive layer is redundant. Cloud-side fix
browser-use/cloud#4461makes the v4-worker writemodalities: { input: ["text", "image"], output: ["text"] }into the worker'sopencode.json.provider.ts:1298-1304already reads that and setscapability.input.image = true, so the originalunsupportedPartscorrectly forwards image parts. Vision was confirmed working end-to-end onv0.1.8+ cloud#4461(smoketestea8aec3d-a34f-43f7-b84b-a0dd955ce5e8— model transcribedexample.comH1/body/link verbatim from a captured screenshot, prompt-cache hits visible atcache.read=19071per turn). v0.1.9-rc1(this branch's content) hangs at startup. Multiple AgentCore runs with rc1 either issued zero LLM calls or fired only the title-generation request and then went unresponsive. Root cause not pinned to source diff vsv0.1.8(the only code-path change was the 15-line addition reverted here), but the released binary is non-functional and rolling forward to ship it served no purpose given (1).
Reverting to keep the codebase free of untested, unnecessary capability-handling code paths and to restore main to a state that builds into a working binary identical in behavior to v0.1.8.
Diff
packages/opencode/src/provider/transform.ts: removed the early-return guard for@ai-sdk/openai-compatible(15 lines).
Tests
bun typecheck from packages/opencode/ produces no new errors in transform.ts (existing unrelated drizzle SQL type errors pre-date this change).
Follow-up
- Re-cut release tag (likely
v0.1.10directly, skipping a "real"v0.1.9since rc1 burned the number) from thismainafter merge. - Cloud
#4461modalities declaration remains the single source of truth for image support over the v4 gateway.
Summary by cubic
Reverts #83 by removing the @ai-sdk/openai-compatible early-return in unsupportedParts, restoring the original pre-#83 behavior. This returns to v0.1.8 behavior where image parts are forwarded based on cloud-declared modalities and avoids the startup hangs seen in v0.1.9-rc1.