opencode-go: qwen4-max missing application/pdf input modality

Đang mở Phù hợp với người mới
#13,895 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@definitelynotguru đang làm issue này rồi.

Từ ngày 20/11/2026.

  • #14155 của @definitelynotguru — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
data

Hướng nghiên cứu

Bắt đầu với providers/opencode-go/models/qwen4-max.toml và so sánh các phương thức đầu vào của tệp này với models/alibaba/qwen4-max.toml, nơi issue cho biết có liệt kê hỗ trợ PDF. Thêm application/pdf vào các phương thức đầu vào của mô hình Go và sửa nhận xét nói rằng PDF không được liệt kê. Hoàn tất khi metadata khai báo đầu vào PDF nhất quán với mô hình cơ sở.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

The opencode-go/qwen4-max entry omits application/pdf from its input modalities, even though its base model (alibaba/qwen4-max) lists PDF input and the Go endpoint accepts PDF document blocks. Harnesses that rely on this metadata (e.g. OpenCode) therefore drop PDF attachments silently, making PDF input appear broken for this model.

Environment

  • opencode version: 2.3.0
  • OS: macOS (Darwin 25.6.0, arm64)
  • Terminal: xterm-256color (OpenCode desktop app; TERM_PROGRAM unset)
  • Shell: /bin/zsh
  • Install/channel: latest
  • Active plugins: none found in config

Reproduction

  1. Connect OpenCode Go and select opencode-go/qwen4-max in OpenCode.
  2. Attach a small PDF to a prompt (e.g. a one-page PDF containing the text "The secret code is BANANA-42.").
  3. Ask the model to read the attached PDF and report its contents, without using tools.

Expected Behavior

The PDF is sent to the model as document media and the model reads it. The base model entry models/alibaba/qwen4-max.toml lists application/pdf in [modalities].input, citing Alibaba's PDF understanding documentation.

Actual Behavior

OpenCode's attachment handling requires the selected model to declare PDF input; otherwise it "sends a short note in its place" (https://opencode.ai/docs/attachments/). Because providers/opencode-go/models/qwen4-max.toml lacks application/pdf, the PDF never reaches the model and it responds as if no document was attached. No error is surfaced.

Additional Context

  • Affected file: providers/opencode-go/models/qwen4-max.toml. Its comment says "Modalities: image and video input as the file already listed (not PDF); MIME types from the lab", but the lab file it references (base_model = "alibaba/qwen4-max") does include application/pdf.
  • Verified end-to-end on 2026-11-17: with a local OpenCode config override adding pdf to the model's capabilities.input, the same test PDF sent through https://opencode.ai/inference/go/anthropic/v1 (Anthropic Messages) was accepted, and the model correctly replied BANANA-42 (end_turn, ~8.4K input tokens). The endpoint supports PDF input; only the metadata omits it.
  • Suggested fix: add "application/pdf" to [modalities].input in providers/opencode-go/models/qwen4-max.toml and correct the comment.
  • Other Go models served through the same Messages translation may have the same omission; an audit of Go entries against their base models' PDF support would be worthwhile.
  • User-side workaround until fixed: override providers.opencode-go.models.qwen4-max.capabilities.input to ["text", "image", "video", "pdf"] in opencode.json.
Ngôn ngữ chính
TypeScript
Star
7.8k
Fork
2.2k
Merge trung bình
7 giờ 1 phút
Pull request đã merge (30 ngày)
794

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/models.dev

Tất cả issue của anomalyco/models.dev

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.