Skip to content

fix(desktop): address workflow deletions at the workflow's actual owner#2669

Open
chillerno1 wants to merge 1 commit into
block:mainfrom
chillerno1:chillerno1/workflow-delete-owner
Open

fix(desktop): address workflow deletions at the workflow's actual owner#2669
chillerno1 wants to merge 1 commit into
block:mainfrom
chillerno1:chillerno1/workflow-delete-owner

Conversation

@chillerno1

@chillerno1 chillerno1 commented Jul 24, 2026

Copy link
Copy Markdown

Fixes #2671.

Problem

Deleting an agent-created workflow from the desktop app appears to succeed, but the workflow keeps running and stays in the list. Since workflows are commonly created by agents, this makes most workflows undeletable from the UI.

Root Cause

delete_workflow builds the NIP-09 a-tag coordinate with the caller's pubkey:

let builder = events::build_workflow_delete(&workflow_id, &current_pubkey_hex(&state)?)?;

kind:30620 is addressable by (author, d-tag). For an agent-created workflow, 30620:<caller>:<workflow-id> names a record that does not exist. The relay accepts the kind:5 (a self-addressed delete always passes validation) and deletes nothing; the UI reports success.

Observed live: a delete of an agent-owned workflow produced ["a","30620:<human-pubkey>:<workflow-uuid>"] while the kind:30620 event is authored by the agent — the coordinate can never match.

Fix

Fetch the workflow's kind:30620 event first (the same #d query update_workflow already uses) and build the coordinate from the event's author. Relay-side validation already authorizes the owning human for agent-authored coordinates via is_agent_owner. Deleting an unknown workflow id now surfaces workflow not found instead of silently publishing an unmatchable delete.

This is the client half of the fix. The relay half is #2242: today the relay executes a-tag deletions scoped by the delete's signer, so a human-signed delete of an agent workflow still no-ops server-side. Without this change, #2242 alone won't help desktop users, because the client addresses a record that doesn't exist. Together they make delete work end to end.

Related but deliberately not included: deleted workflows leaving their kind:30620 event queryable (ghost list entries) is #2390, with a relay-side fix open in #1340.

Validation

  • cargo test in desktop/src-tauri: 1617 passed, 0 failed, 14 ignored.
  • cargo clippy --all-targets and cargo fmt --check: clean.
  • Live repro against the hosted relay: the stock client's kind:5 for an agent-owned workflow named the signer in the coordinate; the relay returned accepted: true and the workflow remained live and kept firing.
  • With the fix: the delete event carries 30620:<agent-pubkey>:<workflow-id>; an owner-signed deletion of that exact coordinate was verified to remove the workflow record.

🤖 Generated with Claude Code

delete_workflow built the NIP-09 a-tag coordinate with the caller's
pubkey, but kind:30620 is addressable by (author, d-tag). For an
agent-created workflow the coordinate named a record that doesn't
exist — the relay accepted the kind:5 and deleted nothing while the
UI reported success.

Fetch the workflow's kind:30620 event first (the same #d query
update_workflow already uses) and build the coordinate from the
event's author. Deleting an unknown workflow id now surfaces
"workflow not found" instead of silently publishing an unmatchable
delete.

Client half of the end-to-end fix; the relay half (execute a-tag
deletions against the a-tag owner rather than the signer) is block#2242.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: chillerno1 <gh.chiller@pm.me>
@chillerno1
chillerno1 force-pushed the chillerno1/workflow-delete-owner branch from 6a5d5a0 to 373ac3d Compare July 24, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Workflow deletes from Desktop are addressed at the caller, not the workflow's author — agent-created workflows are undeletable

1 participant