diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index 145fa9da0c3..3da1f7ef13b 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -645,6 +645,14 @@ export function Prompt(props: PromptProps) { } async function pasteImage(file: { filename?: string; content: string; mime: string }) { + if (!local.model.parsed().input?.image) { + toast.show({ + variant: "warning", + message: `${local.model.parsed().model} doesn't support image as input`, + duration: 3000, + }) + return + } const currentOffset = input.visualCursor.offset const extmarkStart = currentOffset const count = store.prompt.parts.filter((x) => x.type === "file").length diff --git a/packages/opencode/src/cli/cmd/tui/context/local.tsx b/packages/opencode/src/cli/cmd/tui/context/local.tsx index 63f1d9743bf..b002165ce92 100644 --- a/packages/opencode/src/cli/cmd/tui/context/local.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/local.tsx @@ -206,6 +206,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ provider: "Connect a provider", model: "No provider selected", reasoning: false, + input: undefined, } } const provider = sync.data.provider.find((x) => x.id === value.providerID) @@ -214,6 +215,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ provider: provider?.name ?? value.providerID, model: info?.name ?? value.modelID, reasoning: info?.capabilities?.reasoning ?? false, + input: info?.capabilities?.input, } }), cycle(direction: 1 | -1) {