Revert: trust user-declared modalities in openai-compatible#84
Merged
Conversation
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.
Reverts #83 (merge
8f9db1737). RestoresunsupportedPartsto its pre-#83 behavior.Why revert
#83 added an early-return for
@ai-sdk/openai-compatibleproviders inunsupportedParts, intended as a defense against the gateway dropping screenshots when models.dev had no entry to seed image capability. After cuttingv0.1.9-rc1from this branch we discovered: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
mainto a state that builds into a working binary identical in behavior tov0.1.8.Diff
packages/opencode/src/provider/transform.ts: removed the early-return guard for@ai-sdk/openai-compatible(15 lines).Tests
bun typecheckfrompackages/opencode/produces no new errors intransform.ts(existing unrelated drizzle SQL type errors pre-date this change).Follow-up
v0.1.10directly, skipping a "real"v0.1.9since rc1 burned the number) from thismainafter merge.#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-compatibleearly-return inunsupportedParts, restoring the original pre-#83 behavior. This returns to v0.1.8 behavior where image parts are forwarded based on cloud-declaredmodalitiesand avoids the startup hangs seen in v0.1.9-rc1.Written for commit 08cd48c. Summary will update on new commits. Review in cubic