Skip to content

fix(kernel): scope collect step to preceding fan-out outputs - #1277

Open
andyst-dev wants to merge 1 commit into
RightNow-AI:mainfrom
andyst-dev:fix/1253-collect-fanout-only
Open

fix(kernel): scope collect step to preceding fan-out outputs#1277
andyst-dev wants to merge 1 commit into
RightNow-AI:mainfrom
andyst-dev:fix/1253-collect-fanout-only

Conversation

@andyst-dev

Copy link
Copy Markdown

Fixes #1253

Summary

The collect step joins the whole run-wide all_outputs buffer instead of only the outputs of the immediately preceding fan-out group. A workflow shaped sequential → fan_out → fan_out → collect therefore feeds the earlier sequential step's output into the collected payload, and multi-phase workflows keep carrying stale pre-fan-out context across later collect steps.

docs/workflows.md specifies: "The collect step gathers all outputs from the preceding fan-out group" — the implementation did not match that contract.

Changes

  • execute_run now keeps a fan_out_start marker, reset to all_outputs.len() at the beginning of each fan-out group.
  • The collect step joins all_outputs[fan_out_start..] instead of the full buffer, so it merges only the outputs produced by the immediately preceding fan-out group.
  • Added a regression test covering sequential → fan_out → fan_out → collect, asserting the collected payload contains both branch outputs and not the earlier sequential output.

Behavior for workflows without a preceding fan-out group is unchanged (the marker defaults to the start of the buffer).

Testing

  • cargo test -p openfang-kernel — all tests pass (workflow tests: 18 passed)
  • cargo fmt -p openfang-kernel -- --check — clean
  • cargo clippy -p openfang-kernel --all-targets -- -D warnings — only a pre-existing clippy::question_mark warning in crates/openfang-channels/src/feishu.rs:1052, present on main and unrelated to this change; the changed file produces no warnings

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

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.

collect joins pre-fan-out outputs instead of only the preceding fan-out group

1 participant