Skip to content

Added runtime validation for Agent name field #998

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

DanielHashmi
Copy link
Contributor

Add post_init validation to ensure Agent name is a string

The Agent class previously only used type hints for the name field without
runtime validation, allowing non-string values like integers to be passed.
This caused downstream errors during JSON serialization, tracing, and other
operations that expect the name to be a string.

Changes:

  • Add post_init method to Agent class with isinstance check
  • Raise TypeError with descriptive message for non-string names
  • Validation occurs at instantiation time to fail fast

Fixes issue where Agent(name=1) would succeed but cause errors later
in the execution pipeline.

…evelopers" appears twice in the classifiers list. Line Number 20 and Line Number 26 Fix: Removed the duplicate classifier entry
…he tracing module where one import uses an absolute path in line number 3 while all others use relative imports
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.

1 participant