jupyter-ai icon indicating copy to clipboard operation
jupyter-ai copied to clipboard

Last mentioned persona should be stored as an ID

Open dlqqq opened this issue 4 months ago • 0 comments

Problem

PR #1405 adds the /refresh-persona slash command, which has an interesting side effect: personas may be removed from the chat.

The issue is that self.last_mentioned_persona stores a reference to the instance itself. That instance may no longer be available in case the last mentioned persona was a local persona that was deleted.

Proposed Solution

Store the ID of the last mentioned persona instead, and make last_mentioned_persona a computed property that may return None.

dlqqq avatar Jul 09 '25 21:07 dlqqq