Describe what happens (in detail):
We have an AI Agent that processes rows from a CSV (product catalog) and loops through each product to check for MAP (Minimum Advertised Price) violations.
-
The app runs correctly through cycles 0 → 12.
-
At each cycle up to 12:
-
currentIndexincrements properly (0 → 1 → … → 12). -
A valid
currentProductobject is retrieved from the dataset. -
Violations are appended as expected.
-
-
At cycle 13:
-
currentProductis still valid (example: “Electric Marine Grade 2300W (BH032MG-2300)” withmapPrice: 3390). -
But the Increment Index block fails to persist
currentIndex. -
Logs show the block executed, but
functionStdoutwas empty andcurrentIndexdropped tonull. -
This caused the loop to crash even though the product data was intact.
-
This pattern is 100% reproducible: the workflow works perfectly until cycle 12, then consistently fails at cycle 13.
Intended behavior:
-
currentIndexshould increment deterministically on every cycle (n → n+1) untilcurrentIndex >= totalProducts. -
The loop should continue seamlessly through all rows in the CSV (in our case, 30+ rows).
-
At no point should
currentIndexreset or becomenull.
Evidence from logs (attached):
-
Cycle 12:
currentIndex = 12 currentProduct = { "productName": "56 Double Element Smart Electric Heater", "mapPrice": 659, "actualPrice": 619.02 } ✅ Violation logged -
Cycle 13:
currentProduct = { "productName": "Electric Marine Grade 2300W (BH032MG-2300)", "mapPrice": 3390 } currentIndex = null (Increment block ran but functionStdout empty) ❌ Workflow crashed
Why this points to a platform bug (not user code):
-
The increment code is trivial (
currentIndex + 1). There is no code path that assignsnull. -
The same block executed correctly for 12 cycles, then suddenly failed with valid input.
-
The CSV data is valid and continuous — no gaps at row 13.
-
Therefore, the failure is in MindStudio’s variable persistence across loop transitions.
AI Agent link: https://app.mindstudio.ai/agents/copy-of-map-guardian-ver-22-2195898e/run
Run log JSON (showing cycles 0–13 with breakdown):