Skip to content

Revert: trust user-declared modalities in openai-compatible#84

Merged
Alezander9 merged 1 commit into
mainfrom
alex/revert-83-unsupported-parts
May 19, 2026
Merged

Revert: trust user-declared modalities in openai-compatible#84
Alezander9 merged 1 commit into
mainfrom
alex/revert-83-unsupported-parts

Conversation

@Alezander9
Copy link
Copy Markdown
Member

@Alezander9 Alezander9 commented May 19, 2026

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:

  1. The defensive layer is redundant. Cloud-side fix browser-use/cloud#4461 makes the v4-worker write modalities: { input: ["text", "image"], output: ["text"] } into the worker's opencode.json. provider.ts:1298-1304 already reads that and sets capability.input.image = true, so the original unsupportedParts correctly forwards image parts. Vision was confirmed working end-to-end on v0.1.8 + cloud #4461 (smoketest ea8aec3d-a34f-43f7-b84b-a0dd955ce5e8 — model transcribed example.com H1/body/link verbatim from a captured screenshot, prompt-cache hits visible at cache.read=19071 per turn).
  2. 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 vs v0.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.10 directly, skipping a "real" v0.1.9 since rc1 burned the number) from this main after merge.
  • Cloud #4461 modalities 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.

Written for commit 08cd48c. Summary will update on new commits. Review in cubic

…ust-user-modalities"

This reverts commit 8f9db17, reversing
changes made to 06293d5.
@Alezander9 Alezander9 merged commit 52a1b86 into main May 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants