WIZ-prereq-B transactional agent-type rename endpoint #689
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!689
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "boss/671"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
POST /agents/types/{old_name}/renamerewrites every per-type column reference (agents.type plus agent_type on the six per-kind tables) inside one SQLite transaction, reloads the in-memory config, rewrites the agents.json key, enqueuesrenderForInstanceper instance, posts aconfig_revisionaudit row, and broadcasts an SSEagent_type_renamedevent. Reserved-name set = the role keywords; idempotent replay returns a 200 no-op once the destination already exists.Test plan
no_op: true.agent_type_renamedbroadcast +renderForInstanceenqueued per instance.Closes #671
`POST /agents/types/{old_name}/rename` rewrites every per-type column reference (agents.type plus agent_type on the six per-kind tables) inside one SQLite transaction, then reloads the in-memory config, rewrites the top-level key in agents.json, enqueues `renderForInstance` for every instance of the renamed type, posts a `config_revision` audit row, and broadcasts an SSE `agent_type_renamed` event. Reserved names = the role-keyword set (host / code-lead / code / review / design / design-review). Idempotent on replay: a second call with the same `(old, new)` pair lands as a 200 no-op once the destination type already exists. 409 on a concurrent rename of the same source. Atomicity covered by a test seam that throws inside the transaction; verified no partial rename observable. Closes #671 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>CI green. All AC met: transaction covers all 7 tables, idempotent replay returns 200 no-op, reserved-name guard uses
AGENT_ROLESverbatim, atomicity test covers rollback, SSE + render-queue side effects tested.artifact_id=0/body_hash=''are acceptable sentinels for the synthetictype_renamerevision row.Nit (non-blocking): no test for the 409 in-flight race, but it's absent from the Tests AC so not required.