attachments: PDF capability is not revalidated after a model switch
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Start with the attach-time PDF capability check in feature/session/src/main/kotlin/ai/opencode/feature/session/SessionFeatureAttachments.kt (lines 58-81), then trace how model selection in SessionFeatureSend.kt (around 627-630) leaves pendingAttachments untouched. Follow the send snapshot in SessionFeatureSend.kt (321-323, 414-425) into SessionFeatureDelivery.kt (333-362). Done means the send path revalidates attachments against the model chosen at send time, with a readable error or fallback, covered by tests extending FileAttachmentTests.kt (265-292).
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
PDF input support is checked when the file is attached, not when the prompt is sent. If the user attaches a PDF while using a PDF-capable model and then switches to a text-only model, Android sends the same inline PDF to the new model. The provider can reject the prompt or the model can report that it cannot read the attachment.
Environment
- Android app: reporter's build not provided; behavior confirmed in
v0.8.8(c2311a60337e2a2128baba7c6eccb61b22bdb3f7) anddev(cab26e54c453fbaf8683ec456e628539d64b325f) source. - OpenCode server: version not provided.
- Device/OS: not provided.
- Terminal/shell: not applicable.
- Active plugins: none required.
Reproduction
- Select a model whose catalog entry advertises PDF input.
- Attach a PDF no larger than 20 MiB. Android reads it inline.
- Before sending, switch to a model whose catalog entry does not advertise PDF input.
- Send the prompt.
Expected Behavior
Android revalidates the attachment against the model selected at send time. It either uploads the PDF as a path-backed file with a clear explanation, extracts supported text, or blocks sending and explains that the selected model cannot read PDFs. The draft and attachment remain intact.
Actual Behavior
The inline PDF bytes remain in pendingAttachments. Delivery switches the server to the new model and posts the unchanged PDF file part. There is no compatibility warning or fallback, so the failure appears only after submission as a provider error or an unreadable attachment.
Additional Context
- Attach-time capability check:
feature/session/src/main/kotlin/ai/opencode/feature/session/SessionFeatureAttachments.kt:58-81. - Model selection changes model state but does not revisit attachments:
SessionFeatureSend.kt:627-630. - Send snapshots the unchanged attachment list:
SessionFeatureSend.kt:321-323,414-425. - Delivery switches the model, then posts the same inline attachments:
SessionFeatureDelivery.kt:333-362. FileAttachmentTests.kt:265-292covers attaching and sending a PDF to a capable model, but not switching models between those steps.- Suggested acceptance checks: capable → text-only model switch, text-only → capable switch, queued sends, draft preservation, and a readable error when no fallback exists.
- Static source reproduction only; no provider response, device screenshot, or log was provided.
- Ngôn ngữ chính
- Kotlin
- Star
- 146
- Fork
- 35
- Merge trung bình
- 7 giờ 41 phút
- Pull request đã merge (30 ngày)
- 221
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của anomalyco/opencode-android
-
F-droid releaseĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
anomalyco/opencode-android#345 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Crash: IllegalStateException in AppContext.getLiveValueCó thể đã có người làm @Tarquinen đã nhận 1 ngày trước. Đang mởcrash crash-triaged
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 65/100
anomalyco/opencode-android#343 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
crash crash-needs-human crash-triaged
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
anomalyco/opencode-android#341 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
crash crash-needs-human crash-triaged
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
anomalyco/opencode-android#340 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Crash: OutOfMemoryError in LiveTransportKt$awaitResponse$2$2.onResponseCó thể đã có người làm @Tarquinen đã nhận 3 ngày trước. Đang mởcrash crash-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
anomalyco/opencode-android#320 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của anomalyco/opencode-android
Issue tương tự
-
feature request needs decision
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
tswistak/Battery-Monitor#207 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
IzzyOnDroid inclusionĐang mởF-Droid FOSS question
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
d4rken-org/butler#365 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
panel-assistant/android#224 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày