Plain source starting with `let ftype` is attached as video/mp4
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #67449 来自 @qyb156 —— 已关闭,未合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bun, typescript
- 领域
- backend
调研方向
从packages/core开始,阅读以@opencode/core/mime导入的MIME检测器;该 issue 中的问题可通过Mime.detect(Buffer.from("let ftype = 1\n"))复现。检查它如何识别 ISO-BMFF box 类型,并将结果与使用kind处理相同输入时的结果进行比较。完成标准是:JavaScript 源码被检测为text/plain,而实际的视频文件仍能正确识别。
由索引模型根据 Issue 内容生成。
描述
Description
Attaching a JavaScript file whose first line is let ftype = "text/plain" labels the file as video/mp4. A session selecting a line from the file then retains the whole attachment. Request preparation for a text-only model replaces the attachment with “Cannot read … this model does not support video input.”
OpenCode version
Reproduced against dev at 484289a4e8. The MIME detector is identical in v2.4.3.
Steps to reproduce
- In a checkout of OpenCode, run
bun install --frozen-lockfileand change topackages/core. - Run
bun -e 'import { Mime } from "@opencode/core/mime"; console.log(Mime.detect(Buffer.from("let ftype = 1\n")))'. - The result is
video/mp4. Changingftypetokindreturns the expectedtext/plain.
The four letters ftyp in the variable name land where an ISO-BMFF file would store its box type.
Operating System
macOS, arm64, Bun 1.4.4.
- 主要语言
- TypeScript
- 星标
- 230k
- 派生
- 31.3k
- 平均合并
- 5 小时 59 分钟
- 30 天内合并 PR
- 473
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
area/web platform/ios type/bug
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#67504 · 1 条评论 ·
维护者通常 1 天内回复
-
area/tui platform/macos type/feature version/v2
难度 2/5 1-3 小时 新手友好度 83/100
anomalyco/opencode#67490 · 1 条评论 ·
维护者通常 1 天内回复
-
tui: permission prompt does not display message set by permission.evaluate hook可能已有人在做 @ningsiyuan1024 今天认领。 未关闭area/tui platform/macos status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 74/100
anomalyco/opencode#67437 · 3 条评论 ·
维护者通常 1 天内回复
-
area/desktop type/feature
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#67414 · 1 条评论 ·
维护者通常 1 天内回复
-
area/desktop platform/macos type/feature version/v2
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#67266 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
MTES-MCT/monitorenv#3257 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
salesforce/sa11y#1022 ·
-
Kartographer map markers lose their geo: link on non-English wikis可能已有人在做 @playlikeboy 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
openzim/mwoffliner#3014 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
ardia-browser/ardia#5810 ·
维护者通常 1 天内回复