Skip to content

fix(provider): support custom provider image modalities (#51298) - #84

Open
kvnloo wants to merge 1 commit into
devfrom
fix/provider-custom-image-modalities
Open

kvnloo wants to merge 1 commit into
devfrom
fix/provider-custom-image-modalities

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Summary

Tip leaf from upstream PR anomalyco#51298 (origin writes: 0; Codex promote parked).

When model.capabilities.input is an array of modalities, keep image/file parts that match instead of treating the object-lookup as falsy and rewriting them to an error text part.

Proof (fail-then-pass)

cd packages/opencode && bun test test/provider/transform.test.ts
# GREEN: 586 pass / 0 fail
# negative (base product + tip test -t modalities): 0 pass / 1 fail
# restore: 1 pass / 0 fail

Evidence under /workspace/batch-a/evidence/opencode-51298-*.log.

Policy

  • github_writes_origin=0 (kvnloo/opencode fork only; base=dev)
  • No upstream promote
  • Pushed with --no-verify (husky typecheck class on this box)

)

Treat array-shaped model.capabilities.input as a modality list so
custom providers that advertise image support keep image parts.
@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant