-
-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChatUser
does not comply with the jupyter identity model
#1025
Comments
@krassowski This was a deliberate design decision that was made to avoid showing an "Anonymous XYZ" username by default, even when We do have an open issue for adding a configurable traitlet to always use Changing the code to always use |
There are three properties: |
I don't see why this would be a major change in the UX or any change at all (assuming that the rest of the codebase correctly uses |
I think I understand the situation, but I have a question. When does IdentityProvider use a "random Jupyter moon" name versus when does it pull a name from somewhere like the OS-level (POSIX on a *nix system) username? |
@krassowski Ah, I just reviewed the code again and now fully understand the scope of what you're proposing. We're using the login name for both the login = getpass.getuser()
initials = login[0].capitalize()
return ChatUser(
username=login,
initials=initials,
name=login,
display_name=login,
color=None,
avatar_url=None,
) And I've verified that the frontend reads from the const name =
props.message.type === 'human'
? props.message.client.display_name
: props.message.persona.name; So, changing Apologies for my confusion earlier; I keep getting tripped over how the |
It feels to me like |
Yeah that's slightly confusing but I also understand how "username" got to have the meaning of unique ID in this context. For further reference: |
And if that turns out to not be possible then I think that #866 seems like a good second-best option. |
I think I understand the situation. On the implementation side, I believe the idea of On the UX side, I do think that there are some cases where a single user is working and that the Thanks for bringing these issues up @krassowski ! |
Description
ChatUser
is defined here:jupyter-ai/packages/jupyter-ai/jupyter_ai/models.py
Lines 56 to 63 in 7c3d3a9
The comment says that the
username
should come from the identity provider. But it does not, it is instead taken fromgetpass.getuser()
:jupyter-ai/packages/jupyter-ai/jupyter_ai/handlers.py
Lines 174 to 178 in 7c3d3a9
This means that the username accessible via
app.services.user.identity.username
does not match the username stored on the messages. This means that request from @dlqqq in #1022 (review) cannot be implemented cleanly.See https://jupyterlab.readthedocs.io/en/stable/extension/identity.html#identity
Reproduce
Expected behavior
The identity from the
IdentityProvider
is used.The text was updated successfully, but these errors were encountered: