Commit a3edf91
committed
fix(agents): use getattr for include_contents and consolidate include_sources validation
- contents.py: read agent.include_contents via getattr with 'default'
fallback, fixing the mypy union-attr error (agent is typed BaseNode |
None) and the AttributeError raised by spec'd Mock agents in tests
(pydantic v2 field names are not class attributes, so they are absent
from a MagicMock(spec=Agent)).
- llm_agent.py: fold the include_sources=[] check into the existing
__model_validator_after instead of a separate field_validator. This
avoids introducing a new untyped-decorator mypy error rather than
suppressing it with type: ignore.1 parent 2505a8d commit a3edf91
2 files changed
Lines changed: 7 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
981 | 985 | | |
982 | 986 | | |
983 | 987 | | |
| |||
990 | 994 | | |
991 | 995 | | |
992 | 996 | | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | 997 | | |
1005 | 998 | | |
1006 | 999 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
0 commit comments