delete_retired_examples

Delete the example resources that were retired from the repositories of example manifests.

manage.py load_from_github applies the manifests that it finds, and never deletes a resource whose manifest was later removed from its repository. Such a resource stays on every platform that loaded it. When it depends on something else that was also removed, e.g. an MCPClient of an MCP server endpoint that no longer exists, it fails every time it is used. manage.py initialize_platform runs this command after it loads the example manifests, so that each platform drops them on its next deployment.

To retire an example, remove its manifest from its repository, and add it to RETIRED_EXAMPLES.

class smarter.apps.account.management.commands.delete_retired_examples.Command(*args, **kwargs)[source]

Bases: SmarterCommand

Django manage.py delete_retired_examples command.

Deletes each resource of RETIRED_EXAMPLES that the user, by default the Smarter admin, owns. A resource that another user owns, with the same name, is theirs, and left as it is. Deleting a resource deletes its links to the LLMClients that list it. Running it again deletes nothing.

add_arguments(parser)[source]

Add the arguments.

delete_retired_example(example, user_profile)[source]

Delete one retired example resource, if it exists.

Parameters:
Returns:

True if it was deleted, False if it doesn’t exist.

Return type:

bool

handle(*args, **options)[source]

Delete each retired example resource that the user owns.

help = 'Delete the example resources whose manifests were removed from the repositories of example manifests.'
smarter.apps.account.management.commands.delete_retired_examples.RETIRED_EXAMPLES: tuple[RetiredExample, ...] = (RetiredExample(model=<class 'smarter.apps.mcpclient.models.mcpclient.MCPClient'>, name='smarter_project_github_chat', reason='the MCPServer stopped serving the archived smarter-chat repository in v0.36.0, so its endpoint /api/v1/mcp/smarter-project/smarter-chat/ answers 404.'),)

The example resources to delete, which the Smarter admin owns.

(
    RetiredExample(model=<class 'smarter.apps.mcpclient.models.mcpclient.MCPClient'>, name='smarter_project_github_chat', reason='the MCPServer stopped serving the archived smarter-chat repository in v0.36.0, so its endpoint /api/v1/mcp/smarter-project/smarter-chat/ answers 404.'),
)
class smarter.apps.account.management.commands.delete_retired_examples.RetiredExample(model, name, reason)[source]

Bases: object

An example resource whose manifest was removed from its repository.

__init__(model, name, reason)
model: Type[MetaDataWithOwnershipModel]

The resource’s Django model, e.g. MCPClient.

name: str

The resource’s metadata.name.

reason: str

Why it was retired, for the command’s output.