Commit 6bca797
fix(pydantic-ai): address remaining review minors (page 4)
Follow-up to the #359 review pass — the earlier commit covered the blockers
+ page-3 majors; these are the page-4 minors:
- model.py:239 — BuiltinToolReturnPart now fires AFTER_TOOL (symmetric with
the built-in TOOL_CALL). A provider-executed built-in tool carries both its
call and result inline in the response, so AFTER_TOOL for built-ins fires
from on_response, not the next request.
- model.py:371 — _coerce_args preserves malformed JSON as {"_raw": args}
instead of dropping it to {}, so an arg-based policy can still scan it (a
malformed payload must not slip past governance).
- model.py:229 — tool_name fallback to "unknown" now logs a warning via a
shared _tool_name() helper (used by all three tool-part call sites).
Not changed: runtime/factory.py:271 kwargs.get("evaluator") — this is the
same magic-string kwarg LangChain #899's factory uses (factory.py:281); it's
the host-dispatch contract shared by all adapters, so kept for parity.
Tests: added built-in-tool-result AFTER_TOOL coverage; updated _coerce_args
variant assertion. 82 pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent f3a7cbc commit 6bca797
2 files changed
Lines changed: 65 additions & 5 deletions
File tree
- packages/uipath-pydantic-ai
- src/uipath_pydantic_ai/governance
- tests/governance
Lines changed: 36 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
211 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
217 | | - | |
| 225 | + | |
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
221 | 235 | | |
222 | 236 | | |
223 | 237 | | |
| |||
380 | 394 | | |
381 | 395 | | |
382 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
383 | 413 | | |
384 | 414 | | |
385 | 415 | | |
| |||
391 | 421 | | |
392 | 422 | | |
393 | 423 | | |
394 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
395 | 427 | | |
396 | 428 | | |
397 | 429 | | |
| |||
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
228 | 255 | | |
229 | 256 | | |
230 | 257 | | |
| |||
393 | 420 | | |
394 | 421 | | |
395 | 422 | | |
396 | | - | |
| 423 | + | |
| 424 | + | |
397 | 425 | | |
398 | 426 | | |
399 | 427 | | |
| |||
0 commit comments