tools.dismiss_egregore module
DISMISS – send an egregore back to the Dollhouse.
Removes an active egregore from the VN canvas and the system context. Clears their sprite and summoning prompt from Redis.
@fire @skull BACK TO THE SHELF, DOLL
- async tools.dismiss_egregore.run(name='', ctx=None)[source]
Dismiss one or all summoned egregores from the current channel.
The
dismiss_egregoretool’s entry point: it tears down an active egregore (or every active egregore when name is"all") so its sprite leaves the visual-novel canvas and its persona leaves the active context, “sending it back to the Dollhouse.” Stargazer is always preserved across an"all"dismissal.All state is keyed per channel via
_channel_key_from_ctx(): it reads and rewrites the active-egregore registry (_egregore_key()) and the sprite/character roster (_characters_key()) throughctx.redis, then publishes adismisspayload on thestar:sprite:updateRedis channel so the web UI drops the sprites. For each dismissed egregore it also cleans up side channels: Discord impersonation webhooks are deleted viatools._egregore_discord.delete_egregore_webhook_by_id(using a Discord client from the context or thediscordadapter), Matrix ghost users are removed by leaving the room throughegregore_bridge.get_bridge, and the per-egregorestar:egregore_ncm:{name}NCM keys are deleted. Failures in those cleanups are logged and swallowed so the dismissal still completes. Dispatched by the tool executor viatool_loaderwhen the model invokes the tool; there are no direct Python callers.- Parameters:
name (
str) – The egregore to dismiss (case-insensitive), or"all"to dismiss every active egregore in the channel.ctx (
ToolContext|None) – The toolToolContextsupplyingredis,platform,channel_id, and adapter access. Required.
- Returns:
A JSON string. On success, a
success: trueobject with a human-readablemessage, thedismissedlist, and theremaining_activeegregores. Otherwise asuccess: falseobject with anerrormessage when the context or Redis is missing, no name was given, the named egregore is not summoned, or an unexpected error occurs.- Return type: