summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-07-04 12:50:41 -0400
committerDax Raad <[email protected]>2025-07-04 12:50:52 -0400
commit06dba28bd69134535ad4a1482b7bbda9f26f96d6 (patch)
tree238fd812d737ad1c59c2be84d41585c943bf94d7 /packages
parentb8d276a0494457dd59cd74ae57813ad23e432563 (diff)
downloadopencode-06dba28bd69134535ad4a1482b7bbda9f26f96d6.tar.gz
opencode-06dba28bd69134535ad4a1482b7bbda9f26f96d6.zip
wip: fix media type
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/session/index.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts
index 437ce09bd..2afba4711 100644
--- a/packages/opencode/src/session/index.ts
+++ b/packages/opencode/src/session/index.ts
@@ -374,7 +374,7 @@ export namespace Session {
start: url.searchParams.get("start"),
end: url.searchParams.get("end"),
}
- if (range.start != null) {
+ if (range.start != null && part.mediaType === "text/plain") {
const lines = content.split("\n")
const start = parseInt(range.start)
const end = range.end ? parseInt(range.end) : lines.length
@@ -382,8 +382,8 @@ export namespace Session {
}
return {
type: "file",
- url: "data:text/plain;base64," + btoa(content),
- mediaType: "text/plain",
+ url: `data:${part.mediaType};base64,` + btoa(content),
+ mediaType: part.mediaType,
filename: part.filename,
}
}
@@ -406,7 +406,7 @@ export namespace Session {
{
role: "user",
content: "",
- ...toParts(input.parts),
+ parts: toParts(input.parts).parts,
},
]),
],