Honor user deletion of default Agents - #837
Draft
Y1fe1Zh0u wants to merge 1 commit into
Draft
Conversation
Persist tenant-scoped bootstrap identity so Morty and Meeseeks are initialized once, while surviving Agent storage remains repairable. Existing deployments lazily backfill stable IDs from the legacy marker or historical rows. Constraint: Existing deployments have no database bootstrap marker and docs are ignored by default. Rejected: Restore the legacy marker early return | it would disable storage drift repair and remains unsafe when storage changes. Confidence: high Scope-risk: moderate Reversibility: clean Directive: Do not use Agent name or runtime status as the default-Agent initialization fact. Tested: 38 scoped pytest cases; Ruff; git diff --check. Not-tested: Real PostgreSQL container startup because the local Docker daemon is unavailable.
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.
What changed
bootstrap:default_agents:v1initialization record with stable Morty and Meeseeks IDsWhy
Deleting an Agent is a logical delete that sets
deleted_atandstatus="stopped". The previous seeder excluded stopped rows and treated a missing canonical name as a fresh installation, so deleted, stopped, or renamed default Agents could be recreated on startup.The intended product contract is one-time initialization: after Morty and Meeseeks are initially created, user deletion, stopping, or renaming must not trigger automatic recreation.
Compatibility
Existing deployments do not need an Alembic data migration or a manual backfill script. On the first startup after upgrade, the seeder creates the database initialization record from validated legacy marker IDs or canonical-name database history. Only tenants with no initialization evidence enter the fresh creation path.
Already recreated Agents are not automatically deleted because the system cannot safely infer whether users have started using them.
Validation
38 passedacross default-Agent seeding, deletion, auth, visibility, and directory API testsgit diff --checkpassedNot tested