Skip to content

feat/social-games-elo-eval - #342

Open
Keyu-He wants to merge 41 commits into
sotopia-lab:mainfrom
Keyu-He:feature/elo-eval
Open

feat/social-games-elo-eval#342
Keyu-He wants to merge 41 commits into
sotopia-lab:mainfrom
Keyu-He:feature/elo-eval

Conversation

@Keyu-He

@Keyu-He Keyu-He commented Dec 9, 2025

Copy link
Copy Markdown
Collaborator

Closes #

📑 Description

✅ 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

Keyu-He and others added 24 commits September 21, 2025 01:10
with minor bugs, will fix in future iterations
contain minor bugs, will fix in future iterations
Fixes several bugs preventing custom models (via custom/model@url format) from working:

  - Fix parameter name in generate.py: api_base → base_url (line 257)
  - Fix hardcoded "gpt-4" evaluator models in server.py (lines 309, 401)
    Now uses model_dict.get("evaluator", model_dict["env"])
  - Add markdown code block stripping in PydanticOutputParser
    Many local LLMs wrap JSON in ```json...```, parser now handles this
  - Fix format_bad_output to support custom models
    Passes base_url/api_key through error recovery path
    Conditionally uses response_format (custom servers may not support it)
Merge branch 'fix/custom-model-support' into feature/social-game-support
…ility issues in the game

Refactor SocialDeductionGame for real-time history and cleaner prompts

- ParallelSotopiaEnv: Added `include_turn_marker` flag to control environment turn messages.
- SocialDeductionGame:
    - Disabled environment turn markers to avoid duplication.
    - Implemented real-time history appending via `recv_message` override and `agent_message_buffer`.
    - Populated `action_instruction` in `Observation` for dynamic prompt instructions.
- Observation: Added `action_instruction` field.
- generate.py: Added `fill_template` helper for partial string formatting.
- LLMAgent: Updated `aact` to use `fill_template` to inject `action_instructions` into `custom_template`.
- Werewolves: Updated config description to populate `{agent_names}` dynamically.
next step, change script_like to false, and fix the rest errors that may cause
@Keyu-He Keyu-He changed the title feat/social-games-elo-eva feat/social-games-elo-eval Dec 9, 2025
@XuhuiZhou

Copy link
Copy Markdown
Member

Thanks for the substantial work here. I took a pass over the current head (a5d7ecadb82e668d5393bbc1fbb8475ba8bd7704).

For this to be mergeable, I would like it reduced to a minimal, backward-compatible PR:

  • Rebase onto current main and preserve its existing public APIs, defaults, and recipient/private-action semantics.
  • Do not change behavior for existing callers unless the change is explicitly opt-in.
  • Keep this PR to the smallest shared social-game engine change needed, with focused compatibility tests.
  • Move the 21 game implementations, tournament/Elo tooling, reflection pipeline, generated results, and notebooks into separate follow-up PRs.

There are also several concrete blockers in the current branch:

  1. It does not merge cleanly with current main. There are conflicts in .gitignore, llm_agent.py, logs.py, parallel.py, social_game.py (add/add), and generate.py. Some are semantic rather than mechanical, so resolving them by taking the PR side could regress current functionality.

  2. The repository's strict type-check fails. Running uv run mypy --strict . reports 23 errors across eight changed or added files, including the recursive fallback in generate.py:719.

  3. Unsupported structured output can silently turn an agent into a no-op. The capability check may raise response_format is not supported (lines 311-319), but the fallback only retries errors containing response_schema. Other failures return action_type=none (lines 715-739), which can silently bias model comparisons.

  4. The Werewolf teammate prompt is unreachable. The later check compares a configured goal sentence to the literal string Werewolf (lines 480-516), so partner identities are never added as intended.

  5. The Elo output is not reproducible and can silently omit data. Logs are shuffled without a fixed seed while ELO_EPOCHS = 1 (lines 362-364), and broad except Exception: continue paths silently discard malformed logs (lines 367-485).

  6. The reset API ignores its caller. include_background_observations is accepted but the parent call always receives False (lines 275-292). Current main already passes this through correctly.

Ruff passes. The broad pytest run was inconclusive locally because parts of the existing suite require an external model endpoint and a specific Redis setup. I also did not find new tests for the shared engine, game state machines, or Elo calculation.

My preferred next step is therefore: a small rebased engine PR with backward-compatibility tests first, followed by separately reviewable game and evaluation PRs.

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.

2 participants