Skip to content

fix: two-pass extraction truncated on thinking-heavy models (qwen3.8) - #31

Merged
pretyflaco merged 1 commit into
mainfrom
fix/ollama-extract-output-reserve
Aug 15, 2026
Merged

fix: two-pass extraction truncated on thinking-heavy models (qwen3.8)#31
pretyflaco merged 1 commit into
mainfrom
fix/ollama-extract-output-reserve

Conversation

@pretyflaco

Copy link
Copy Markdown
Owner

Problem

The Ollama two-pass summarization flow auto-sizes Pass 1's context window via _dynamic_num_ctx, which reserved only 4096 output tokens. Thinking-heavy models that emit long exhaustive extractions — notably qwen3.8:27b — exhaust the window mid-extraction (done_reason: length) and silently truncate, roughly halving topic/action/question coverage on larger meetings.

Discovered while evaluating qwen3.8 through millet's real code path (not a harness): an earlier ad-hoc test showed 22 topics on a 44 KB meeting, but the shipped pipeline produced only 8 — the extraction was being cut off.

Fix

  • _call_ollama_chat gains an output_reserve parameter (default 4096, unchanged behavior).
  • Pass 1 (extraction) passes output_reserve=16384; Pass 2 (small input) unchanged.
  • Root cause confirmed via done_reason: shipped config → length (truncated); fix → stop (complete).

Evidence (measured through millet's real two-pass, qwen3.8:27b)

Meeting Before (T/A/D/Q) After Cloud baseline
EN 44 KB 8 / 1 / 1 / 1 20 / 8 / 4 / 7 11 / 6 / 3
EN 33 KB 13 / 8 / 3 / 3 10 / 24 / 5 / 10 18 / 20 / 4
EN 43 KB 8 / 6 / 1 / 2 20 / 16 / 6 / 10 10 / 12 / 4
TR 6 KB 10 / 1 / 3 / 7 (Turkish, headers localized) 6 / 1
DE 68 KB 15 / 4 / 3 / 8 (German, headers localized) 15 / 3

Pass-1 extraction on the 44 KB meeting grew ~1.8 KB → ~5.6 KB. Format 5/5 throughout; no hallucinated speakers.

Tests

  • New TestDynamicNumCtx: output_reserve widens context + respects ceiling.
  • Updated two-pass flow test to assert Pass 1 requests output_reserve=16384, Pass 2 keeps 4096.
  • tests/test_summarize*.py: 45 passed; ruff clean.

Version 0.15.0 → 0.15.1.

…ncation

The two-pass Ollama flow auto-sized Pass 1's context via _dynamic_num_ctx
with only a 4096-token output reserve. Thinking-heavy models that emit long
exhaustive extractions (qwen3.8:27b) hit the context window mid-list
(done_reason: length) and silently truncated, ~halving coverage on larger
meetings. Pass 1 now reserves 16384 output tokens; Pass 2 unchanged.
_call_ollama_chat gains an output_reserve parameter.

Verified via millet's real code path on EN/TR/DE meetings: qwen3.8 topic
coverage on a 44 KB meeting rose 8 -> 20 (matching the cloud baseline),
format 5/5, localized headers intact. Bump 0.15.0 -> 0.15.1.
@pretyflaco
pretyflaco merged commit 262425c into main Aug 15, 2026
3 checks passed
@pretyflaco
pretyflaco deleted the fix/ollama-extract-output-reserve branch August 15, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant