Skip to content

Conversation

JasonLovesDoggo
Copy link

@JasonLovesDoggo JasonLovesDoggo commented Aug 15, 2025

Summary

Properly init Agent.user_id if passed in via Agent.arun

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Additional Notes

Add any important context (deployment instructions, screenshots, security considerations, etc.)
This was due to user_id not showing up in arize. We don't use teams.
image

@JasonLovesDoggo JasonLovesDoggo requested a review from a team as a code owner August 15, 2025 21:08
@JasonLovesDoggo
Copy link
Author

Actually, just noticed the existing call was a self assignment. Probably a typo. It's initialized in Agent's init but not in arun. see https://github.com/agno-agi/agno/blob/main/libs/agno/agno/agent/agent.py#L445

@dirkbrnd
Copy link
Contributor

@JasonLovesDoggo We don't actually want that to be "sticky" when passed on arun. It is supposed to only be for that run, otherwise it breaks multi-user flows.

@JasonLovesDoggo
Copy link
Author

JasonLovesDoggo commented Aug 16, 2025

@JasonLovesDoggo We don't actually want that to be "sticky" when passed on arun. It is supposed to only be for that run, otherwise it breaks multi-user flows.

Yet session id persists?

I feel like I'm missing something here where we obviously want the telemetry to get the user id but it reads from an empty value.

The current code is just doing a self assignment which also just makes no sense

@dominic-mortimer
Copy link

Agreed!

@dirkbrnd
Copy link
Contributor

@JasonLovesDoggo @dominic-mortimer
Agreed, this is not ideal for telemetry, but I believe the issue lies in the OpenInference package. Because the user_id is resolved in run and should then be correctly picked up downstream. But I see in the OpenInference package it uses the global value.

We don't want it to be sticky, because then it would break multi-user flows in production applications where an agent is used concurrently.

I'll look into updating the Arize package

@dirkbrnd
Copy link
Contributor

Added a PR to openinference
Arize-ai/openinference#2138

I'll get it merged asap. Their team is usually pretty responsive

@JasonLovesDoggo
Copy link
Author

Added a PR to openinference Arize-ai/openinference#2138

I'll get it merged asap. Their team is usually pretty responsive

Got it! Thanks Dirk. That's perfect for us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants