Skip to content

Commit 099a3ed

Browse files
committed
cc agent init
1 parent 2eab1e8 commit 099a3ed

File tree

5 files changed

+172
-0
lines changed

5 files changed

+172
-0
lines changed

cc-agent/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
private

cc-agent/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
This is an internal tool to autonomously run agents in a loop in github codespaces.
2+
3+
# Context
4+
5+
Github codespaces are an amazing product and we build codespaces periodically with the latest Helicone changes (see ../.devcontainer/\*) for more information on how these codespaces are generated.
6+
7+
_The idea_ is to spawn isolated github codespaces that can be easily used for agent loops, where they can run `--dangerously-skip-permissions`.
8+
9+
Github codespaces is an amazing tool because they have a CLI perfect for managing your environments and are preconfigured with git creds to allow you to push changes.
10+
11+
```bash
12+
gh cs --help
13+
Connect to and manage codespaces
14+
15+
USAGE
16+
gh codespace [flags]
17+
18+
ALIASES
19+
cs
20+
21+
AVAILABLE COMMANDS
22+
code: Open a codespace in Visual Studio Code
23+
cp: Copy files between local and remote file systems
24+
create: Create a codespace
25+
delete: Delete codespaces
26+
edit: Edit a codespace
27+
jupyter: Open a codespace in JupyterLab
28+
list: List codespaces
29+
logs: Access codespace logs
30+
ports: List ports in a codespace
31+
rebuild: Rebuild a codespace
32+
ssh: SSH into a codespace
33+
stop: Stop a running codespace
34+
view: View details about a codespace
35+
36+
INHERITED FLAGS
37+
--help Show help for command
38+
39+
LEARN MORE
40+
Use `gh <command> <subcommand> --help` for more information about a command.
41+
Read the manual at https://cli.github.com/manual
42+
```
43+
44+
# Getting started
45+
46+
```bash
47+
# run the below gh cs create
48+
> gh cs create
49+
? Repository: Helicone/helicone
50+
✓ Codespaces usage for this repository is paid for by chitalian
51+
? Branch (leave blank for default branch):
52+
? Choose Machine Type: 4 cores, 16 GB RAM, 32 GB storage (Prebuild ready)
53+
```
54+
55+
connect to it and open vscode with..
56+
57+
```bash
58+
gh cs code
59+
# or ssh instead if that's more your thing
60+
gh cs ssh
61+
```
62+
63+
Note this will run the build script which may take up to 5 minutes... be patient
64+
65+
edit the `src/task.md` file with the task you
66+
67+
# Claude code agent in a loop
68+
69+
The idea here is to run

cc-agent/run.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
# Configuration
4+
SLEEP_TIME_SECONDS=0 # Time to sleep between iterations (in seconds) - default: 60 (1 minute)
5+
DONE_FILE="./.agent/DONE.md" # File to check for completion
6+
mkdir -p ./.agent
7+
8+
# Run wallet testing loop until DONE.md file is created
9+
10+
# Remove the DONE file if it exists from a previous run
11+
if [ -f "$DONE_FILE" ]; then
12+
rm "$DONE_FILE"
13+
echo "Removed existing $DONE_FILE from previous run"
14+
fi
15+
16+
ITERATION=0
17+
START_TIME=$(date +%s)
18+
19+
echo "========================================"
20+
echo "Starting Admin Wallet Testing Loop"
21+
echo "Start time: $(date)"
22+
echo "Will run until $DONE_FILE is created"
23+
echo "========================================"
24+
echo ""
25+
26+
while [ ! -f "$DONE_FILE" ]; do
27+
ITERATION=$((ITERATION + 1))
28+
29+
echo "========================================"
30+
echo "Iteration #$ITERATION at $(date)"
31+
echo "========================================"
32+
33+
# Run Claude Code with the prompt
34+
if [ $ITERATION -eq 1 ]; then
35+
# First iteration: start fresh without --continue
36+
cat prompt.md | claude -p --dangerously-skip-permissions
37+
else
38+
# Subsequent iterations: use --continue
39+
cat prompt.md | claude -p --dangerously-skip-permissions --continue
40+
fi
41+
42+
# Check if DONE file was created
43+
if [ -f "$DONE_FILE" ]; then
44+
echo ""
45+
echo "DONE file detected. Exiting loop."
46+
break
47+
fi
48+
49+
# Sleep before next iteration
50+
if [ $SLEEP_TIME_SECONDS -gt 0 ]; then
51+
echo ""
52+
echo "Sleeping for $SLEEP_TIME_SECONDS seconds..."
53+
sleep $SLEEP_TIME_SECONDS
54+
CURRENT_TIME=$(date +%s)
55+
ELAPSED=$((CURRENT_TIME - START_TIME))
56+
echo "Elapsed time: $((ELAPSED / 60)) minutes"
57+
echo ""
58+
fi
59+
done
60+
61+
echo ""
62+
echo "========================================"
63+
echo "Testing Loop Complete"
64+
echo "End time: $(date)"
65+
echo "Total iterations: $ITERATION"
66+
echo "========================================"

cc-agent/src/base_prompt.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Environment Note:** The development environment is already configured. All environment variables and dependencies are set up.
2+
3+
## Prerequisites - Start Required Services
4+
5+
Before running the tests, ensure these services are running in the background:
6+
7+
1. **Workers** - Run in background: `./run_all_workers.sh`
8+
2. **Jawn (Backend API)** - Run in background from `/valhalla/jawn`: `yarn dev`
9+
3. **Web (Frontend)** - Run in background from `/web`: `yarn dev:local -p 3000`
10+
11+
**IMPORTANT: Use the Playwright MCP tools to automate browser interactions. You have access to:**
12+
13+
here are keys you can use to send test requests to them models through the worker to visualize them in helicone
14+
15+
Also please make sure we are testing this, by sending a request to openai and reproduce the issue that we can see in playwright. take screenshots for proof
16+
17+
You will run on a loop for the next few hours. good luck!
18+
19+
If everything is working and you were able to test it manually, please create a doc in the scratchpad name "./.agent/DONE.md" with proof that everything works well and you were able to reproduce the error and the error is now fixed with a summary of the fixes and all the tests and builds are working
20+
21+
^ It's okay if you did not finish, we will re-run you in a min. Only write the DONE.md if you are 1000000% done
22+
23+
## MAKE SURE YOU ARE 100% done, if not DO NOT write the done file... really make sure...

cc-agent/src/task.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Task to complete....
2+
3+
Can you run `act workflow_dispatch -W .github/workflows/e2e-test-suite.yml -j e2e-tests`
4+
5+
## and please get it to work...
6+
7+
You will run on a loop for the next 3 hours. good luck!
8+
9+
If everythig is working and you were able to test it manually, please create a doc in the scratchpad name "./.agent/DONE.md" with proof that everything works well and you were able to reproduce the error and the error is now fixed with a summary of the fixes and all the tests and builds are working
10+
11+
^ It's okay if you did not finish, we will re-run you in a min. Only write the DONE.md if you are 1000000% done
12+
13+
## MAKE SURE YOU ARE 100% done, if not DO NOT write the done file... really make sure...

0 commit comments

Comments
 (0)