Repository navigation
Description
Overview
packages/desktop-app/src-tauri/tests/ai_chat_send_to_idle_test.rs (the ADR-048 Tauri-seam e2e AI-chat test that runs in the pre-push gate) was hardcoded to use ministral-3b-q4km (Ministral-3-3B-Instruct-2512-Q4_K_M.gguf) as "the fastest available real model." It reproducibly stalls: the daemon's inference turn never produces a single assistant token, and the test times out at 300s with assistant_count=0 — every time. This is a different failure class from the load-sensitive flakiness already fixed in #1610/#1616.
Problem Statement
Running the pre-push gate while landing an unrelated docs-only change (#1529 Phase 2, a SKILL.md-only diff) failed identically three times in a row on this one test:
ai-chat turn did not reach idle-with-new-reply within 300s; last status="idle", assistant_count=0
- System load average was quiet during at least one of the runs (1.69 / 2.02 / 1.80 on a 10-core machine — well below the ~10.5 load that caused ADR-048 Tauri-seam e2e tests flake under machine load with daemon-health timeouts #1610's flakiness), ruling out CPU contention as the cause.
- The model file is present on disk (
~/.nodespace/models/Ministral-3-3B-Instruct-2512-Q4_K_M.gguf, ~2GB), so the test'smodel_file_availableskip-check was not silently skipping it — the turn genuinely ran and genuinely produced zero tokens. - Isolating the cause: temporarily swapping the test's
MODEL_ID/MODEL_FILENAMEconstants toministral-8b-q4km(Ministral-3-8B-Instruct-2512-Q4_K_M.gguf, also present on disk) and re-running just that test directly passed cleanly (31-44s) across two separate runs.
The stall is specific to ministral-3b-q4km (or its GGUF file) on this machine — not a test-harness bug, not the #1610 load-flake class, and unrelated to #1529's daemon/CLI/schema changes.
Architecture Impact
ADR-046 ("Ministral 8B Is the Locked Native Model") already decided that ministral-8b-q4km is the only model locked to the native llama.cpp path — chosen specifically because it's the one model that passes NodeSpace's full agent tool-call matrix (12/12). ministral-3b-q4km is not the locked native model and was never validated against that matrix; this test's choice of the 3B model as "fastest available real model" for a smoke test predates or was made independently of that decision. This issue does not reverse ADR-046 — the interim fix below (switching the test to 8B) actually aligns the test with the already-decided native model, rather than diverging from it. No companion nodespace-docs change is required.
Interim Fix Landed
As part of #1529, the test's hardcoded model was switched from ministral-3b-q4km to ministral-8b-q4km (the ADR-046-locked native model) so the pre-push gate is unblocked. This is a workaround for the gate, not a fix for the underlying 3B stall — the root cause below is still open.
Acceptance Criteria
- Root cause of the
ministral-3b-q4kmgeneration stall is identified (corrupted/incompatible GGUF file, a chat-template or tokenizer discrepancy specific to the 3B checkpoint, or a llama.cpp inference-path bug that only manifests on this weights file) - Either the 3B model is fixed and re-verified against a manual ai-chat turn, or a decision is recorded that the 3B model is not viable and should be removed from the catalog / no longer offered
- Code passes
bun run quality:fix; tests pass
Technical Specifications
Reference Files
- ai_chat_send_to_idle_test.rs:
packages/desktop-app/src-tauri/tests/ai_chat_send_to_idle_test.rs— the e2e test that surfaced the stall; already switched toministral-8b-q4kmas an interim fix - model_manager.rs:
packages/agent/src/local_agent/model_manager.rs—CATALOGentries forministral-3b-q4kmandministral-8b-q4km; compare chat template / generation config between the two entries
Suggested Investigation
- Re-download and checksum-verify
Ministral-3-3B-Instruct-2512-Q4_K_M.gguf— a corrupted GGUF would explain a silent generation stall with no error surfaced. - Diff the
ministral-3b-q4kmcatalog entry againstministral-8b-q4kmfor any chat-template, context-size, or generation-parameter difference that could cause the smaller model to hang rather than generate. - Reproduce independently of the Tauri test harness — e.g.
nodespace model load ministral-3b-q4kmthen drive a manual ai-chat turn viascripts/aichat.sh— to confirm the stall isn't specific to the Tauri command layer (the reproduction here already used the real Tauri command layer, so this is a secondary check, not the primary lead).
Related Issues
- ADR-048 Tauri-seam e2e tests flake under machine load with daemon-health timeouts #1610 (the load-flake class this is explicitly distinct from)
- Align CLI + SKILL.md with local-agent capability and guidance (external-harness parity) #1529 (where this was discovered and the interim 8B fix landed)
Activity
WIP: #1529 Phase 2 — complete, reviewed, addressed; ready for Section 3
malibio commentedon Jul 11, 2026
Correction/addendum to the original report: the ministral-8b-q4km swap is NOT fully deterministic either. After landing the swap, the pre-push gate hit the identical failure mode once more —
assistant_count=0at the 300s timeout — on a quiet machine (load average ~1.7) with 8B already in place. Re-running the same test in isolation immediately after passed cleanly in 30s, and a second full-gate push attempt right after that passed too.So the accurate claim is: ministral-3b-q4km stalls to 0 tokens on every single observed run (4/4). ministral-8b-q4km is meaningfully more reliable (passed 3 of 4 full-gate attempts, plus 2 isolated runs) but flaked once under full-suite contention, consistent with the same class of load/contention sensitivity #1610 already documented for this suite generally — just with a longer tail than #1610's fix fully closed out, or a model-loading-under-contention edge case specific to this test's EnsureModelReady + inference sequencing.
Doesn't change the interim fix (8B stays as the test's model) or the root-cause investigation scope for the 3B stall specifically, but the acceptance criteria here should probably also cover: confirm whether 8B's occasional stall under full-gate contention is the same root cause as the 3B deterministic stall (shared code path issue) or a separate, purely load-related flake that #1610/#1616 didn't fully eliminate for this specific test.
WIP: #1529 Section 3 — propagation tooling, ready for review
WIP: #1529 Section 3 — done, reviewed, addressed; ready for Section 4
malibio commentedon Jul 12, 2026
Baseline (worktree issue-1636-gemma4-native-model): Frontend 159 test files / 4031 tests passed. Scope redirected per user direction: this issue now covers adopting Gemma 4 E4B as the native/locked model (superseding ADR-046's Ministral 8B lock), not the ministral-3b-q4km stall root-cause. Gemma 4 E4B scored 10/12 on the aichat-matrix tool-call eval (fails: query-tool phrasing mismatch on 'list all', incomplete update turn missing the update_node follow-up) — tracked as follow-up, not blocking.
[-]ministral-3b-q4km stalls to 0 tokens generated (300s timeout) independent of machine load[/-][+]Adopt Gemma 4 E4B as the locked native model (supersedes ADR-046's Ministral 8B lock)[/+]malibio commentedon Jul 12, 2026
Scope redirected
Per direction this session, this issue no longer investigates the
ministral-3b-q4kmgeneration stall. Instead: adopt Gemma 4 E4B (gemma-4-e4b-q4km) as the locked native model, replacing Ministral 8B.Why
aichat-matrix.tsbecoming an assertable eval (Make the agent scenario matrix (aichat-matrix.ts) an assertable CI eval, not just an observation harness #1364/Make the agent scenario matrix (aichat-matrix.ts) an assertable CI eval, not just an observation harness #1627) — it cannot be reproduced or checked.ministral-8b-q4km: 11/12 (Scenario 3 schema creation — proactively created an extra, unrequested schema)gemma-4-e4b-q4km: 10/12 (Scenario 5 — wrong query tool; Scenario 6 — update turn stopped after search, never called update_node)ministral-3:3b/mistral:7b) — not yet confirmed on Ministral 8B's native path, but a relevant risk factor as NodeSpace's tool catalog grows.Full rationale: ADR-056, which supersedes ADR-046.
Changes in this PR
packages/desktop-app/src-tauri/tests/ai_chat_send_to_idle_test.rs: swapped MODEL_ID/MODEL_FILENAME from Ministral togemma-4-e4b-q4kmpackages/agent/src/local_agent/model_manager.rs:recommended_model_id()(the live gRPC 'recommend a model' default used by the CLI and Settings UI model picker) now returns Gemma 4 E4B instead of Ministral 8B. Gemma 4 12B/31B remain parked per ADR-046 — this does not change the RAM-tieredrecommended_model_id_for(Gemma4)behavior for those tiers.Follow-up (not blocking)
ministral-3b-q4kmstall this issue started as is no longer being pursued — Ministral is being phased out as the native default, not fixed. If needed later, the investigation notes upstream in this issue's original body are still valid starting points.llama-cpp-2crate bump (0.1.146 -> 0.1.151) was attempted and reverted: newer releases removedapply_chat_template_oaicompat/theopenaimodule our Gemma 4 chat-template code depends on. Tracked separately.Align CLI + SKILL.md with local-agent capability and guidance (#1529)…
Adopt Gemma 4 E4B as the locked native model, replacing Ministral 8B (c…
Adopt Gemma 4 E4B as the locked native model (supersedes ADR-046's Mi…