# Multi agent sequential actions

**URL:** https://discuss.ray.io/t/multi-agent-sequential-actions/15076
**Category:** Configure Algorithm, Training, Evaluation, Scaling
**Created:** [June 27, 2024, 4:21pm UTC](https://discuss.ray.io/t/multi-agent-sequential-actions/15076 "2024-06-27T16:21:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Massimo\_Fioravanti](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/massimo_fioravanti/32/5760_2.png) [@Massimo\_Fioravanti](https://discuss.ray.io/u/Massimo_Fioravanti)
#### Post date: [June 27, 2024, 4:21pm UTC](https://discuss.ray.io/t/multi-agent-sequential-actions/15076/1 "2024-06-27T16:21:36Z")

</div>

i am trying to replicate the open spiel example present in rlib [ray/rllib/env/wrappers/open\_spiel.py at 5323e739b5a87f92059dd12ed7a04e32c4590509 · ray-project/ray · GitHub](https://github.com/ray-project/ray/blob/5323e739b5a87f92059dd12ed7a04e32c4590509/rllib/env/wrappers/open_spiel.py#L112)

what the example does is to be able to return a observation dictionary that only refers to the next agent that must perform a action.

I am able to run environment where they all agents perform actions at the same time, but if i try to replicate the example in my own code (ray 2.30) it fails due to a validation error

```auto
  File "/home/massimo/rlc-infrastructure/.venv/lib/python3.10/site-packages/ray/rllib/utils/actor_manager.py", line 192, in apply
    raise e
  File "/home/massimo/rlc-infrastructure/.venv/lib/python3.10/site-packages/ray/rllib/utils/actor_manager.py", line 181, in apply
    return func(self, *args, **kwargs)
  File "/home/massimo/rlc-infrastructure/.venv/lib/python3.10/site-packages/ray/rllib/execution/rollout_ops.py", line 104, in <lambda>
    else (lambda w: (w.sample(**random_action_kwargs), w.get_metrics()))
  File "/home/massimo/rlc-infrastructure/.venv/lib/python3.10/site-packages/ray/rllib/env/multi_agent_env_runner.py", line 155, in sample
    samples = self._sample_timesteps(
  File "/home/massimo/rlc-infrastructure/.venv/lib/python3.10/site-packages/ray/rllib/env/multi_agent_env_runner.py", line 312, in _sample_timesteps
    self._episode.add_env_step(
  File "/home/massimo/rlc-infrastructure/.venv/lib/python3.10/site-packages/ray/rllib/env/multi_agent_episode.py", line 618, in add_env_step
    sa_episode.add_env_step(
  File "/home/massimo/rlc-infrastructure/.venv/lib/python3.10/site-packages/ray/rllib/env/single_agent_episode.py", line 450, in add_env_step
    self.validate()
  File "/home/massimo/rlc-infrastructure/.venv/lib/python3.10/site-packages/ray/rllib/env/single_agent_episode.py", line 484, in validate
    assert len(v) == len(self.observations) - 1

```

Am i missing something? is there something else i need to do beside returning the dictionary containing only the relevant observations?
