Skip to content

Chat 'what schemas do we have' still fails, plus two skill-retrieval misses on plain requests (type listing, 'start tracking', single-instance add) #3268

Closed

Description

@malibio

Problem

"What schemas do we have here?" in the local AI chat (model gemma-4-E4B-it Q4_K_M, fresh DB with the Spec-driven playbook installed) replies:

⚠️ node search encountered an error. Please try again or check the details and retry.

Trace (daemon log, 20:03:26–20:04:01)

  1. find_skills "list schemas available" → Schema Creation 0.877, Spec-driven Workspace 0.786, Research & Search 0.781.
  2. Call 1 — malformed arguments. search_nodes received {"direction":false,"query=\"\",node_type=\"schema\",limit=50,sorting=[{\"field\"":null} → unknown field 'direction', expected one of query, node_type, filters, sorting, limit. The model emitted kwargs-style arguments (query="",node_type="schema",limit=50,sorting=[{field…,direction:false}]) and the tool-call capture collapsed them into one bogus key, apparently breaking on the nested sorting array-of-objects.
  3. Call 2 — prose inside the arguments. The model put its answer text ("I found a few schemas in your workspace. The available ones are 'plan', and 'spec'…") inside the tool call's arguments → rejected again.
  4. Final prose was wrong anyway: "The available ones are 'plan' and 'spec'", but the DB has 21 schemas. The routing decision's schema candidates were ["plan","spec"], i.e. the workspace context apparently lists only non-core types, so the model thinks those are all there is.
  5. The "tool failures not surfaced in model response" safety net replaced the ungrounded answer with the generic error. Blocking it was right, but the message gives the user nothing to act on.

Acceptance criteria

  • Reproduce the arg capture for gemma-4-E4B with a nested array-of-objects argument (sorting: [{field, direction}]); fix the tool-call parsing (nlp-engine chat / grammar path) so the arguments arrive intact, or constrain the grammar so the model can't emit that shape. Add a parser test with this exact output
  • A tool call whose "arguments" are prose is detected as a malformed call (re-prompted, not dispatched as field names)
  • "What schemas/types do we have?" returns every schema: core types (task, person, project, skill, …) as well as user/playbook types. Either the workspace context names them or the agent is steered to search_nodes node_type=schema (or a dedicated schema-listing tool)
  • When the safety net replaces a reply, the message says what failed in plain terms (e.g. "I couldn't run the search: the tool call was malformed") rather than a generic retry prompt
  • eval:decisions (or a golden) covering "what schemas do we have" on the default local model

Folded in: three eval failures left after #3500

Measured on main after #3504 (gemma-4-e4b-q4km, --runs 3, database purged and daemon restarted between reps). The decision fixture now seeds its workspace before every chat and has no setup turns, so each of these is the first turn of a clean chat.

1. outcome-list-types (eval:decisions), 0/3. "What schemas do we have here?" routes as a lookup, Research & Search leads, search_nodes succeeds, and the reply is replaced by the confirm-first stand-in ("I'd like to help with that. Could you confirm what you'd like me to do?…"), which the agent substitutes for a reply it suppresses when nothing was written. This scenario passed after #3482; it is the listing failure in a new shape.

2. indirect-schema-freelance (eval:routing), 0/3. "start tracking our planning cycles" retrieves Graph Editing / Relationship Management / Node Creation, not Schema Creation, and create_node fails twice. Same shape as #1912 (a "start tracking" request missing Schema Creation), which was closed as fixed. Also failed in the one-rep run before #3504.

3. skill-instance-request (eval:decisions), 0/3. "Add Contoso Ltd to the companies we sell to." leads with Bulk Import on a near-tie: Bulk Import 0.742, Organization 0.741, Node Creation 0.737. The turn still calls create_node and creates the record; the scenario fails on the skill decision. With the two setup turns the fixture used to put ahead of every scenario, the tie went to Organization and it passed 3/3, so the setup history was hiding it.

  • outcome-list-types passes 3/3 in a full eval:decisions run: a listing turn whose search succeeded is not replaced by the confirm-first stand-in
  • indirect-schema-freelance passes 3/3 in a full eval:routing run, or its expectation is changed with the reason recorded in the fixture
  • skill-instance-request passes 3/3 in a full eval:decisions run: a single-instance request on an existing type does not lead with Bulk Import, or the scenario's expectation is changed with the reason recorded (the turn's write is correct; only the skill decision misses)

Activity

  1. added
    bug
    on Sep 28, 2026
  2. malibio commented on Oct 1, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 298 test files passed, 5510 tests passed (90.57s)

  3. self-assigned this
    on Oct 1, 2026
  4. malibio commented on Oct 1, 2026

    @malibio
    CollaboratorAuthor

    PR #3463 covers criteria 1, 2 and 4. Two stay open:

    Criterion 3 — "returns every schema" is partly met.

    • The turn now calls search_nodes with node_type='schema' (3 of 3 on each of two test databases; 0 of 3 before), and the result holds every type, built-in and custom, each with a title.
    • The reply does not reliably name them all. On current main the model listed every type on one test database and wrote "…and several built-in types like text, task, date, etc." on another. Those readings were taken with a description clause that review later removed; they have not been re-taken.
    • "What types do we have?" still draws one Stage-1 clarifying question before the search runs.

    Criterion 5 — the eval scenario exists but has no score.

    • outcome-list-types in eval:decisions scores the reply naming built-in and custom types off a successful search.
    • In both reps attempted its group was excluded: the setup-venue turn declined to re-create a type that already existed, and the runner drops every scenario after a setup turn that calls no tool. Four of twelve groups were excluded that way in the one clean rep.

    What would close them: a reading of outcome-list-types on the default model once its group runs (which needs the setup-turn exclusion looked at), and whatever that reading shows is needed for the reply to enumerate.

  5. added a commit that references this issue on Oct 1, 2026
    b292776
  6. reopened this on Oct 1, 2026
  7. malibio commented on Oct 1, 2026

    @malibio
    CollaboratorAuthor

    Two smaller follow-ups from PR #3463, recorded here so they are not only in the PR thread:

    • Stop at the close marker only once a call has started. Generation currently stops at <tool_call|> wherever it appears on a Gemma 4 turn (ends_gemma4_tool_call in packages/nlp-engine/src/chat/mod.rs). A prose reply that samples the marker with no call open is cut off there. Review suggested gating the stop on a call having started; it was not applied because the only test of that wiring is a live-model one (toolcall_json_shape, --run-ignored only) and the GPU was in use. It needs that run to verify.
    • Point the llama-cpp-2 pin at the upgrade checklist. The comment on the pin in packages/nlp-engine/Cargo.toml names the live tests but not the "When the binding is upgraded" section of ADR-056, which now holds the full procedure.
  8. malibio commented on Oct 1, 2026

    @malibio
    CollaboratorAuthor

    Resuming for criteria 3 and 5. Frontend baseline: 301 test files passed, 5560 tests passed (85.98s)

  9. malibio commented on Oct 1, 2026

    @malibio
    CollaboratorAuthor

    PR #3482 is merged. Status of the two criteria it was for:

    Criterion 5 — met. outcome-list-types now gets scored: one rep of eval:decisions on gemma-4-e4b-q4km scored all 12 scenarios (4 of 12 were excluded before) and the scenario passed. The exclusion came from setup turns that rightly created nothing because their type already existed; a group is now scored when such a turn did nothing and the type is present.

    Criterion 3 — met for "What schemas do we have?", not for "What types do we have?".

    • "What schemas do we have here?" names every type: 3 of 3 test workspaces, 0 of 3 before. The search rows no longer carry empty fields, and a turn-end backstop appends any types a listing reply leaves out.
    • "What types do we have?" and "which types exist in this workspace" still draw one Stage-1 clarifying question; answering it lists every type. Prose in the Stage-1 prompt did not change that. A seeded "Types & Schemas" skill did (3 of 3 phrasings), but with it one rep of eval:routing went from 18 of 19 to 16 of 19, so it is not seeded.

    What is left, if the "types" wording is to route without a question: a skill title and description tuned against multi-rep routing and decisions evals. The measurements are in ADR-064's 2026-10-02 amendment.

    Also still open from the earlier comment: gating the close-marker stop on an open call, and pointing the llama-cpp-2 pin's comment at the ADR-056 upgrade section.

  10. changed the title [-]Chat 'what schemas do we have': Gemma 4 E4B tool-call arguments mangled, prose sent as arguments, and only playbook types listed[/-] [+]Chat 'what schemas do we have' still fails, plus two skill-retrieval misses on plain requests (type listing, 'start tracking', single-instance add)[/+] on Oct 3, 2026
  11. malibio commented on Oct 3, 2026

    @malibio
    CollaboratorAuthor

    Folded in three eval failures that remained after #3504 (see the new section and its three acceptance criteria in the description): outcome-list-types now fails 0/3 because a successful listing is replaced by the confirm-first stand-in; indirect-schema-freelance ("start tracking our planning cycles") misses Schema Creation, the same shape as #1912; and skill-instance-request leads with Bulk Import on a 0.742/0.741 retrieval tie that the old setup turns had been tipping. Full numbers: #3500 (comment)

  12. malibio commented on Oct 3, 2026

    @malibio
    CollaboratorAuthor

    Baseline for the remaining acceptance criteria (worktree issue-3268-listing-and-skill-misses, main at b1d0e28). Frontend: 309 test files passed, 5606 tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-agentsbugnlp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions