Skip to content

Commit eb975bb

Browse files
shuv1337actions-userrekram1-node
authored
Image tag fix for real this time (anomalyco#4540)
Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
1 parent 9479fe3 commit eb975bb

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ export function Autocomplete(props: {
124124
(item): AutocompleteOption => ({
125125
display: Locale.truncateMiddle(item, width),
126126
onSelect: () => {
127+
const mime = Bun.file(item).type || "text/plain"
127128
insertPart(item, {
128129
type: "file",
129-
mime: "text/plain",
130+
mime,
130131
filename: item,
131132
url: `file://${process.cwd()}/${item}`,
132133
source: {

packages/opencode/src/session/message-v2.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,11 @@ export namespace MessageV2 {
638638
state: "output-available",
639639
toolCallId: part.callID,
640640
input: part.state.input,
641-
output: part.state.time.compacted ? "[Old tool result content cleared]" : part.state.output,
641+
output: part.state.attachments?.length
642+
? "[Image content moved to user message]"
643+
: part.state.time.compacted
644+
? "[Old tool result content cleared]"
645+
: part.state.output,
642646
callProviderMetadata: part.metadata,
643647
})
644648
}

0 commit comments

Comments
 (0)