Skip to content

Node Deletion skill is retrieved for creation and query requests, scoping away create_node #2240

Closed

Description

@malibio

Summary

The Node Deletion skill is retrieved as a Stage-2 candidate for requests that contain no deletion intent — including pure creation and query requests. When it ranks first, Stage-2 scopes the turn's tool surface to its tool_whitelist (delete_node, get_node, search_semantic, search_nodes), so create_node is not offered at all and the turn cannot perform the write the user asked for.

Found while evaluating models for #2239. It is model-independent — it reproduces across Gemma 4 E4B (native GGUF), Ornith 1.5 9B and Laguna-XS 2.1 (both served) — so it is a retrieval defect, not a model defect.

Reproduction

Prompt (scenario 8c of the agent-matrix fixture), sent to a chat where a decision type and a planning-cycle type were both created successfully in the two preceding turns:

Put down that we went with event-based cache clearing, Priya's call

Observed on the Laguna-XS run:

routedSkills:  Node Deletion, Bulk Import, Research & Search
toolsOffered:  search_nodes, search_semantic, get_node, delete_node, create_nodes_from_markdown
reply:         "I'd like to help with that. Could you confirm what you'd like me to do?
                I want to make sure I take the right action."

The model asked for clarification rather than acting, which is the correct response to being offered delete/search tools for a "put down that we decided X" request. It had no create_node to call.

The same turn on every other run routed to Node Creation and was offered create_node:

run rank-1 skill create_node offered scored
E4B rep1 Node Creation yes pass
E4B rep2 Node Creation yes pass
E4B rep3 Node Creation yes pass
Ornith 1.5 rep1 Node Creation yes fail (unrelated: write rejected)
Laguna-XS rep1 Node Deletion no fail (unreachable)

Not an isolated turn

Counting how often Node Deletion appears anywhere in the retrieved candidate set, across 6 runs (3 models) of the same fixture:

scenario   runs where Node Deletion was a candidate
6          4 runs          "The five-day one got signed off — mark it that way"
11d        4 runs   [rank-1 in 1]   "What did we settle on that the rebuild has to respect?"
7          1 run    [rank-1 in 1]
8c         1 run    [rank-1 in 1]   "Put down that we went with event-based cache clearing…"
10b        1 run          "Set that task's due date to 6 August 2026"

11 turns across 5 scenarios, rank-1 three times. None of these prompts asks to remove anything — they are marking a status, recording a decision, setting a due date, and asking a question. Scenario 11d is a pure read ("What did we settle on…") and still pulls Node Deletion into its candidate set in 4 of 6 runs.

Why this is worse than a ranking nit

Stage-2 does not merely bias the model toward the retrieved skill — it scopes the tool surface to the skill's whitelist. A retrieval miss therefore removes the needed tool outright. The model cannot recover, because from inside the turn there is no evidence a better tool exists. Best case it asks the user (what Laguna did); worst case it uses the wrong tool from the narrowed set, and on this surface the wrong tool is delete_node.

Nothing in the daemon log or the turn output flags the surface as wrong. It looks exactly like a model that failed to call the tool.

Likely cause

The seeded description (skill_pipeline.rs:350) reads:

"Delete nodes from the knowledge graph. Use when user wants to remove, delete, or trash a node or record."

Retrieval is semantic over this text. Nothing here is obviously wrong — but the same class of problem was measured before: rewording skill descriptions alone moved rank-1 accuracy 35% → 75%, with no model or pipeline change. Candidate hypotheses, in the order I would test them:

  1. "node or record" is doing the damage. Every one of these prompts is about a node/record; only the verbs differ. If the embedding weights the nouns over the verbs, a description ending in "a node or record" becomes a generic attractor for anything node-shaped.
  2. Short imperative phrasing lacks a distinguishing signal. "Put down that we…" and "mark it that way" are idiomatic and verb-light; the request embedding may not carry enough intent signal to separate create from delete.
  3. Score-threshold slack. If the candidate set is filled to a fixed N regardless of score, a weak third-place match is indistinguishable from a strong one at the point where tools are scoped.

Suggested fix direction

Not just a reword — the deeper problem is that a retrieval miss is silent and unrecoverable:

  • Reword the description to lead with the destructive verb and drop the generic noun tail. Cheapest thing to try, and there is precedent for it working.
  • Never scope away a create/update tool on a request whose intent was not classified as destructive. A destructive-intent skill winning rank-1 on a non-destructive request should be treated as a retrieval failure, not honoured.
  • Log when Stage-2 scoping removes a tool the turn then appears to need, so this is visible in a trace instead of looking like a model failure.

Note the third point is now partially covered on the eval side: the agent-matrix runner excludes a scenario whose asserted tool was never offered, rather than scoring it (added in the #2239 branch). That stops the eval from misattributing this to the model — it does not fix the product behaviour, which is what this issue is for.

Impact

A user recording a decision, marking something done, or setting a due date can land on a turn where the assistant has delete_node but not create_node. The likeliest visible outcome is the assistant asking a confused clarifying question; the concerning one is it reaching for the only write tool it has.

Activity

  1. malibio commented on Aug 22, 2026

    @malibio
    CollaboratorAuthor

    Baseline (worktree issue-2240-deletion-skill-scoping): Frontend 227 test files passed, 4794 tests passed.

  2. self-assigned this
    on Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions