Plain source starting with `let ftype` is attached as video/mp4
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #67449 by @qyb156 — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bun, typescript
- Domain
- backend
Research direction
Start in packages/core by reading the MIME detector imported as @opencode/core/mime; the issue reproduces the problem with Mime.detect(Buffer.from("let ftype = 1\n")). Check how it recognizes ISO-BMFF box types and compare the result with the same input using kind. Done when the JavaScript source is detected as text/plain while actual video files still identify correctly.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 230k
- Forks
- 31.3k
- Avg merge
- 6h 58m
- Merged PRs (30d)
- 471
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anomalyco/opencode
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area/tui type/feature version/v2
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
anomalyco/opencode#67749 · 1 comment ·
Maintainers usually reply within 1 day
-
area/web platform/ios type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anomalyco/opencode#67504 · 1 comment ·
Maintainers usually reply within 1 day
-
area/tui platform/macos type/feature version/v2
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
anomalyco/opencode#67490 · 2 comments ·
Maintainers usually reply within 1 day
-
tui: permission prompt does not display message set by permission.evaluate hookPossibly taken @ningsiyuan1024 claimed this 1 day ago. Openarea/tui platform/macos status/repro-simulated type/bug version/v2
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
anomalyco/opencode#67437 · 4 comments ·
Maintainers usually reply within 1 day
All issues in anomalyco/opencode
Similar issues
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
effort/l priority/p1 risk/high triage/core
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
iflytek/skillhub#1188 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Fission-AI/OpenSpec#2337 ·
Maintainers usually reply within 1 day
-
Edit Network Properties can't be closed in a narrow windowPossibly taken @hridhinvarkeyjoseph claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cytoscape/cytoscape-web#1027 ·
Maintainers usually reply within 1 day