delete_instance (crates/services/src/agent/service.rs:2888) calls the external CrabShack Agent API first (:2913-2919, DELETE {manager.url}/instances/{name}) and does its own DB write after (:2937-2939). If the DB write fails, CrabShack has already destroyed the instance while chat-api reports failure — state diverges.
Fix: Make lifecycle ops transactional/idempotent or reconcilable — e.g. write a pending-intent row before the API call and reconcile on failure, or make the sequence safely retryable so the DB and CrabShack can't permanently diverge.
delete_instance (crates/services/src/agent/service.rs:2888) calls the external CrabShack Agent API first (:2913-2919, DELETE {manager.url}/instances/{name}) and does its own DB write after (:2937-2939). If the DB write fails, CrabShack has already destroyed the instance while chat-api reports failure — state diverges.
Fix: Make lifecycle ops transactional/idempotent or reconcilable — e.g. write a pending-intent row before the API call and reconcile on failure, or make the sequence safely retryable so the DB and CrabShack can't permanently diverge.