Conversation
…luation - Implement classic 2-player Ugli Orange case study for negotiation training - Features Roland/Jones as competing negotiators, LLM judge for evaluation (technically total 3 players) - Simplified accept logic (latest proposal only) for better LLM compatibility - Comprehensive judge evaluation with structured 6-field format - Complete test suite with 11 passing tests - Comprehensive README with usage examples
# Conflicts: # textarena/envs/__init__.py
- Wire the declared error_allowance into FFAMultiPlayerState so repeated invalid moves eventually resolve instead of retrying forever. - Return the real done flag from step() on an invalid move so an exhausted error allowance can end the game. - Add an _invalid() helper: on exhausting the allowance the offender forfeits to the opponent (matches the repo-wide invalid-move convention). - Drop the dead self.rewards writes in _process_judge_decision; rewards flow through state.set_winners()/close().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revives @cstorm125's UgliOrange negotiation environment from #168 (branch
ugli_orange), with fixes so the reward and termination logic is sound. The env, README, tests, and registration are all @cstorm125's original work; this PR carries them forward plus a small correctness pass. Opened as a fresh PR because the original author's branch is no longer being updated.UgliOrange is a 3-player LLM-judge negotiation game (P0 Roland / rinds, P1 Jones / juice, P2 Judge) modelling the classic win-win case: both players can meet their objectives from the same 3000 oranges.
What changed
error_allowanceinto the state.__init__declarederror_allowance=3butreset()never passed it toFFAMultiPlayerState, so it had no effect.step()returned a hard-codedFalse(never done) on an invalid move. It now returns the realself.state.done, so a player who keeps sending invalid moves can no longer stall the game forever — matching the repo-wide invalid-move convention._invalid(): a single invalid move is retried, but once the allowance is exhausted the offender forfeits to the opponent. The two accept-time validation sites (no proposals / accepting your own proposal) route through it._process_judge_decisionsetself.rewards = {...}after each verdict, but rewards flow throughstate.set_winners()/close(); those env-object writes were never read. Removed with no behavior change.Verification
{0:0,1:0,2:0}; repeated invalid accepts → offender-1, opponent+1; and all four judge verdicts (Roland-only, Jones-only, Both, Neither) plus an over-budget deal correctly scoring as Neither.Verification gap: the judge is an LLM at runtime. The reward paths were exercised with canned judge decisions (as in the author's own tests); the natural-language judging itself was not driven by a live model here.
Credit: @cstorm125 (#168).