Function: attributedUserId()
attributedUserId(
executionContext,forwardedUserId?):string
Who a turn is ATTRIBUTED to, which is not always whose Databricks credential runs it. An OBO context’s own user id is authoritative. Under the service principal, every caller shares one credential, so the forwarded user id is what keeps memory threads and per-user cache namespaces distinct; the service principal id is the floor when no user was forwarded.
This rule has to be identical everywhere a cache key is built, so both the
write side (the RequestContext user stamped by stampRequestContextUser)
and the read side (the plugin’s own AppKit routes, which have a request but
no RequestContext) derive their key from this one function. When the two
disagreed, a chart written under the forwarded user id was read back under
the service principal id and the embed route answered 404, which the chat UI
renders as an expired chart.
Parameters
Section titled “Parameters”executionContext
Section titled “executionContext”ExecutionContext
forwardedUserId?
Section titled “forwardedUserId?”string
Returns
Section titled “Returns”string