Skip to content

Commit 261483d

Browse files
committed
Enh: Save exit status/cost/api calls in metadata
1 parent 611a16e commit 261483d

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

codeclash/agents/minisweagent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,8 @@ def run(self):
8383
traj_path,
8484
self.game_context.log_env / "edits" / traj_path.name,
8585
)
86+
self._metadata["agent_stats"][self.game_context.round] = {
87+
"exit_status": exit_status,
88+
"cost": self.agent.model.cost,
89+
"api_calls": self.agent.model.n_calls,
90+
}

codeclash/agents/player.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def __init__(
4444
"initial_commit_hash": self._get_commit_hash(),
4545
"branch_name": self._branch_name,
4646
"round_tags": {}, # mapping round -> tag
47+
"agent_stats": {}, # mapping round -> agent stats
4748
}
4849

4950
if self.push:

0 commit comments

Comments
 (0)