Don't cascade-archive child agents launched via dispatch_launch_agent#712
Merged
Conversation
Only review/persona agents (those with a persona_reviews row) should be archived when their parent is archived. Regular agents launched via dispatch_launch_agent now survive independently. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Adds AND a.parent_agent_id = $1 and SELECT DISTINCT to the review child lookup, preventing stale persona_reviews rows from broadening the deletion surface. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dispatch_launch_agent. Only review/persona agents should be cascade-archived.getReviewChildAgentIds()inpersona-reviews.tsthat joinspersona_reviewswithagentsto definitively identify review children — more robust than checkingpersona IS NOT NULLon the agents table.executeArchive()anddeleteAgentDirect()now use this shared query, so only agents with apersona_reviewsrow are cascade-archived.Test plan
🤖 Generated with Claude Code