Repository navigation
Closed
Description
Context
NodeSpace has three inference paths:
- Local (llama.cpp / GGUF) — we control the prompt format, parser, and tool-call template end-to-end
- Ollama — user's own running instance, any model available locally
- OpenAI-compatible — user-supplied API key + base URL (any provider)
After matrix testing, only Ministral 8B achieves 12/12 on the agent tool-call matrix via the llama.cpp path. All other tested models fail.
Decision
- Local path: expose only Ministral 8B (
ministral-8b-q4km). No model picker — single download action. On machines with <16 GB RAM, show it greyed out with an explanation (not hidden). - Ollama path: auto-detected at
localhost:11434; open model list from running instance. - OpenAI-compatible path: fully manual; user-created named configs.
UI: Model Picker Dropdown
Replaces the current two-step provider → model flow. Single dropdown in the AIChatNode header:
Local
Ministral 8B [download needed] ← selectable; badge gone once downloaded
← greyed out + explanation if <16 GB RAM
Ollama (not running) ← greyed out header if not auto-detected
Qwen 2.5 7B ← selectable; shown only if Ollama running
Gemma 3 12B
Mistral 7B
─────────────────────────────────────
My Anthropic Key ← user-named OpenAI-compat configs (selectable)
Work GPT-4
─────────────────────────────────────
Set up... ← opens Settings → AI Models tab in new app tab
Conversation lifecycle:
- Model is per-AIChatNode; chosen before or at first message
- Once first message is sent, dropdown becomes read-only (shows active model, no switching)
- New conversations inherit the user's "default model" setting (configured in Settings)
Download flow (Local, first use):
- Selecting Ministral 8B and sending → download starts automatically
- Modal with progress bar appears during download
- On completion, the message sends automatically
Low-RAM machines (<16 GB):
- Local section is visible but greyed out
- Tooltip/label explains: "Requires 16 GB RAM — use Ollama or an external provider"
- Ollama and OpenAI-compatible remain available
Settings → AI Models (revamp)
Local
- Shows Ministral 8B: status (Not downloaded / Downloading / Ready), download button, delete button, download progress bar
- No other GGUF models exposed in this UI (catalog entries for other models remain in Rust for dev/CLI but are hidden from the frontend)
Ollama
- If running: shows connection status ("Running at localhost:11434") and a read-only list of detected models
- If not detected: shows a clickable link to https://ollama.com/ — no further setup instructions
OpenAI-compatible
- Add / edit / remove named provider configs: Name, Base URL, API key
- Each saved config appears as a selectable entry in the model picker
Default Model
- Dropdown of all currently available models (same list as the picker)
- Saved as the app-wide default for new AIChatNodes
Acceptance Criteria
- Model picker dropdown replaces two-step provider → model flow in AIChatNode header
- Local section shows only Ministral 8B; greyed out with explanation on <16 GB RAM machines
-
recommended_model_id()returnsministral-8b-q4kmas the llama.cpp default - Ollama auto-detected at
localhost:11434; section greyed out ("Ollama (not running)") if not detected - Ollama model list fetched live from running instance when dropdown opens
- OpenAI-compatible named configs: add/edit/remove in Settings → AI Models
- Named configs appear as selectable entries in the model picker
- "Set up..." entry at bottom of picker opens Settings → AI Models tab in a new app tab
- Model is locked per-AIChatNode after first message is sent (picker becomes read-only)
- Default model setting in Settings → AI Models; new AIChatNodes inherit it
- Download modal with progress bar when selecting an undownloaded local model and sending
- Settings → AI Models: Local section with download/delete/progress for Ministral 8B only
- Settings → AI Models: Ollama section shows running status + model list, or a clickable link to ollama.com if not detected
- Non-Ministral catalog entries hidden from frontend (may remain in Rust for dev/CLI)
- Matrix score remains 12/12 after changes (no prompt regressions)
Activity
malibio commentedon Jun 7, 2026
Code Review — Ministral 8B 12/12 Fix (commits 7853c0f + 0b8e927)
Review Type: Initial Review
Commits reviewed:
7853c0f5+0b8e9273(HEAD)Reviewer: Principal Engineer AI Reviewer
Summary
This changeset is a net positive and demonstrates disciplined, targeted problem-solving: a real behavioral regression (schema-creation retry loops, invisible freshly-created types) was diagnosed empirically via matrix testing, and fixed with minimum-viable targeted changes across five files. The guidance rules are logically sound, the context-injection timing fix is correct, and the filter coercion handles the model-output mismatch cleanly. The snake_case schema ID change is the appropriate greenfield call per CLAUDE.md.
Recommendation: APPROVE with two improvements that should be addressed before the next feature build on top of this work.
Findings
Important Issues
[Improvement]
_historyparameter is unused — dead parameter inbuild_workspace_contextsignatureFile:
packages/daemon/src/services/local_agent_service.rs, functionbuild_workspace_context(line ~1195)The parameter was introduced with the commit message "Pass prior_history to build_workspace_context before session creation so context is available from turn one", but the function signature receives
_history: &[ChatMessage]and the body never reads it. The actual fix — callingbuild_workspace_contextbeforecreate_session— was the meaningful change and that part is correct. However the dead parameter is a CLAUDE.md violation (#[allow(dead_code)]equivalent in parameter form, which the project policy says to remove). If history-aware context retrieval is planned (e.g., extracting the last user turn from history instead of passinguser_messageseparately), the parameter should be used now or removed entirely.Concrete action: Remove
_history: &[ChatMessage]from the signature and the call site, or implement the intent (extract query from history tail whenqueryisNone).[Improvement] Tool schema/struct contract mismatch on
filtersFiles:
packages/agent/src/local_agent/tools.rsline ~214,packages/core/src/agent_params.rsline 30The
filtersfield indef_search_nodes()still declares"additionalProperties": { "type": "string" }in the JSON Schema exposed to the model, whileSearchNodesParams.filterswas widened toHashMap<String, Value>. The tool schema is what the model uses to decide which JSON types to emit in its tool call. Since the schema says string-only, a well-behaved model will continue to wrap numbers in quotes — defeating the purpose of the coercion on the Rust side.The update description says "Always pass values as strings" in the tool description text, which is internally contradictory with the coercion code whose entire rationale is that models pass numeric
Values. The right resolution depends on intent:additionalPropertiesshould also be widened to{}or{"oneOf": [{"type": "string"}, {"type": "number"}]}to remove the contradiction.The existing test at line ~1856 only validates string deserialization. Add a test case with
{"amount": 500}(integer) to verify the coercion path executes correctly end-to-end.Suggestions
[Suggestion] Similarity threshold at 0.2 needs a workspace-scale safety valve
File:
packages/core/src/ops/context_ops.rs, constantsSCHEMA_SIMILARITY_THRESHOLD/MAX_SEMANTIC_SCHEMASThe rationale for dropping from 0.4 to 0.2 is well-documented and empirically motivated (action-oriented phrasing produces noisier embeddings). The
MAX_SEMANTIC_SCHEMAS = 5cap is a reasonable guard. However the cap applies to the semantic search results only; the debounce-bypass loop inlocal_agent_service.rs(line ~1215) appends all schemas created in the last 5 minutes without a cap. In a session where a user rapidly creates several schemas (a batch-import script, for example), every schema created in the last 5 minutes will be injected into the next turn regardless of relevance. This could push the ENTITY TYPES section well past the 4000-char budget thatformat_for_promptattempts to enforce (since the budget check happens on the formatted string, not on the count of injected schemas).Consider limiting the debounce-bypass injection to
MAX_SEMANTIC_SCHEMAS - context.relevant_schemas.len()additional schemas (i.e., fill the remaining budget).[Suggestion] Script has hardcoded absolute paths and no daemon-ready health check
File:
scripts/run-nemo-vs-8b-matrix.sh, lines 6-11 and 42-49REPO,NS_BIN, andNODESPACEDare hardcoded to/Users/malibio/.... Any other developer or CI runner will silently fail with a "no such file" error.The daemon-ready check at line 42 waits for the socket file to appear then adds a fixed
sleep 1. This is a TOCTOU race: the socket can appear before seed-node insertion completes, so thesleep 1is a latency guess. A more reliable check would be to attempt a lightweight RPC (e.g.,$NS_BIN --socket "$SOCK" status) and retry until it succeeds, or to check for a "seeding complete" log line.These are dev-only scripts, so neither is blocking, but they limit shareability and can produce flaky matrix runs.
Nitpicks
Nit:
packages/agent/src/local_agent/model_manager.rs—MINISTRAL_14Bdocstring says "Mistral's mid-tier edge model" andnameis"Ministral 3 14B Instruct Q4_K_M". The "3" in the name looks like a copy-paste artifact from the 3B/8B family naming; the actual model line is "Ministral-3-*" (where 3 is the series, not the size), but the display name with "3 14B" reads oddly. Worth verifying the canonical Mistral naming before this entry is promoted.Nit:
SCHEMA_CREATION_RULESandTOOL_STRATEGY_RULESare now long single-line strings with\n\continuation. They are correct and readable in source, but the guidance duplication betweenagent_guidance.rsandskill_pipeline.rs(noted in the#1089comment) has grown larger with this commit (SCHEMA SUCCESS/FAILURE appears in both). The existing tracking issue covers this — just flagging that the divergence increased.Nit:
packages/agent/src/local_agent/tools.rstest at line ~1866 —filters.get("status").map(|s| s.as_str())now returnsOption<Option<&str>>becauseValue::as_str()returnsOption<&str>. The assertionSome(Some("open"))is correct and the compiler accepted it, but the ergonomics are a signal that a typedHashMap<String, String>test helper or a direct.and_then(|v| v.as_str())chain would make future tests less surprising.Areas of Strength
build_workspace_contextbeforecreate_sessionensures the schema context is set before the first turn processes, with no race condition (both calls are sequentialawaiton the same task).normalize_schema_id, tests in bothschema/mod.rsandnode_service/mod.rs, thecreate_schematool description, and the model guidance all agree on the new format. The greenfield stance (CLAUDE.md) makes this unambiguously safe.prompt_assembler.rs— replacing the hardcoded expected string withformat!("{}\n\n{}", SCHEMA_CREATION_RULES, TOOL_STRATEGY_RULES)is the correct fix and eliminates the drift risk that caused the test to be stale in the first place.Address review: dead param, filters schema mismatch, debounce cap, st…
malibio commentedon Jun 7, 2026
Review Findings Addressed
All 🟡 Important findings and the 🟢 debounce cap suggestion addressed in commit
0060b9ce.✅ Addressed
Dead
_historyparameter — removed frombuild_workspace_contextsignature and call site. The meaningful fix (calling context build beforecreate_session) was already correct; the dead parameter was the only artifact.filters JSON schema/struct mismatch — widened
additionalPropertiesfrom{type: string}to{oneOf: [string, number]}so the tool schema matches what the Rust struct accepts. Updated description from "Always pass values as strings" (contradicted the coercion code) to "String and numeric values are both accepted." Added testsearch_nodes_params_filters_numeric_value_coercedverifying integer deserialization.Debounce-bypass schema cap — limited recent-schema injection to
MAX_SCHEMAS - len(existing)remaining slots. Previously unbounded; now capped to 5 total regardless of batch creation volume.Stale test needles — updated two assertions that referenced removed phrases:
"ALWAYS search first"→"ALWAYS search_nodes first","NEVER use placeholder IDs"→"NEVER CLAIM ACTION WITHOUT TOOL RESULT". Updated catalog count10→12.⏭️ Skipped
Matrix script hardcoded paths — dev-only tooling, not shipped. Low priority vs. current work.
MINISTRAL_14B display name "3 14B" — needs canonical Mistral naming verification before changing; tracked in this issue.
Double-
Optiontest ergonomics — cosmetic, compiler-verified correct, deferred.Guidance duplication between agent_guidance.rs and skill_pipeline.rs — pre-existing issue tracked under #1089.
malibio commentedon Jun 8, 2026
Frontend baseline: 134 files, 3844 tests passed
Address review: dead param, filters schema mismatch, debounce cap, st…
Lock llama.cpp path to Ministral 8B only; expose Ollama + OpenAI-comp…
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…