Releases
v0.1.9
Compare
Sorry, something went wrong.
No results found
cell 0.1.9
修复:思考中断 / 空回复(真实 Ollama 4k 上下文)
根因:Ollama 的 OpenAI 兼容流把思维链放在 delta.reasoning,内核只读 reasoning_content,思维 token 全被丢弃;4k 窗口耗尽后表现为「思考突然不说话」。
三种字段全兼容(reasoning_content / reasoning / thinking);finish_reason 在 delta 守卫之前 捕获,末帧没有 delta 也能识别截断。
finish_reason=length + 大 prompt → context-window 诊断 + 自动压缩重试;纯 reasoning 不算答案,会明确报错而不是静默成功。
Ollama 不报 usage 时用字符数兜底判断上下文压力;非 SSE 单 JSON body 回退会真正流式发出 恢复的文本。
新功能:模型上下文窗口(手动 / 自动)+ 上下文占用显示
provider_entry.context_window(0 = auto),运行时 /context [auto|N] 查看/设置,显示来源与 75% 压缩阈值。
自动探测本机 Ollama:/api/ps 的运行时窗口 → Modelfile num_ctx → 默认 4k;不使用 /api/show 的架构上限(gemma4 报 131072,实际运行 4096)。
usage SSE 帧新增 context_window / context_tokens / context_pct;/v1/health 暴露 context_window;桌面状态条显示 ctx N% (tokens/window)。
自动压缩阈值改为解析窗口的 75%(未知时回退 3072)。
测试
新增 tests/e2e_context_overflow.py:单轮 normal / reasoning-only(两种字段)/ content_filter / 单 JSON / 空完成 auto-compact 恢复 / 多轮「正常→失败→恢复」,并断言 usage 帧携带上下文字段。
selftest 覆盖 reply_carries_answer、诊断串命中 is_context_overflow、75% 阈值与百分比、context_window 配置 round-trip。
提交
3d27cc6 fix: parse Ollama's reasoning stream, reject reasoning-only turns, and handle 4k context truncation
7a59bd5 test: cover empty, reasoning-only, truncated, content-filter and multi-turn turns end to end
66624e6 feat: model context window (manual + auto-detect) and context occupancy display
0de3423 test: assert the usage frame carries context_window / context_tokens / context_pct
49c85d9 fix: show the resolved context window in the strip even when the provider reports no usage
3ab6562 fix: keep the frontend lint green (unused test helper parameter)
You can’t perform that action at this time.