Commit bce63eb
committed
LazyToolBox: defer panel-view rendering + sync removals to the index
Two more Integration shard 2 fallouts after 38da771:
1. ``_load_tool_panel_views`` ran inside ``_init_lazy_toolbox`` —
before ``_load_index_from_store`` populated the index. Static panel
views call ``toolbox_registry.has_tool(tool_id)`` for every entry
in ``apply_view``; with an empty index the check failed and dropped
every tool, surfacing as
``Failed to find tool_id <id> from parent toolbox, cannot load into panel view``
warnings and a custom-view test
(``test_panel_views::test_custom_label_order``) that received
sections instead of the expected flat list. Move the
``_load_tool_panel_views`` call to *after*
``_populate_tool_registry_from_index`` so the static views render
against the populated registry.
2. ``AbstractToolBox.remove_tool_by_id`` only deletes from
``_tools_by_id``. The lazy path keeps a parallel ``_tool_index``
that ``LazyToolBox.get_tool`` reads first, so a removal didn't
actually remove anything — the next call lazy-loaded the same tool
straight back. Tests ``test_credentials::test_list_credentials_with_missing_tool``
and ``test_fail_job_tool_unavailable::test_fail_job_when_tool_unavailable``
relied on a real removal. Override ``remove_tool_by_id`` to
force-materialise (so the parent's bookkeeping has a real Tool to
work against), call super, then drop the id from
``_tool_index.entries`` / ``entries_by_version`` and prune
matching entries from the LRU cache.
Integration test ``test_tool_source_storage.py`` still passes (5/5).1 parent 38da771 commit bce63eb
1 file changed
Lines changed: 40 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
209 | 217 | | |
210 | 218 | | |
211 | 219 | | |
| |||
300 | 308 | | |
301 | 309 | | |
302 | 310 | | |
303 | | - | |
304 | | - | |
305 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
306 | 319 | | |
307 | 320 | | |
308 | 321 | | |
| |||
1344 | 1357 | | |
1345 | 1358 | | |
1346 | 1359 | | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
1347 | 1384 | | |
1348 | 1385 | | |
1349 | 1386 | | |
| |||
0 commit comments