-
Notifications
You must be signed in to change notification settings - Fork 41
Feat support private messages #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat support private messages #330
Conversation
Refactored negotiation arena example scripts to use more explicit typing, improved agent profile retrieval logic, and removed unused OpenAI API key loading. Updated .gitignore to exclude negotiation_arena redis-data directory.
Remove separation between 2-agent and multi-agent cases by consolidating duplicate classes and logic paths into unified implementations
a685992 to
e4a0957
Compare
c64cab5 to
f98e719
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| "agent_names": env.agents, | ||
| "sender": agent_name, | ||
| }, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Retry validation failure crashes without error handling
When an agent generates an invalid action with bad recipients, the code retries once by asking the agent to regenerate. However, the second AgentAction.model_validate() call at line 196-202 is not wrapped in a try-except block. If the agent still produces invalid recipients after the retry, the validation error will propagate as an uncaught exception and crash the episode. This makes the system fragile when LLM agents occasionally fail to follow the messaging protocol correctly.
ecc88e2 to
6a8395c
Compare
| return "left the conversation" | ||
| action_str = "left the conversation" | ||
|
|
||
| return f"{recipients_prefix} {action_str}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Extra space in to_natural_language output formatting
The to_natural_language method in AgentAction has an extra space in the return statement. The recipients_prefix on line 140 already includes a trailing space when to is set (f"[private to {self.to}] "), but line 155 adds another space (f"{recipients_prefix} {action_str}"). This results in double spaces for private messages (e.g., "[private to ...] said:"), and a leading space for public messages (e.g., " said:"). This formatting issue will cause the test assertions in test_parallel_sotopia_env_multi_agents_private_messages to fail since they expect strings like 'agent1 said: "..."' without extra spaces.
Closes #
📑 Description
Added private message (DM) support for multi-agent interaction.
Unlike private actions, which are only visible to the author and recipients, but not to others.
Agents can set the
tofield inAgentActionclass to specify the recipients.It is called private actions instead of "private messages" as the
tofield is not limited to the "speak" action.Any action, e.g. "non-verbal communication", "action", or even "leave" can have such property.
This PR is based on #329.
Co-author @ruiyiw
✅ Checks
type/descript(e.g.feature/add-llm-agents)ℹ Additional Information
Note
Introduce private actions via
AgentAction.towith validation and per-recipient observations; switch action space to string literals; update server, docs, examples, and tests.AgentAction.tofor private recipients with validation;to_natural_languageprefixes[private to ...].ParallelSotopiaEnv):_actions_to_natural_language_for_viewer.agent_names,sender) instep/astep.DiscretewithLiteralSpaceforaction_type(string literals).tovalidation inmessages,envs/parallel,concepts/agents, and examples index.action_typeis now a string literal in action space.examples/experimental/multi_agents_private_dm/(README, scripts, JSON configs) demonstrating multi-agent DMs and JSON logging.LLMAgent.act.Written by Cursor Bugbot for commit beffe0d. This will update automatically on new commits. Configure here.