bug: context usage estimator counts base64 image data URIs in message files as text, causing spurious auto-compaction

当 Open WebUI 中的多模态 Agent 通过 Open Terminal 的 read_file 查看图片时,上下文计量器会把持久化消息里的 base64 图片数据当作文本按“字符数 ÷ 4”来估算 token,结果单条 tool 消息被算成约 1M “token”,远超引擎实际上下文,从








![ValueError: 'text-generation' is not a valid ModelType` [[2]](https://github.com/langgenius/dify/issues/41294). The root cause is that old rows in tables like `provider_models`, `provider_mode](https://www.chat-gpts.plus/wp-content/uploads/2026/09/41605-8fa5f766-768x403.jpg)