Skip to content

Stage 2 has no clarify path when retrieval's top skill is a lexical false-positive #2912

Closed

Description

@malibio

Summary

Split out from #2911's gap 3. "The incident Rowan was on call for — mark it resolved" routes Stage-2 retrieval to the "Conflict Resolution" skill (score 0.872, beating "Relationship Management" 0.760 and "Node Merge" 0.749) because its embedded description contains the word "resolve" ("List, inspect, dismiss, or resolve conflicts between colliding nodes..." — packages/agent/src/skill_pipeline.rs). "Graph Editing," the skill that actually owns update_node and whose description is "Modify existing nodes... update content, properties, titles, and metadata," doesn't even place in the top 3.

Retrieval returning an imperfect top-1 is expected — ADR-038's whole design is a two-stage split specifically so a model judgment step can catch this. That judgment step exists, but it has no escape hatch for this case, so it didn't catch it.

Root cause

route_clarify is a Stage-1 tool (packages/agent/src/local_agent/routing.rs, ROUTE_CLARIFY_TOOL), scoped to "the request is too ambiguous to describe as a capability" — i.e. the raw user message can't be turned into a search query. It fires before retrieval.

Stage 2 has no equivalent. render_candidates_for_prompt's injected instruction is binary:

"Use whichever applies and IGNORE the rest... Your reply must be the tool call itself. If none applies, answer the user normally."

"Answer the user normally" means: give up in prose. There is no "none of these actually fit — ask the user" option once retrieval has already returned candidates. In the observed trace, the model tried tools within the wrong skill's scope (get_related_nodes, then a malformed search_nodes), hit dead ends, and told the user it lacked a way to do the update — never surfacing the actual problem (wrong skill matched) or asking a clarifying question.

"Mark it resolved" is not an ambiguous request — a person reading it knows exactly what's wanted. The ambiguity is entirely in retrieval, which is invisible to Stage 1 and unaddressed at Stage 2.

Proposed shape (not yet designed in detail)

Stage 2 needs its own clarify/bail path, distinct from Stage 1's: something like "if the offered candidates don't actually cover the request, say so and ask, rather than trying a mismatched tool or giving up silently." Open questions:

  • Reuse route_clarify's tool definition at Stage 2 (offer it alongside the scoped candidate tools), or a new tool?
  • Should this only fire after a tool call in the wrong scope visibly fails (as here — get_related_nodes "succeeded" but the write path was unreachable), or should the model be expected to judge fit before attempting any tool?
  • How does this interact with stage2_permitted_names/stage2_tools, which currently scope the tool surface strictly to what the winning candidate(s) whitelist?

Evidence

From the #2911 probe (gemma-4-e4b-q4km, scripts/aichat.ts ask, isolated daemon): with the relationship-traversal gaps fixed, 5/5 trials correctly resolved "Rowan" → id, called get_related_nodes with the correct relationship name, and got the correct incident back — then reported inability to complete the task, because "Conflict Resolution" (the routed skill) has no update_node in its whitelist. [routed skills] Conflict Resolution=0.872, Relationship Management=0.760, Node Merge=0.749 — Graph Editing absent from the candidate set entirely.

Related

Split from #2911, which covers the (separately fixed and verified) relationship-traversal gaps this probe also found.

🤖 Generated with Claude Code

https://claude.ai/code/session_015tDgtJd9NVx1Jzr6Xi46UH

Activity

  1. malibio commented on Sep 25, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 269 files / 5313 tests passed

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions