Repository navigation
fix(memory): turn thinking off for memory's short JSON side calls - #4687
Conversation
With Qwen3.6-35B-A3B as the local default, every memory extraction after a turn reasoned until its 4096-token cap and returned no answer. Each call held the GPU for 2-3 minutes, outlived the agent's 60s abandon, and queued behind the next one, so a /model switch waited ~12 minutes for the backlog to drain. GAIA sends enable_thinking=true on every Qwen3.6 request, side calls included. Extraction, consolidation, reconciliation and skill distillation now pass no_thinking_kwargs(model), which turns it off for local models with a thinking switch and sends nothing for cloud models or models without one. An extraction that still spends its whole budget on reasoning now logs an ERROR instead of a WARNING the TUI's user-mode log drops.
|
Verdict: Approve with suggestions. Merge once the On Qwen3.6, memory's background JSON calls spent their whole token budget reasoning, so they returned nothing and held the GPU for minutes after each turn. This PR turns thinking off for those side calls only, and only for local models GAIA has a thinking switch for. The main chat turn, Gemma, and cloud models are unaffected. The fix is narrow and correct, and the tests check what actually goes out over the wire.
Real-world evidenceN/A: no evidence bundle was produced for this run. The changed surface is an internal LLM side call that needs real Qwen3.6 inference, so it is deferred to the strix-halo lane. The PR's own test plan names the right on-hardware check ( 🔍 Technical detailsIssues 🟡 Eval gate not yet met. This is an LLM-affecting change: the request sent to Lemonade for memory extraction, consolidation, reconciliation and distillation is different now. Per CLAUDE.md, run 🟢 Duplicate empty-reply warning ( 🟢 Coverage is limited to models GAIA registers. Checked and fine
Strengths
|
Asking GAIA to summarize a 46-minute meeting returned half a summary: the `summarize_document` result stopped mid-bullet, before the second half of the meeting, so the answer listed 3 action items with no owners where the meeting had 9 with owners. Every summary request went out under the RAG client's 1,024-token output limit, and a model that reasons first (Gemma 4, and Qwen3.6, the new large default, which runs with thinking on) spent most of that before writing. The cut-off reply was returned as if it were complete. Summaries now get an 8,192-token budget with thinking off where the model has a switch, a reply the limit still cuts off is an error instead of a summary, and a section that fails no longer drops silently out of a multi-section summary. ## Test plan - [x] Reproduced on a real 46-min meeting recording (Gemma-4-E4B, local Lemonade): the same summary request with the old budget ends with `finish_reason: length`, 4,284 chars of reasoning and 755 chars of summary. - [x] Same recording end to end through `gaia chat -q "Transcribe … summary … action items"` on this branch: the summary now covers the whole meeting (message UUIDs, auth friction, native-binary plan from the second half were missing before). - [x] `pytest tests/unit/test_summarize_document_sections.py tests/unit/test_rag_file_resolution.py tests/unit/test_audio_tools.py` (60 passed), `pytest tests/unit/rag` (312 passed) - [x] `python util/lint.py --black --isort --flake8` - [ ] Eval: `rag_quality` and the meeting/audio scenarios on the CI Strix Halo pool (summarize_document is a model-visible tool path) <details> <summary>🔍 Technical details</summary> - `_summary_text()` in `rag_tools.py` sends with `max_tokens=SUMMARY_MAX_TOKENS` and `no_thinking_kwargs(effective_model)` (the helper amd#4687 added for memory's side calls), and raises on `finish_reason == "length"`. - The single-section path returns `status: error` with a hint to answer from `query_documents`; the section loop now propagates a failure to the tool's existing error handler instead of `continue`. - Gemma 4 has no thinking switch (`requested_thinking` is None), so its reasoning still comes out of the budget; 8,192 leaves room at its 64K context. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
On Qwen3.6-35B-A3B (the local default wherever a GPU holds it), every memory extraction after a turn reasoned until its 4096-token cap and wrote no answer — so memory learned nothing, and each call held the GPU for 2–3 minutes after the user's turn had ended. The agent abandons the call at 60s but Lemonade keeps generating, so calls pile up: on the v0.25 RC a
/modelswitch waited ~12 minutes for six of them to drain. Memory's short JSON side calls (extraction, consolidation, reconciliation, skill distillation) now turn thinking off for local models that have a thinking switch; the main turn is unchanged.Eval required before merge — this changes what Qwen3.6 is asked to do for memory extraction (an LLM-affecting path). A
gaia eval agentrun on thegaia_memorycategory is pending.🔍 Technical details
lemond.logshows six non-streaming requests atout=4096(prompts 404–1142 tokens), each fired ~100 ms after a turn'sStreaming completed; the same call on Gemma produces 179–215 tokens. The TUI's agent log is ERROR-only in user mode, which is why the "extraction abandoned" WARNING never appeared.ModelRequirement.thinking=Truefor Qwen3.6 makeschat_completionssendenable_thinking: trueon every request unless the caller overrides it, and no memory side call did. Consolidation (1024) and reconciliation (256) had the same flaw with even smaller budgets.no_thinking_kwargs(model)inlemonade_client.pymirrors the auto-title helper's gate: it returns{}for cloud models and for models without a registered switch.finish_reason=lengthwith no text now logs an ERROR naming the model.id_slot=SIDE_SLOTsits on different lines of the same call.Test plan
pytest tests/unit/test_lemonade_cloud_models.py tests/unit/test_memory_mixin.py tests/unit/test_skill_synthesis_incremental.py tests/unit/test_skill_synthesis.py: 489 passedmain(5 fail on the Qwen3.6 path; the Gemma and cloud "send nothing" cases pass either way)enable_thinking: falseand the card's non-thinking sampling, streaming and non-streamingpython util/lint.py --black --isortgaia eval agent --category gaia_memoryon Qwen3.6-35B-A3B (scores the flagship)grep "out=4096" lemond.logstays empty across several turns, and a/modelswitch loads at once