Is LangGraph unable to access st.experimental_user.email? How to provide this access

Github Link

Error I am receiving:

When trying to access the database via the chatbot in create_resume, langgraph correctly calls my function setup as a tool: get_user_info, however it is unable to get the st.experimental_user.email key when get_user_information is called in my tools_firebase.py

Within my tools_langgraph.py file, get_user_info method:
Error: KeyError('st.experimental_user has no key "email".')
I tried printing st.experimental_user.email inside functions to see if it existed or if it timed out, it seems to print except inside get_user_info where it doesn’t.

What I’ve Tried

I tried moving my functions inside the tools_langgraph.py method.
I am thinking perhaps LangGraph cannot access streamlit’s session_state? What’s a way around this or what’s the best procedure to handle this when trying to use LangGraph with streamlit to create an interactive bot.

Background

I am using OAuth from Google and I’m depending on if st.experimental_user.email exists, if not then the user has to log in. Almost like a “premium” view vs “free” view.

As of version 1.42.0, st.experimental_usser (and now st.user) are only guaranteed to have the is_logged_in property. You have to configure a connection to an identity provider and first check for is_logged_in before trying to access email.

if st.user.is_logged_in:
   st.write(st.user.email)

(I didn’t see the reference method in the file you mentioned, and GitHub is telling me that the repository is being indexed and not returning search results at the moment.)

I am on 1.42.0 and i seem to be able to access st.experimental_user.email out of streamlit when i don’t run any langgraph graphs.

It’s when a graph is invoked in langgraph where it doesn’t seem to have access to streamlit’s session_state which makes sense I think. I’m not sure if there’s any workarounds or clever ways of doing this.

The link should be active now and links to the repo.

What is the stack trace when it can’t read the email? Is it properly logic-gated behind a check for is_logged_in? Are you using any kind of subprocess or thread that’s decontectualizing st.experimental_user from the user’s session? (I would think even if you did something that started a new user session, the login cookie should still be accessible if it was there before (as long as st.logout() wasn’t called).