attachments: PDF capability is not revalidated after a model switch
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- mobile-dev
调研方向
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).
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Kotlin
- 星标
- 146
- 派生
- 35
- 平均合并
- 7 小时 41 分钟
- 30 天内合并 PR
- 221
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode-android 的其他 Issue
-
F-droid release未关闭
难度 3/5 1-2 天 新手友好度 55/100
anomalyco/opencode-android#345 ·
维护者通常 1 天内回复
-
Crash: IllegalStateException in AppContext.getLiveValue可能已有人在做 @Tarquinen 于 1 天前认领。 未关闭crash crash-triaged
难度 3/5 半天 新手友好度 65/100
anomalyco/opencode-android#343 · 1 条评论 ·
维护者通常 1 天内回复
-
crash crash-needs-human crash-triaged
难度 3/5 1-2 天 新手友好度 58/100
anomalyco/opencode-android#341 · 1 条评论 ·
维护者通常 1 天内回复
-
crash crash-needs-human crash-triaged
难度 3/5 1-2 天 新手友好度 45/100
anomalyco/opencode-android#340 · 1 条评论 ·
维护者通常 1 天内回复
-
Crash: OutOfMemoryError in LiveTransportKt$awaitResponse$2$2.onResponse可能已有人在做 @Tarquinen 于 3 天前认领。 未关闭crash crash-triaged
难度 2/5 1-3 小时 新手友好度 35/100
anomalyco/opencode-android#320 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode-android 的全部 Issue
相似的 Issue
-
feature request needs decision
难度 2/5 1-3 小时 新手友好度 83/100
tswistak/Battery-Monitor#207 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
-
F-Droid FOSS question
难度 1/5 1 小时以内 新手友好度 75/100
d4rken-org/butler#365 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
panel-assistant/android#224 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复