Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/opencode/src/cli/cmd/tui/context/local.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand Down
Loading