GeezerVison is showing github.com — fix(server): HTML attachments no longer fail OpenCode turns as native file parts by enving · Pull Request #19062 · pingdotgg/t3code
Conversation
Problem
Attaching an HTML file (e.g. enterprise_context_layer_faq.html) to a chat breaks the turn: the model run fails with 'file part media type text/html' functionality not…. Expected: the attachment reaches the agent like any other non-image file.
Reproduction: on mobile (also affects any client sending through the OpenCode provider), attach a .html file and send. toOpenCodeFileParts classified every text/* mime as a native file part, so text/html was handed to OpenCode, whose Anthropic path rejects HTML file parts before the turn starts.
Change
isOpenCodeNativeFilePart in packages/provider-opencode/src/server/OpenCodeRuntime.ts now excludes text/html (matching on the base mime, so text/html; charset=… is covered too). HTML attachments ride only as the file-path line providerMessageTextWithAttachmentPaths already adds to the prompt — the same fallback ZIP files use. This is the single choke point used by both the v1 adapter turn path and text generation; the v2 adapter only sends prompt text with paths and is unaffected.
Scope and approval
Very small, focused fix for an obvious bug, submitted without a prior issue: 2 files, one mime excluded, no behavior change for images, plain text, markdown, or PDFs. No new surface, no config, no docs change needed (no user-guide behavior changes; the error simply stops happening).
Verification
vp test run packages/provider-opencode/src/server/OpenCodeRuntime.cliParsers.test.ts — pass, including the extended toOpenCodeFileParts case asserting text/html and text/html; charset=utf-8 are skipped while pdf/markdown/png still pass through.
pnpm --filter @t3tools/provider-opencode typecheck — clean.
- Could not check: an on-device run against a live OpenCode provider (no dev client in this environment); verified at the unit level plus the shared code path instead.
Muse Spark via OpenCode.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 79fae3c
Macroscope's review found this PR approvable — This is a small, tested OpenCode compatibility fix that routes HTML attachments through the existing path-based prompt fallback instead of the rejecting native file-part path. It introduces no configuration, schema, deployment, security, billing, or static-analysis changes.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d12f7f38-b8c8-485b-845d-5600c61a9efd
📥 Commits
-
Reviewing files that changed from the base of the PR and between 98a6246 and 79fae3c.
📒 Files selected for processing (2)
-
packages/provider-opencode/src/server/OpenCodeRuntime.cliParsers.test.ts
packages/provider-opencode/src/server/OpenCodeRuntime.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
-
OpenCode attachment filtering now removes MIME parameters before checking native file eligibility. It continues to exclude HTML, and the tests include HTML attachments with and without a charset parameter.
Changes: OpenCode attachment filtering
| Layer / File(s) |
Summary |
Normalize and filter attachment MIME types packages/provider-opencode/src/server/OpenCodeRuntime.ts, packages/provider-opencode/src/server/OpenCodeRuntime.cliParsers.test.ts |
Filtering checks the MIME type without parameters, rejects text/html, and accepts supported images, text types, and PDF based on the normalized type. The comment and tests also identify HTML as excluded. |
Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: ⚪ Minimal · up to 79fae
-
Supported attachments with MIME parameters can use native file parts, while HTML remains excluded. No concrete merge-blocking risk is identified.
### Architecture Summary
Architecture risk: 🔵 Low · up to 79fae
The change affects 1 system.
Changed systems: packages/provider-opencode
Architecture concerns
No architecture-level concerns identified.
Review details
-
Systems and components
- observed — packages/provider-opencode (library) was modified; 2 changed files map to changed impact.
Before / after behavior
- observed — Modified behavior in packages/provider-opencode/src/server/OpenCodeRuntime.cliParsers.test.ts: The test adds HTML attachments, including one with a charset parameter, to the existing inputs whose expected native file parts exclude unsupported types.
- observed — Modified behavior in packages/provider-opencode/src/server/OpenCodeRuntime.ts: The attachment comment now includes HTML among file types that are not sent as native file parts.
- observed — Modified behavior in packages/provider-opencode/src/server/OpenCodeRuntime.ts: Native-file eligibility now compares the MIME type without parameters. It explicitly rejects
text/html; supported images, text/*, and application/pdf are otherwise accepted based on the normalized base MIME. Previously, parameterized MIME types failed the exact checks.
Pre-merge checks · 4
-
Passed checks (4 passed)
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title is concise, specific, and accurately describes the fix for HTML attachments in OpenCode turns. |
| Description check |
 |
The description includes the problem, expected behavior, implementation details, scope rationale, approval exception, focused verification results, and an unavailable live-provider check. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note 🤖 Claude Opus 5.5 responding on behalf of Theo
Closing because this PR states that Muse Spark wrote code in it:
Muse Spark via OpenCode.
We do not accept code written by Gemini models or by Muse models other than Muse Wonder Full. See Models we do not accept.
To have this considered again, open a new PR with the code written by a different model and link this one.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|