Skip to content

Stage 2: deterministic clarify backstop when no offered tool can write and the turn gives up in prose #3047

Closed

Description

@malibio

Summary

When Stage-2 retrieval surfaces only skills that cannot write, and the request needs a write, the local agent reads until the iteration cap and then gives up in prose. It never says why and never asks. A prompt instruction does not fix this on the locked model (measured below). This issue proposes a deterministic backstop in code instead.

Evidence

Measured during #2912 on gemma-4-e4b, with Stage 2 given the real Conflict Resolution / Relationship Management / Node Merge candidates for "The incident Rowan was on call for — mark it resolved" (no update_node on the surface):

  • A closing instruction to judge each procedure by what it does and call route_clarify when none fits: 0/15 clarified, identical to the old "answer the user normally" wording.
  • That held at every step: the first action, after a successful get_related_nodes, after a successful search_nodes, and after both had returned the incident. The model always made another read (search_nodes → get_related_nodes → get_node).

The model does not notice that no offered tool can write, so any fix that relies on its judgment (clarify, or a model-invoked re-route) hits the same weak point.

#2912 fixed the specific case at retrieval (Graph Editing's description), and route_clarify now stays on every Stage-2 surface. Neither helps the next request that retrieves the wrong skills.

Proposed shape

A system-side check at the end of a Stage-2 turn, like the existing duplicate-entity backstop in agent_loop.rs, which turns a refused create the model left unresolved into a clarification:

  • Condition: the turn made no successful write, and the Stage-2 surface had no write tool (is_write_tool), and the turn ended in prose (not a route_clarify call), and the intent has not already clarified.
  • Action: replace the prose reply with a clarification that says the matched capabilities could only look things up, names what was found (ids from the turn's successful read results), and asks the user to confirm the change they want. Their reply re-enters Stage 1 with more explicit wording.

Open questions:

  • Is "no write tool on the surface" the right trigger, or is it too broad (for example, a genuine read-only question answered in prose)? It may also need a signal that the request asked for a change, and that signal must not come from the model.
  • Should it fire only after at least one successful read, so that a read-only question answered directly is left alone?

Acceptance criteria

  • Backstop implemented with the trigger conditions decided above
  • Unit test: a mismatched-skill turn that ends in prose is converted to a clarification
  • Unit test: a read-only question answered in prose is left untouched
  • Unit test: nothing fires once the intent has already clarified

🤖 Generated with Claude Code

Activity

  1. malibio commented on Sep 28, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 280 files / 5225 tests passed

  2. self-assigned this
    on Sep 28, 2026
  3. added a commit that references this issue on Sep 28, 2026
    b36746b
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