Commit 2b0c10c
fix(llamaindex): address remaining review minors (pages 4-5)
Follow-up to the #360 review pass — the earlier commit covered the blockers
(rebind + uninstall) + trace_id; these are the payload-extraction minors:
- event_handler.py:236 — _coerce_args no longer drops non-dict args: a
list-shaped arg (common with MCP tools) is preserved under `_`, and
malformed JSON is kept raw under `_raw` instead of {} — a payload
governance can't parse must not slip past arg-based policies.
- event_handler.py:224 — _message_text now walks a multimodal ChatMessage's
text blocks when `.content` is empty, instead of str(message) (which
serialized a pydantic repr into the scanned blob).
Acknowledged, intentionally unchanged (noted for consistency / follow-up):
- event_handler.py:170 (sync handle): deliberate synchronous gate — a
BEFORE_MODEL/TOOL_CALL decision must complete before the call proceeds.
Async governance is a protocol-wide change (evaluator is sync) → follow-up.
- event_handler.py:186 (warning vs exception): kept logger.warning for the
swallow path to match LangChain #899 and the other 4 adapters.
- latest-message-only scan: same documented tradeoff as #899 (avoids
re-firing on prior turns); kept for parity.
Tests: list-shaped/malformed _coerce_args + block-extraction fallback. 130 pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent c6f7d17 commit 2b0c10c
2 files changed
Lines changed: 43 additions & 9 deletions
File tree
- packages/uipath-llamaindex
- src/uipath_llamaindex/governance
- tests/governance
Lines changed: 23 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
293 | 303 | | |
294 | 304 | | |
295 | 305 | | |
| |||
307 | 317 | | |
308 | 318 | | |
309 | 319 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
314 | 328 | | |
315 | 329 | | |
316 | 330 | | |
| |||
321 | 335 | | |
322 | 336 | | |
323 | 337 | | |
324 | | - | |
325 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
326 | 341 | | |
327 | 342 | | |
328 | 343 | | |
| |||
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
299 | 318 | | |
300 | 319 | | |
301 | 320 | | |
| |||
0 commit comments