Skip to content

[Bug][HeavySwarm Dashboard] final status does not reflect agent failures #1908

Description

@biancam5

Describe the bug

The HeavySwarm dashboard tracks individual agent failures correctly while agents are running, but the final status does not appear to take those failures into account.

Inside _execute_agents_with_dashboard(), an agent exception is marked through tracker.error(...) and returned as an error result. However, once all agent futures have been processed, the dashboard always calls show_execution_complete(...) without checking whether any of the agents failed or timed out.

This can make the final dashboard state misleading because the individual progress view may contain a failed agent while the dashboard still transitions to the normal final status.

To Reproduce

This can be seen from the current implementation in:

swarms/structs/heavy_swarm.py

When an agent raises an exception, the dashboard correctly records the failure:

except Exception as e:
    tracker.error(agent_key, agent_type)
    self._log(
        "ERROR",
        f"❌ Error in {agent_type} Agent: {str(e)} Traceback: {traceback.format_exc()}",
    )
    return agent_type, f"Error: {str(e)}"

Timeouts and exceptions are also stored in the results while the futures are being collected:

except concurrent.futures.TimeoutError:
    tracker.timeout(agent_key, agent_key)
    results[agent_key] = (
        f"Timeout after {self.timeout} seconds"
    )
except Exception as e:
    tracker.error(agent_key, agent_key)
    results[agent_key] = f"Exception: {str(e)}"

After that loop finishes, the final dashboard state is shown unconditionally:

self.dashboard.show_execution_complete(
    agent_count, synth_label
)

There is no check here for failed or timed-out agents before choosing the final dashboard state.

Expected behavior

The final dashboard status should reflect the aggregate result of the agent executions.

For example:

  • If every agent succeeds, show the normal successful state.
  • If one or more agents fail or time out, show a partial-failure or warning state.
  • Ideally, include a small summary such as 3/4 agents completed successfully so the user can immediately understand the result.

The underlying results should remain available for synthesis, but the UI should not present the same final state for both a fully successful run and a run containing failures.

Additional context

This is especially relevant for the dashboard because it is providing real-time visibility into a parallel multi-agent process. The individual agent states are already being tracked, so deriving the final summary from those states would keep the overall UI consistent with what the user just saw during execution.

A regression test covering successful, partially failed, and timed-out agent runs could also help keep the dashboard state consistent.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions