Skip to content

Agent deletes run without user confirmation: require an explicit yes before delete_node removes anything #3096

Closed

Description

@malibio

Summary

The local agent runs delete_node the moment the model calls it. Per ADR-041 that is a hard delete that cascades through the node's whole subtree, and nothing asks the user first. The UI confirms a delete when a node has descendants; the agent path skips it.

Measured on the production stack (E4B, real LocalAgentService, fixture DB): "remove the closed tickets" and "get rid of the paid invoices" delete their targets with no confirmation today, under the current routing rules. A bulk request like "remove the resolved tickets" deletes every match in one turn.

Why it matters

Proposed shape

  • The first delete_node call doesn't delete. It resolves the targets and returns what would be deleted: titles, count, and descendant count.
  • The turn ends with a structured yes/no question to the user, reusing the route_clarify question/options plumbing the frontend already renders.
  • Only an affirmative answer runs the delete, against the exact ids that were confirmed (not re-resolved), with the existing OCC version check.

Acceptance criteria

  • No agent turn can remove user data without an explicit user confirmation naming what will be removed
  • The confirmation lists the targets and the descendant count
  • A "no" (or any non-affirmative reply) deletes nothing
  • Confirmed ids are executed exactly; a version change between confirm and execute aborts
  • Covered for the local agent; the external-agent (SKILL.md) path is assessed and either covered or filed

Related: #3076, #2240, ADR-041, ADR-038.

Activity

  1. malibio commented on Sep 27, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 281 files / 5443 tests passed

  2. self-assigned this
    on Sep 27, 2026
  3. added a commit that references this issue on Sep 27, 2026
    00d039f
  4. added a commit that references this issue on Sep 27, 2026
    8b3cdc1
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