MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / post_run_hook

Method post_run_hook

codeclash/agents/player.py:124–137  ·  view source on GitHub ↗

Should be called after we called the run method.

(self, *, round: int)

Source from the content-addressed store, hash-verified

122 return # No changes for round 0
123
124 # Generate all diffs and extract modified files
125 raw_diff = self._get_round_diff(round)
126 filtered_diff = filter_git_diff(raw_diff)
127 incremental_diff = self._get_round_diff(round, incremental=True)
128 modified_files = self._extract_modified_files_from_diff(filtered_diff)
129
130 player_dir = self.game_context.log_local / "players" / self.name
131 player_dir.mkdir(parents=True, exist_ok=True)
132
133 changes_file = player_dir / f"changes_r{round}.json"
134 changes_data = {
135 "round": round,
136 "full_diff": raw_diff,
137 "incremental_diff": incremental_diff,
138 "modified_files": modified_files,
139 "timestamp": int(time.time()),
140 }

Callers 2

run_agentMethod · 0.80
run_main_agentMethod · 0.80

Calls 4

_commitMethod · 0.95
assert_zero_exit_codeFunction · 0.90
executeMethod · 0.45

Tested by

no test coverage detected