Skip to content

Conversation

@Abigayle-Mercer
Copy link

@Abigayle-Mercer Abigayle-Mercer commented Oct 31, 2025

This PR enables persona-to-persona mentions in streaming responses by leveraging the find_mentions parameter added to YChat.update_message() in the upstream jupyter-chat library.

Changes:

  • Added find_mentions=False to update_message() calls during streaming to defer mention extraction
  • Added final update_message(..., find_mentions=True) call after streaming completes to trigger mention extraction and persona notifications
  • Updated docstring to document mention detection behavior

How it works:

  1. During streaming: Each chunk calls update_message(..., append=True, find_mentions=False) - mentions are NOT extracted
  2. When complete: Final call to update_message(..., find_mentions=True) triggers mention extraction and notifies mentioned personas

This ensures mentioned personas are only notified once when the complete message is ready, rather than on every incremental update.

Dependencies:

Requires the find_mentions parameter in YChat.update_message() from jupyterlab/jupyter-chat (PR #302).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants