Files
sim/apps
Waleed ffe3ab1e6c fix(copilot): name a count-parallel's branch count count in the model's read view (#7082)
sanitizeForCopilot builds the workflow JSON the model reads before editing.
For a loop it emits `iterations` from `block.data.count`, which is right: the
loop write contract (components/blocks/loop.json) declares `iterations`, and
the edit path reads `params.inputs.iterations` back into `data.count`.

The parallel branch copied that line without renaming the field. But the
parallel write contract (components/blocks/parallel.json) declares `count`,
and the edit path reads `params.inputs.count` — so the model was shown a
branch count under a name its own write contract does not define. Echoing it
back drops the value silently: neither addSubflowConfig nor the update path
looks for `iterations` on a parallel.

Scoped to the copilot read/edit round-trip. sanitizeForExport is unaffected —
it preserves state.blocks wholesale, so JSON export and folder backup/restore
always carried the real data.count.

The sanitizer had zero parallelType coverage, which is how this drifted. Adds
three cases pinning both contracts and the collection variant; the parallel one
fails against the old code.
2026-08-25 15:41:34 -07:00
..
…