Skip to content

fix: validate disconnected nodes and exclude input nodes from outputs#320

Open
Rkx-01 wants to merge 1 commit intoc2siorg:mainfrom
Rkx-01:fix/model-generation-disconnected-nodes
Open

fix: validate disconnected nodes and exclude input nodes from outputs#320
Rkx-01 wants to merge 1 commit intoc2siorg:mainfrom
Rkx-01:fix/model-generation-disconnected-nodes

Conversation

@Rkx-01
Copy link
Copy Markdown
Contributor

@Rkx-01 Rkx-01 commented Apr 26, 2026

Problem

Closes #244
Supersedes #245

Two bugs in model_generation.py silently broke model generation:

  • Disconnected nodes caused a KeyError crash — BFS never visits
    unconnected layers but the code still tries to access them in
    keras_tensors

  • Input nodes were misidentified as outputs — custominput nodes
    with no outgoing edges were included in output_ids, producing
    malformed Keras models silently

Fix

  • Added validation after BFS loop that raises a clear ValueError
    listing exactly which nodes are disconnected
  • Fixed output_ids filter to exclude custominput nodes

Testing

  • Disconnected canvas nodes → clear error message shown ✅
  • Connected canvas → model generates correctly ✅
  • Iris sample project still works perfectly ✅

Note

Fresh PR as requested by @ivantha from #245.
Rebased on latest main, single clean commit, all checks passing.

@Rkx-01
Copy link
Copy Markdown
Contributor Author

Rkx-01 commented Apr 26, 2026

Hi @ivantha - fresh PR superseding #245.
Rebased on latest main, single clean commit, all checks passing.
Ready to merge!

@Rkx-01 Rkx-01 changed the title fix: raise ValidationError for disconnected nodes and exclude input n… fix: validate disconnected nodes and exclude input nodes from outputs Apr 26, 2026
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.

[Bug] Disconnected canvas nodes cause KeyError crash and input nodes misidentified as outputs in model_generation.py

1 participant