Browse Source

Revert "Image tag fix for real this time (#4540)"

This reverts commit eb975bb89c61ef26adced3478d5ad3e67ad65283.
Aiden Cline 3 months ago
parent
commit
ec5c96e10d

+ 1 - 2
packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx

@@ -124,10 +124,9 @@ export function Autocomplete(props: {
             (item): AutocompleteOption => ({
               display: Locale.truncateMiddle(item, width),
               onSelect: () => {
-                const mime = Bun.file(item).type || "text/plain"
                 insertPart(item, {
                   type: "file",
-                  mime,
+                  mime: "text/plain",
                   filename: item,
                   url: `file://${process.cwd()}/${item}`,
                   source: {

+ 1 - 5
packages/opencode/src/session/message-v2.ts

@@ -638,11 +638,7 @@ export namespace MessageV2 {
                 state: "output-available",
                 toolCallId: part.callID,
                 input: part.state.input,
-                output: part.state.attachments?.length
-                  ? "[Image content moved to user message]"
-                  : part.state.time.compacted
-                    ? "[Old tool result content cleared]"
-                    : part.state.output,
+                output: part.state.time.compacted ? "[Old tool result content cleared]" : part.state.output,
                 callProviderMetadata: part.metadata,
               })
             }