Run python -m pytest tests/ -v before committing. All tests must pass.
Tests run inside Docker: docker compose exec app python -m pytest tests/ -v
(may need pip install pytest pytest-asyncio first if the container was rebuilt).
The simulation runs in a one-off container named agent-run:
# Resume an existing run (no budget limit):
docker compose --profile agent run -d --name agent-run agent python -m src.agent.main --budget 0
# Resume with a budget cap (e.g. 50 LLM calls per agent):
docker compose --profile agent run -d --name agent-run agent python -m src.agent.main --budget 50
# Fresh run (wipes agent_messages/channels, keeps proposals):
docker compose --profile agent run -d --name agent-run agent python -m src.agent.main --fresh --budget 0
# With a time limit (minutes):
docker compose --profile agent run -d --name agent-run agent python -m src.agent.main --max-runtime 60 --budget 0Before restarting, always save logs and rebuild containers:
# 1. Save logs
docker logs agent-run > logs/run_$(date +%s).log 2>&1
ls -t logs/run_*.log | tail -n +11 | xargs rm -f
# 2. Stop the old container
docker rm -f agent-run
# 3. Rebuild app + worker (picks up code changes)
docker compose up -d --build app worker
# 4. Start the new run
docker compose --profile agent run -d --name agent-run agent python -m src.agent.main --budget 0Note: The agent-run container uses mounted source code but the Python process only loads modules at startup. Code changes require a container restart to take effect. After any code change that affects the running agent process, flag this to the user so they can decide whether to restart.
Follow these steps in order. Steps 1-2 can be done immediately; steps 3-4 when ready to activate the agent.
Look up each PI's ORCID ID (search orcid.org or the ORCID public API). Add them to orcids.txt with a comment line, then seed:
docker compose exec app python -m src.cli seed-profiles --file new_orcids.txtThis creates User rows and enqueues profile generation jobs (processed by the worker).
Each agent needs an AgentRegistry row with a unique agent_id (lowercase last name) and bot_name ({LastName}Bot).
Last-name collisions: If a last name is already taken (e.g., Chunlei Wu = wu), prefix with the first initial (e.g., Peng Wu = pwu / PWuBot). The web UI (src/routers/agent_page.py) applies this same logic automatically for self-service signups.
New entries should have status='pending' until Slack tokens are configured.
Create a Slack bot token for each agent and add to the settings/env config. Each agent needs its own bot token keyed by agent_id.
Add entries to PILOT_LABS in src/agent/simulation.py:
{"id": "lastname", "name": "LastNameBot", "pi": "First Last"},Then restart the simulation (see "Running the Agent Simulation" above).