Skip to content

Commit 45df284

Browse files
committed
Merge branch 'main' of github.com:emagedoc/CodeClash
2 parents 39d7443 + a54f385 commit 45df284

48 files changed

Lines changed: 10675 additions & 149 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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:

run_viewer_react.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Launch script for the React-based CodeClash Trajectory Viewer
4+
"""
5+
6+
import argparse
7+
from pathlib import Path
8+
9+
if __name__ == "__main__":
10+
parser = argparse.ArgumentParser(description="CodeClash React Trajectory Viewer")
11+
parser.add_argument(
12+
"-d",
13+
"--directory",
14+
type=str,
15+
default=None,
16+
help="Logs directory to search for game trajectories (defaults to ./logs)",
17+
)
18+
parser.add_argument(
19+
"--port",
20+
type=int,
21+
default=5002,
22+
help="Port to run the server on (default: 5002)",
23+
)
24+
25+
args = parser.parse_args()
26+
27+
from viewer_react.backend import app, set_log_base_directory
28+
29+
# Set the logs directory if provided
30+
if args.directory:
31+
set_log_base_directory(args.directory)
32+
print(f"📁 Using logs directory: {Path(args.directory).resolve()}")
33+
else:
34+
print(f"📁 Using logs directory: {Path.cwd() / 'logs'}")
35+
36+
print("🎮 Starting CodeClash React Trajectory Viewer...")
37+
print(f"📊 Navigate to http://localhost:{args.port} to view game trajectories")
38+
print("🔧 Press Ctrl+C to stop the server")
39+
40+
app.run(debug=True, host="0.0.0.0", port=args.port)

scripts/zip_results_copy_metadata.py

Lines changed: 0 additions & 149 deletions
This file was deleted.

viewer_react/.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
__pycache__/
2+
*.py[cod]
3+
*$py.class
4+
*.so
5+
.Python
6+
build/
7+
develop-eggs/
8+
dist/
9+
downloads/
10+
eggs/
11+
.eggs/
12+
lib/
13+
lib64/
14+
parts/
15+
sdist/
16+
var/
17+
wheels/
18+
*.egg-info/
19+
.installed.cfg
20+
*.egg
21+
22+
# Frontend
23+
frontend/node_modules/
24+
frontend/dist/
25+
frontend/.vite/
26+
frontend/npm-debug.log*
27+
frontend/yarn-debug.log*
28+
frontend/yarn-error.log*
29+
30+
# IDEs
31+
.vscode/
32+
.idea/
33+
*.swp
34+
*.swo
35+
*~
36+
37+
# OS
38+
.DS_Store
39+
Thumbs.db

0 commit comments

Comments
 (0)