Skip to content

Fix toolbox block resolution and surface installed versions#282

Merged
milanofthe merged 1 commit intomainfrom
fix/toolbox-block-resolution
May 5, 2026
Merged

Fix toolbox block resolution and surface installed versions#282
milanofthe merged 1 commit intomainfrom
fix/toolbox-block-resolution

Conversation

@milanofthe
Copy link
Copy Markdown
Member

@milanofthe milanofthe commented May 5, 2026

  • Load-order race: loadFromUrlParam now runs at the end of the bootstrap chain (autoDetectBackend → initBackendFromUrl → initPyodide → bootstrapToolboxes → loadFromUrlParam). Previously these ran in parallel, so URL-loaded models could mount their nodes before nodeRegistry had the toolbox blocks registered, leaving them stuck rendering as missing.
  • Reactive typeDef: BaseNode subscribes to registryVersion and re-derives typeDef whenever a toolbox is installed/uninstalled. Missing blocks now heal automatically when their toolbox arrives, and revert to missing again on uninstall.
  • Codegen importPath: toolbox buildBlockDefinition was throwing away config.importPath, so generated Python always hit from pathsim.blocks import X even for toolbox classes. Now NodeTypeDefinition carries an optional importPath, toolbox-registered blocks set it to their config's importPath, and codegen prefers it: typeDef.importPath ?? blockImportPaths[blockClass] ?? 'pathsim.blocks'.
  • Helpers cache invalidated by sim reset: loadGraphFile calls resetSimulation() which wipes Python globals, but installer.ts cached helpersLoaded = true in JS, so the next install hit NameError: '_pv_already_installed'. Cache removed; the sentinel check runs on every ensureHelpers (single cheap evaluate).

@milanofthe milanofthe merged commit 3f2d4ed into main May 5, 2026
4 checks passed
@milanofthe milanofthe deleted the fix/toolbox-block-resolution branch May 5, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant