fix(opencode): detect Copilot PDF input support (#41522)

This commit is contained in:
Steven Ao
2026-08-11 14:04:36 -07:00
committed by GitHub
parent 2b8a5969e9
commit 561afb401a
2 changed files with 72 additions and 1 deletions
@@ -88,6 +88,9 @@ function build(key: string, remote: SelectableItem, url: string, prev?: Model):
const image =
(remote.capabilities.supports.vision ?? false) ||
(remote.capabilities.limits.vision?.supported_media_types ?? []).some((item) => item.startsWith("image/"))
const pdf =
(remote.capabilities.supports.vision ?? false) &&
(remote.capabilities.limits.vision?.supported_media_types?.includes("application/pdf") ?? false)
const isMsgApi = remote.supported_endpoints?.includes("/v1/messages")
const endpoint: CopilotEndpoint | undefined = isMsgApi
@@ -127,7 +130,7 @@ function build(key: string, remote: SelectableItem, url: string, prev?: Model):
audio: false,
image,
video: false,
pdf: false,
pdf,
},
output: {
text: true,