If a value is assigned to a contextvar, it will not be preserved when moving to another cell in the notebook.
See this short example:
# cell 1
from contextvars import ContextVar
bro = ContextVar("bro", default="thisismydefaultvalue")
bro.get()
>> 'thisismydefaultvalue'
# cell 2
bro.set("!!!!!!!!!!!MODIFIED!!!!!!!")
bro.get()
>> '!!!!!!!!!!!MODIFIED!!!!!!!'
# cell 3
bro.get()
>> 'thisismydefaultvalue'
I've verified that this issue does not occur for ipykernel<7.0.0