Skip to content

[Bug] AgentRearrange drops img on parallel flow steps, but forwards it on sequential ones - #1890

Merged
kyegomez merged 1 commit into
kyegomez:masterfrom
ayaangazali:fix/rearrange-parallel-drops-img
Aug 21, 2026
Merged

[Bug] AgentRearrange drops img on parallel flow steps, but forwards it on sequential ones#1890
kyegomez merged 1 commit into
kyegomez:masterfrom
ayaangazali:fix/rearrange-parallel-drops-img

Conversation

@ayaangazali

Copy link
Copy Markdown
Contributor

Problem

_run_concurrent_workflow accepts img and never uses it:

def _run_concurrent_workflow(self, agent_names, img: str = None, *args, **kwargs):
    ...
    results = run_agents_concurrently(
        agents=agents_to_run,
        task=self.conversation.get_str(),
    )

run_agents_concurrently takes an img parameter — the call just omitted it.

So the same request behaves differently depending on whether its flow contains a comma:

flow "A, B"    ->  A saw img=None,          B saw img=None
flow "A -> B"  ->  A saw img='chart.png',   B saw img='chart.png'

No error, no warning — the agents simply answer a multimodal question without the image.

Why the sync parallel path is the outlier

Two of the three paths already forward it:

  • _run_sequential_workflow forwards img
  • _run_concurrent_workflow_stream (the async twin) forwards img
  • _run_concurrent_workflow did not

Reach

Anything with a parallel step in its flow: AgentRearrange(flow="A, B").run(task, img=...), SequentialWorkflow.run(task, img=...) where the derived flow has one, and SwarmRouter(swarm_type="AgentRearrange").

Verification

after:
flow "A, B"    ->  A saw img='chart.png',   B saw img='chart.png'
flow "A -> B"  ->  A saw img='chart.png',   B saw img='chart.png'

tests/structs/test_agent_rearrange.py — 11 failed / 54 passed, identical on master (that suite makes live LiteLLM calls, so it is red in a sandbox either way; the counts and the failing set match).

One file, one argument.

(Left alone deliberately: the *args/**kwargs on this method also have no destination on run_agents_concurrently. Removing them is a signature change rather than a bug fix, so it did not belong in this diff.)

@ayaangazali
ayaangazali requested a review from kyegomez as a code owner August 15, 2026 05:03
Copilot AI lite review requested due to automatic review settings August 15, 2026 05:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

`_run_concurrent_workflow` accepted `img` and never used it, so a flow
step written with a comma dropped the image while the sequential path
kept it:

    flow "A, B"   ->  A saw img=None,         B saw img=None
    flow "A -> B" ->  A saw img='chart.png',  B saw img='chart.png'

`run_agents_concurrently` takes `img`; the call simply omitted it.
`_run_sequential_workflow` forwards it, and so does the async twin
`_run_concurrent_workflow_stream` — the sync parallel path was the only
one that did not, so the same request behaved differently depending on
whether its flow contained a comma.

Reaches users through `SequentialWorkflow.run(task, img=...)` and any
`SwarmRouter(swarm_type="AgentRearrange")` whose flow has a parallel
step.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ayaangazali
ayaangazali force-pushed the fix/rearrange-parallel-drops-img branch from 847f2ef to 989b686 Compare August 15, 2026 17:48
@kyegomez
kyegomez merged commit 2265caa into kyegomez:master Aug 21, 2026
5 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants