Skip to content

Commit 4ea769b

Browse files
committed
Fix: Write full metadata not just game metadata
1 parent 5a4f7ae commit 4ea769b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

codeclash/tournaments/pvp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def run_agent(self, agent: Player, round_num: int) -> None:
123123
def end(self) -> None:
124124
"""Save output files, clean up game resources and push agents if requested."""
125125
with open(self.local_output_dir / "metadata.json", "w") as f:
126-
json.dump(self.game.get_metadata(), fp=f, indent=2)
126+
json.dump(self.get_metadata(), fp=f, indent=2)
127127
self.game.end(self.cleanup_on_end)
128128
if self.push_agent:
129129
for agent in self.agents:

codeclash/tournaments/single_player.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ def set_mirror_state_to_round(self, round_num: int):
131131

132132
def end(self):
133133
"""Clean up game resources."""
134+
with open(self.local_output_dir / "metadata.json", "w") as f:
135+
json.dump(self.get_metadata(), fp=f, indent=2)
134136
self.game.end(self.cleanup_on_end)
135137

136138
def evaluate(self, n_repetitions: int = 3) -> None:

0 commit comments

Comments
 (0)