Skip to content

Conversation

@Keyu-He
Copy link
Collaborator

@Keyu-He Keyu-He commented Aug 24, 2025

📑 Description

Add scenario examples from NegotiationArena and implement comprehensive multi-agent support for 3+ agents.

  • Multi-agent core implementation (MultiAgentSotopiaEnv, MultiAgentBackground)
  • Enhanced UniformSampler for 3+ agent detection
  • NegotiationArena scenarios integration

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed
  • Branch name follows type/descript (e.g. feature/add-llm-agents)
  • Ready for code review

ℹ Additional Information

  • Test Coverage: 3-agent auction scenario included in examples/experimental/multi_agent_tests/

Copy link
Member

@XuhuiZhou XuhuiZhou left a comment

Choose a reason for hiding this comment

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

Good job! Overall, I think we need to condense things a bit and make trackable changes

see my comments

model_name: str,
response_format_class: type[EvaluationForTwoAgents[T_eval_dim]],
response_format_class: Union[
type[EvaluationForTwoAgents[T_eval_dim]],
Copy link
Member

Choose a reason for hiding this comment

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

Could we merge EvaluationForTwoAgents and EvaluationForMultipleAgents together? those two classes should basically serve as the same functionality?

from sotopia.envs.evaluators import unweighted_aggregate_evaluate


class MultiAgentSotopiaEnv(ParallelSotopiaEnv):
Copy link
Member

Choose a reason for hiding this comment

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

Same here, let's just merge ParallelSotopiaEnv and MultiAgentSotopiaEnv together? If there's logic that we think needs separation, we could do that. However, instead of rewriting the function, we should do super. etc.

)


class MultiAgentBackground(ScriptBackground):
Copy link
Member

Choose a reason for hiding this comment

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

same here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok done! Thanks for pointing this out!

Remove separation between 2-agent and multi-agent cases by consolidating duplicate classes and logic paths into unified implementations
Copy link
Member

@XuhuiZhou XuhuiZhou left a comment

Choose a reason for hiding this comment

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

Great job!

I left some nitpick comments

one thing to think carefully about is how to unify different scenarios

rn the negotiation arena seems to have its own logic of doing data

rather than use their own logic, we should think carefully and design our own way.


sotopia/cli/install/redis-data/*
redis-stack-server-*/
examples/experimental/negotiation_arena/redis-data/*
Copy link
Member

Choose a reason for hiding this comment

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

what's this? do we need to add this line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I add redis-data to that folder for testing the negotiation scenarios (see /Users/keyuhe/sotopia/examples/experimental/negotiation_arena/README.md) but I assume redis-data should not be pushed

Copy link
Member

Choose a reason for hiding this comment

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

if we have folder level ignore, we might not need global level gitignore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh I will keep the global level gitignore and remove the folder level ones

Copy link
Member

Choose a reason for hiding this comment

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

this is not really aligned with the repo level setup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will move this to tests/experimental and modify correspondingly

break
stale_too_long = stale_count > self.max_stale_turn
terminated = conversation_too_long or p1_leaving or p2_leaving or stale_too_long
terminated = conversation_too_long or players_leaving or stale_too_long
Copy link
Member

Choose a reason for hiding this comment

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

the logic here should at least two agents are in the playground i guess? (for werewolf games, some agents could leave/die?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed to if too_few_agents (# agents < 2). But I think in the future, this maybe very depending on the game/scenario (e.g. in werewolf, we consider end even if 5 agents are still on (god + 2 villagers + seer + witch))

agent_goals: list[str],
) -> "ScriptBackground":
"""Create a ScriptBackground for multi-agent scenarios."""
return cls(
Copy link
Member

Choose a reason for hiding this comment

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

this is not really multi agent?

we should change the ScriptBackground dataclass.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok!

@Bekaboo Bekaboo mentioned this pull request Sep 3, 2025
6 tasks
also deleted temperature (to support gpt-5)
@XuhuiZhou XuhuiZhou requested a review from ProKil September 10, 2025 20:55
@ProKil
Copy link
Member

ProKil commented Sep 16, 2025

I will begin reviewing this PR when tests are successful.

@Keyu-He
Copy link
Collaborator Author

Keyu-He commented Sep 16, 2025

@ProKil Hi! now the tests are passed

@Keyu-He Keyu-He requested review from ProKil and XuhuiZhou September 21, 2025 00:13
Copy link
Member

@ProKil ProKil left a comment

Choose a reason for hiding this comment

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

LGTM now

@XuhuiZhou XuhuiZhou merged commit ac5cfa3 into sotopia-lab:main Sep 21, 2025
7 checks passed
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.

3 participants