feat: auto-patch flow YAML refs on agent type rename/delete #1228

Closed
opened 2026-05-16 21:08:52 +00:00 by claude-desktop · 0 comments
Collaborator

As an operator, I want the system to automatically update flow YAML files when I rename or delete an agent type so broken type: references never accumulate silently.

Depends on: schema regen issue.

Acceptance criteria

Rename

  • Rename API scans all loaded flow YAML files for type: <old_name> in resolve_agent with: blocks
  • Each match replaced with type: <new_name> in-place
  • DB rename + YAML patch + schema regen are atomic (any failure rolls back all three)
  • Response includes patched_flows: string[] listing updated filenames

Delete

  • Delete API scans flow YAML files for type: <name> before deleting
  • If references found: reject with 409 Conflict listing referencing files
  • Once references removed: delete proceeds, schema regenerated

YAML scanner

  • Matches type: only inside with: blocks of resolve_agent steps
  • Handles multi-document YAML files
  • Case-sensitive matching

Tests

  • Rename: two flows reference type A → rename A→B → both files updated, response lists both
  • Delete blocked: flow references type A → 409 with file list
  • Delete succeeds after reference removed

Out of scope

  • Auto-removing steps referencing deleted types
  • Web UI flow editor

References

  • issue-labeled.yml — contains type: designer, type: design-reviewer (primary targets)
  • config-agent-types.ts — rename/delete handlers
As an operator, I want the system to automatically update flow YAML files when I rename or delete an agent type so broken `type:` references never accumulate silently. Depends on: schema regen issue. ## Acceptance criteria ### Rename - [ ] Rename API scans all loaded flow YAML files for `type: <old_name>` in `resolve_agent` `with:` blocks - [ ] Each match replaced with `type: <new_name>` in-place - [ ] DB rename + YAML patch + schema regen are atomic (any failure rolls back all three) - [ ] Response includes `patched_flows: string[]` listing updated filenames ### Delete - [ ] Delete API scans flow YAML files for `type: <name>` before deleting - [ ] If references found: reject with `409 Conflict` listing referencing files - [ ] Once references removed: delete proceeds, schema regenerated ### YAML scanner - [ ] Matches `type:` only inside `with:` blocks of `resolve_agent` steps - [ ] Handles multi-document YAML files - [ ] Case-sensitive matching ### Tests - [ ] Rename: two flows reference type A → rename A→B → both files updated, response lists both - [ ] Delete blocked: flow references type A → 409 with file list - [ ] Delete succeeds after reference removed ## Out of scope - Auto-removing steps referencing deleted types - Web UI flow editor ## References - `issue-labeled.yml` — contains `type: designer`, `type: design-reviewer` (primary targets) - `config-agent-types.ts` — rename/delete handlers
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/agent-hooks#1228
No description provided.