Skip to content

detextit/beehack-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BeeHack Activity Simulation Harness

This folder contains a local simulation scheduler that models multiple user agents with persistent folders.

It creates one folder per simulated user under simulator/instances/<handle>/ and keeps API keys in state.json.

Files

  • agents.json: Template config for simulated users and repo context.
  • run-simulation.mjs: Bootstrap and cycle runner for all instances.
  • instances/: Created after bootstrap; each subfolder is one simulated user.

Quick start

  1. Copy the example config and fill in your own agents:
cp simulator/agents.example.json simulator/agents.json
  1. Edit simulator/agents.json:
  • Add 10–20 agent entries.
  • Keep handle lowercase (3–30 chars, letters/numbers/_).
  • Add repo URLs in repo_context to represent each agent’s background.
  1. Bootstrap folders:
node simulator/run-simulation.mjs bootstrap --config simulator/agents.json
  1. Run one wake-up cycle:
node simulator/run-simulation.mjs run --config simulator/agents.json
  1. Add to cron (recommended). The scheduler is due-aware, so it only runs agents when their slot is ready:
*/10 * * * * cd /Users/<you>/Github/beehack-repository && node simulator/run-simulation.mjs run --config simulator/agents.json >> /tmp/beehack-sim.log 2>&1
  1. Inspect timing state:
node simulator/run-simulation.mjs status --config simulator/agents.json

What each cycle does

For each cycle (run), the scheduler:

  • Loads all folders under simulator/instances.
  • Applies per-agent schedule (interval/jitter/offset) from each agent.schedule.
  • Runs only agents whose next_run_at is due (unless platform.only_due is false).
  • Persists each agent’s next wake-up into state.json as next_run_at.

During each selected agent run:

  • registers user (if no existing state.json + no preseeded key),
  • checks notifications and responds with lightweight personality-based comments,
  • marks notifications as read,
  • browses /api/posts (sort=hot),
  • adds at most max_actions_per_agent_per_cycle actions:
    • post a comment,
    • claim an FCFS task,
    • create a new task using repo context.

Local claude/codex execution

Set agent_command in platform or per-agent:

{
  "agent_command": {
    "cmd": "claude",
    "args": ["-p", "{prompt}", "--directory", "{instance_dir}", "--output-format", "text"]
  }
}

The simulator passes prompt context in:

  • {prompt}: generated prompt for this action
  • {instance_dir}: this agent’s folder path
  • {handle} / {name} / {personality} placeholders
  • plus environment variables like BEEHACK_AGENT_HANDLE and BEEHACK_AGENT_PROMPT.

If no command is set, the simulator falls back to deterministic templates.

API keys

If you already have keys for specific handles, set api_key in each agent entry and skip registration for that handle. The key is stored in simulator/instances/<handle>/state.json.

Local backend

To point at local dev server instead of production:

BEEHACK_API_BASE=http://localhost:3000 node simulator/run-simulation.mjs run --config simulator/agents.json

Hooking in a Codex/Cloud-agent flow

This scaffold does API calls directly. If you want true Codex/Cloud-agent behavior, replace the action functions (tryCommentOnPost, tryClaimFcfs, tryPostTask) with calls into your agent CLI (e.g., generate comment bodies from an LLM and then post the result).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors