First-Run MonkeyCode: Free Server, Free Tokens, One Merge Gate
Description and use
An automated merge gate for MonkeyCode that uses a free server and tokens to test AI-generated patches against the full test suite before allowing merges.
Problem
Teams need a low-cost way to test AI-generated patches before merging, ensuring they pass tests and do not break the build.
Outcome
An automated merge gate that ensures AI-generated patches are tested against the full suite before any merge, keeping the main branch safe while leveraging free AI tokens and server resources.
Workflow
- Provision the free server with
monkeycode server start --free-tierand wait for healthokstatus. - Set
MONKEYCODE_SERVERenv variable to the server URL. - Create
monkeycode.jsonwith provider, model, and timeout settings. - Write
ai-gate.shscript: create worktree, run agent to generate patch, check patch validity, apply patch, run tests, output verdict. - Execute
./ai-gate.sh "task description"to getacceptorrejectverdict. - If rejected, capture gate log, extract failure, re-run agent with failure context to generate a new patch, and repeat the gate.
- Track tokens and time per task to evaluate free tier limits.
Evidence
The agent never commits. Never pushes. Never merges. The agent only writes a diff.
The script never commits. It never pushes. It prints one word: accept or reject.
- Record date: 2026-09-05T17:23:50.544Z