Repository navigation
Add Ornith 1.0 to model catalog (catalog entry, think-block routing, update_node prompt) - #1467
Conversation
Adds the three remaining production tasks identified by the #1464 evaluation: a catalog entry for Ornith 1.0 9B (ModelFamily::Qwen35, same OAI-compat Jinja path as Gemma 4), an XML `<tool_call>` parser (Format D) wired into emit_oai_delta so Ornith's tool calls surface as uniform ToolCallStart/ToolCallArgs chunks instead of leaking as plain text, and a `<think>`/`</think>` routing path (ThinkSplitter, mirroring Gemma 4's ChannelSplitter) so Ornith's reasoning emits as ChatChunk::Reasoning. Also fixes the update_node tool description with concrete example values so Ornith calls it directly instead of asking for clarification. Co-Authored-By: Claude <[email protected]>
Code Review SummaryReview Type: Initial Review (no prior reviews/comments found on PR #1467) Net positive change. This is a well-scoped, additive PR: one new catalog entry, one new tool-call format parser mirroring the existing three, one new reasoning splitter mirroring the existing Requirements Check (issue #1465)
Findings🟡 Important1. PR description doesn't disclose the undone smoke-test acceptance criterion The PR body is just Recommendation: Update the PR description to explicitly list which acceptance criteria are code-verified (unit tests) vs. which require a manual follow-up smoke test before/after merge, e.g.: "Smoke test (load Ornith 9B, live tool-calling prompt) not run in this PR — requires manual local verification with the model downloaded; tracked as a follow-up before promoting past trial status." 2. let (channel_answer, final_reasoning) = channel_splitter.finalize();
let (final_answer, final_think_reasoning) = think_splitter.finalize();
let final_answer = channel_answer + &final_answer;In the streaming path ( This is a genuine edge case (requires generation to be truncated at a very specific byte boundary), not a regression for typical completions, and the concatenation order itself ( Recommendation: Either (a) route let (channel_answer, final_reasoning) = channel_splitter.finalize();
let (think_answer, think_reasoning) = think_splitter.push(&channel_answer);
let (carry_answer, carry_reasoning) = think_splitter.finalize();
let final_answer = think_answer + &carry_answer;
let final_think_reasoning = think_reasoning + &carry_reasoning;Principle: When composing two stateful, order-dependent parsers, the finalize/flush path must preserve the same data-flow ordering as the steady-state path, or the two can diverge exactly at end-of-stream — the boundary condition most likely to matter for truncated/long generations. 3. No test exercises the combined All new tests exercise Recommendation: Add a test that feeds 🟢 Suggestions4. Ornith's empty- sha256: "", // Populate before promoting past user-selectable trial statusThe struct-level doc comment (lines 47-54) states the empty-string policy is reserved for "official, tamper-evident" repos (
Ornith's comment omits the "third-party repo" qualifier that its siblings all state, even though the behavior (empty hash, trial-only, "populate before promoting") is consistent with the documented policy exception pattern — it's just less self-documenting than its neighbors. Not a defect (no verification is silently skipped for an entry masquerading as official), but worth tightening for consistency and to avoid a future reader mistaking the terse comment for an implicit "this is an official repo." Recommendation: Nit: Nit: The SecurityNo concerns. No user input is parsed here in a security-sensitive way — PerformanceNo concerns. Both parsers operate on already-materialized strings via TestingStrong coverage for the new parser (7/5 requested cases) and for DocumentationGood: module-level doc comment in Recommendation: COMMENTThis is a net-positive, well-tested, narrowly-scoped change that correctly implements 5 of 6 acceptance criteria in code, with the 6th (smoke test) being a reasonable manual/deferred item — the only real issue is that this deferral isn't disclosed in the PR description. None of the findings are blockers: the |
malibio
left a comment
There was a problem hiding this comment.
Review posted above. Recommendation: COMMENT (net positive, no blockers). See full report in PR comments for the important/suggestion-level findings on ThinkSplitter finalize-path edge case, missing combined-splitter test, PR description gap on the smoke-test criterion, and the sha256 comment wording.
… finalize The finalize path emitted ChannelSplitter's leftover carry (e.g. a truncated "<thi" fragment) straight to the answer/reasoning sinks without passing it through ThinkSplitter first, unlike the streaming push path where content always flows channel_splitter -> think_splitter. A <think> marker truncated by the token cap at the same moment ChannelSplitter held an unresolved partial marker could have leaked into the visible answer. Fixed and added a regression test exercising the combined finalize path. Also clarifies the Ornith catalog entry's sha256 comment to call out DeepReinforce as a non-official repo requiring a hash before promotion, matching the stated policy. Addresses reviewer feedback from PR #1467 (skipped: index-arithmetic naming nit in parse_xml_tool_call_block — code is already covered by 7 passing unit tests, not worth the churn; context_window/temperature values match the sibling QWEN35_9B entry's conventions, no action needed). Co-Authored-By: Claude <[email protected]>
Addressed review feedbackImportant:
Suggestion:
Skipped:
All tests re-verified after these changes: Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The changes are a targeted bugfix (routing carry through an existing, already-tested splitter) plus a regression test, a documentation-only comment clarification, and a PR description update. No new architecture, no new external behavior beyond fixing the described edge case. Low risk, straightforward to verify from the diff. |
- Corrects the Ornith catalog entry's HuggingFace URL: the org name/casing was wrong (DeepReinforce vs. the real deepreinforce-ai), causing every download attempt to 401. Verified the corrected URL resolves and fixed the file size to the exact byte count. - Widens the desktop-app allowlist and frontend ModelFamily type/filters so Ornith (and any future qwen35-family model) can actually appear and be downloaded/selected in Settings > AI Models, alongside Ministral. - Fixes a real bug found via live testing: Ornith's tail-inference path (used after the ReAct loop's duplicate-tool-call guard breaks out) had no stripper for Ornith's leaked <tool_call> XML or its <|mask_end|> special token, so malformed raw model output was being persisted verbatim as the assistant's chat message. Added strip_ornith_tool_call_leak (mirrors the existing Gemma <|channel> stripper) with regression tests using the exact real transcript content that reproduced the bug. Also fixes a related gap where an empty-after-stripping response would have persisted an empty assistant bubble instead of falling back to a tool-result summary. - Corrects the catalog entry's doc comment: the #1464 evaluation's "later turns won't slow down" claim was an extrapolation from single-shot decode benchmarks, not a measured result for multi-iteration ReAct loops. Ornith's recurrent (SSM) layers cannot do partial KV-cache reuse (confirmed both in our logs and upstream: ggml-org/llama.cpp issues #19858, #20003, #20153, #20225, #21912 — an open, unresolved limitation affecting all Qwen 3.5-based hybrid models), so every ReAct iteration re-decodes the entire growing prompt from scratch. A 4-iteration turn took ~108s in practice. Added a visible warning in the Settings model card so this is disclosed before a user selects it, rather than discovered mid-conversation. Co-Authored-By: Claude <[email protected]>
Code Review Summary — Re-Review of commit bb7f842 (3rd round)Scope: This review covers only the newest commit, Net positive. This commit fixes a real, verified-broken download URL, closes a real leaked-output bug reproduced against a live transcript, corrects a factual overclaim in a doc comment, and does the minimal wiring needed to expose Ornith in the UI with an appropriate risk disclosure. All four sub-changes are cohesive under a single theme ("make Ornith actually usable end-to-end and honest about its limitations") — not unrelated bundling, given they were all discovered in the same live-testing pass. Independent Verification Performed
Test & Lint Results (run independently, not trusted from the diff)
FindingsCritical IssuesNone. Suggested Improvements1. If a response were 2. Live-model verification is explicitly deferred, not yet done Per the task instructions, this fix has only been validated against captured/replayed transcript text in unit tests, not against a live Ornith inference run reproducing the original leak end-to-end. This is a reasonable and disclosed sequencing choice (unit tests against exact repro text give high confidence), but it should remain an open item until confirmed live — flagging per the author's own stated plan to do this next, not as something blocking this commit's quality. Nitpicks
SecurityNo concerns. The PerformanceNo concerns. Regex is linear-time and non-catastrophic (verified above). The TestingAdequate for a text-transform bugfix: 3 new unit tests cover whole-block, dangling-block+stray-token, and block-with-surrounding-text — the three realistic shapes of the leak. Verified independently (see above) that the regex/truncation/replace pipeline produces the asserted outputs by hand-tracing, not just trusting the assertions. The one acknowledged gap (live-model end-to-end verification) is explicitly called out by the author as a deferred next step, not silently skipped. DocumentationThe rewritten Recommendation: COMMENTNet-positive, well-verified fix-up commit. All claims I could independently check (HF URL/byte count, KV-cache log string, eval methodology, regex safety, fallback-pattern parity, family-filter scoping) held up under direct verification — this is unusually well-substantiated for a commit message. No blockers. The two "Suggested Improvements" are optional polish (a defensive comment, and an explicit "verify live" follow-up already on the author's own roadmap), not required before merge. As with the prior two rounds, I'm not self-approving since this PR was authored through the same agent-driven workflow as this review — the merge call remains the user's. |
malibio
left a comment
There was a problem hiding this comment.
Re-review of commit bb7f842 (round 3): Net positive, no blockers. Independently verified the HF URL fix (curl HEAD matches new byte count exactly), the KV-cache log string, the eval methodology claim in ornith_eval.rs, regex ReDoS-safety, and fallback-pattern parity in agent_loop.rs. All 251 nodespace-agent tests pass (incl. 3 new), clippy clean, desktop-app quality:check clean. Full findings in PR comment above. Not self-approving (same agent-driven workflow) — merge call is the user's.
- response_processing.rs: adds a one-line comment explaining why a dangling <tool_call> opener is safely truncated as trailing-only (truncation always happens at generation's end, so there's never legitimate prose after it). - model_manager.rs: notes the ORNITH_1_9B doc comment's upstream llama.cpp issue citations reflect state as of 2026-07-01 and aren't self-updating — flags that a future reader should re-check those issues before assuming the KV-cache limitation still applies to a newer vendored llama.cpp. Also live-tested the strip_ornith_tool_call_leak fix against the running daemon: loaded Ornith via `nodespace model load`, ran two real conversation turns through scripts/aichat.ts (a successful multi-tool turn, and a tool-failure-recovery turn), and confirmed via `aichat.ts show` that the persisted messages are clean — no raw <tool_call>/<|mask_end|> leakage in either case. Neither run happened to hit the exact duplicate-tool-call-loop tail-inference branch the fix targets (Ornith self-corrected within normal iterations both times rather than looping), so this is strong but not exhaustive live confirmation — combined with the 3 unit tests reproducing the original captured leak text and the reviewer's independent hand-trace of the strip logic, this is sufficient confidence to consider the fix verified, but noting the caveat rather than overclaiming full coverage. Addresses reviewer feedback from PR #1467, 3rd review round. Co-Authored-By: Claude <[email protected]>
Addressed review feedback (3rd round)Both suggested improvements addressed:
Live verification (the explicitly-flagged open item)Ran two real conversation turns against the running daemon with Ornith loaded (
Inspected persisted content directly via Caveat, stated plainly: neither run happened to trigger the exact duplicate-tool-call-loop → tail-inference branch the fix specifically targets (Ornith self-corrected within normal ReAct iterations both times rather than looping into that code path). So this is strong supporting evidence, not an exhaustive reproduction of the original failure mode. Combined with the 3 unit tests built from the exact real leaked transcript text, and the reviewer's independent hand-trace of the strip/truncate/replace logic, I'm confident in the fix — but flagging the live-repro gap rather than claiming it's fully closed. Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: Both changes are documentation-only (comments), no logic changes. The live-verification work confirms (but doesn't newly risk) the already-reviewed fix. |
Removes ornith-1-9b-q4km from EXPOSED_GGUF_MODEL_IDS. All backend plumbing (catalog entry, download, tool-call parsing, response-leak fix) stays merged and functional — this only controls whether it appears in the Settings > AI Models picker. Tracked for re-enablement in #1477. Co-Authored-By: Claude <[email protected]>
Unrelated to this branch's Ornith work — origin/main itself currently fails `cargo clippy -D warnings` after #1469 merged (an overindented doc comment and two clippy::trim_split_whitespace lints). Fixed here since merging main into this branch surfaced them and blocked quality:fix. - Doc comment: reindent wrapped continuation lines to 7 spaces (clippy's doc_overindented_list_items). - Remove redundant .trim() before .split_whitespace() (the latter already ignores leading/trailing whitespace) in two identical exe_check closures. No logic changes. Co-Authored-By: Claude <[email protected]>
Code Review SummaryScope: 4th re-review, covering only the three commits since round 3 ( Net positive, no blockers. This round is entirely housekeeping around the already-approved Ornith work: a product decision to withhold the feature from users pending a known performance issue, a routine FindingsCritical IssuesNone found. Suggested ImprovementsNone. NitpicksNit: Nit: Verification
|
malibio
left a comment
There was a problem hiding this comment.
4th re-review of commits since round 3 (933250f hide-Ornith, merge from main incl. PR #1469, 4b906bf pre-existing clippy fix). Net positive, no blockers. Verified zero leftover conflict markers workspace-wide, Ornith fixes from prior rounds survived the merge intact, the .trim()/split_whitespace and doc-comment reindent changes are behavior-neutral (reasoned + empirically checked). clippy clean, nodespace-agent 251/251, nodespace-app 30/30, quality:check clean. One forward-looking nitpick about dual-gating fragility in the frontend qwen35 filters (pre-existing, not new). Full report in PR comment above.
Closes #1465
Summary
ornith-1-9b-q4kmcatalog entry (ModelFamily::Qwen35, same OAI-compat Jinja path as Gemma 4/Qwen3.5)<tool_call>parser (parse_tool_calls_xml/parse_xml_tool_call_block) wired intoemit_oai_delta, with unit tests for single/multiple calls, unclosed tags, and empty parameter bodiesThinkSplitter(mirrors the existing Gemma 4ChannelSplitter) to route<think>...</think>content asChatChunk::Reasoninginstead of leaking into the answer streamupdate_nodetool description/schema with concrete example values so Ornith calls it directly instead of asking for clarification (the Evaluate Ornith 1.0 as native local model for mode 2a #1464 evaluation's 2/10 tool-call misses)Test plan
cargo test -p nodespace-nlp-engine --lib --features chat-service(chat module: 90/90 passing, includes new XML parser + ThinkSplitter + combined-finalize-path tests)cargo test -p nodespace-agent --lib(248/248 passing, includes updated catalog-count test)cargo test -p nodespace-core --lib(965/965 passing, unaffected)bun run test:all(frontend 3893/3893, skill 17/17, rust core 965/965 — no new failures vs. baseline)bun run quality:fixclean (eslint, tsc, cargo fmt, cargo clippy -D warnings)<think>routing logic were validated against real Ornith outputs captured during the Evaluate Ornith 1.0 as native local model for mode 2a #1464 evaluation (../nodespace-nlp-experiment, 8/10 tool calls,<think>blocks confirmed present) and are covered by unit tests reproducing those exact formats, but an end-to-end live-model smoke test has not been run in this PR and should be done manually before Ornith is broadly recommended.Co-Authored-By: Claude [email protected]