Problem
When a sub-flow exits (e.g., review-gate-flow exits fail), the parent flow (development-flow) should handle the exit trigger and transition accordingly (e.g., review-gate: fail → tdd-cycle). However, the sub-flow exit does not propagate to the parent session.
Reproduction
- Parent session at
development-flow: review-gate, which calls review-gate-flow
- Sub-flow transitions
design-review → fail, exiting review-gate-flow as fail
- Expected: parent session transitions
review-gate → tdd-cycle (per development-flow.yaml next: fail: tdd-cycle)
- Actual: parent session remains at
review-gate. The fail exit is not handled.
Workaround
Manually set the parent session state:
python -m flowr session set-state tdd-cycle
Then edit the session YAML to update the state field.
Expected Behavior
When a sub-flow exits, flowr should:
- Pop the sub-flow from the call stack
- Apply the exit trigger to the parent flow's
next mapping for the calling state
- Transition the parent session to the target state
Environment
- flowr 0.4.x
- Python 3.14
- Session YAML with
stack field containing parent flow/state
Problem
When a sub-flow exits (e.g.,
review-gate-flowexitsfail), the parent flow (development-flow) should handle the exit trigger and transition accordingly (e.g.,review-gate: fail → tdd-cycle). However, the sub-flow exit does not propagate to the parent session.Reproduction
development-flow: review-gate, which callsreview-gate-flowdesign-review → fail, exitingreview-gate-flowasfailreview-gate → tdd-cycle(perdevelopment-flow.yamlnext:fail: tdd-cycle)review-gate. Thefailexit is not handled.Workaround
Manually set the parent session state:
Then edit the session YAML to update the state field.
Expected Behavior
When a sub-flow exits, flowr should:
nextmapping for the calling stateEnvironment
stackfield containing parent flow/state