Skip to content

Sub-flow exit does not propagate to parent session #11

@nullhack

Description

@nullhack

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

  1. Parent session at development-flow: review-gate, which calls review-gate-flow
  2. Sub-flow transitions design-review → fail, exiting review-gate-flow as fail
  3. Expected: parent session transitions review-gate → tdd-cycle (per development-flow.yaml next: fail: tdd-cycle)
  4. 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:

  1. Pop the sub-flow from the call stack
  2. Apply the exit trigger to the parent flow's next mapping for the calling state
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions