chore: Exclude BaseAgent.parent_agent from serialization

Otherwise, serialization fails due to circular references.

PiperOrigin-RevId: 878339838
This commit is contained in:
Bastien Jacot-Guillarmod
2026-03-04 00:43:18 -08:00
committed by Copybara-Service
parent 63f450e023
commit 2b8ccd4a00
+3 -1
View File
@@ -122,7 +122,9 @@ class BaseAgent(BaseModel):
One-line description is enough and preferred.
"""
parent_agent: Optional[BaseAgent] = Field(default=None, init=False)
parent_agent: Optional[BaseAgent] = Field(
default=None, init=False, exclude=True
)
"""The parent agent of this agent.
Note that an agent can ONLY be added as sub-agent once.