| 1 | { |
| 2 | "$schema": "../../node_modules/wrangler/config-schema.json", |
| 3 | "name": "g1t-runner", |
| 4 | "account_id": "1e6f2cffa3f445920836e8ebe446bb58", |
| 5 | "compatibility_date": "2026-09-26", |
| 6 | "main": "./src/index.ts", |
| 7 | "workers_dev": false, |
| 8 | // One image (the base plus the runner binary), on three machine sizes. |
| 9 | // scripts/deploy.mjs deploys with each image set to the reference it |
| 10 | // built and pushed (docs/DEPLOYING.md, "The runner's images"), so a |
| 11 | // deploy builds nothing; "./Dockerfile" here is for building by hand. |
| 12 | "containers": [ |
| 13 | { |
| 14 | "class_name": "AttemptSandbox", |
| 15 | "image": "./Dockerfile", |
| 16 | "instance_type": "standard-1", |
| 17 | "max_instances": 20, |
| 18 | // A deploy replaces sandboxes. Ones that are busy are given this |
| 19 | // long, in seconds, to finish first, so shipping g1t does not |
| 20 | // kill agents in the middle of their work. |
| 21 | "rollout_active_grace_period": 7200 |
| 22 | }, |
| 23 | { |
| 24 | // Workflow jobs with `runs-on: g1t-2core`: 2 vCPU, 8 GiB, 16 GB. |
| 25 | "class_name": "Sandbox2Core", |
| 26 | "image": "./Dockerfile", |
| 27 | "instance_type": "standard-3", |
| 28 | "max_instances": 10, |
| 29 | "rollout_active_grace_period": 7200 |
| 30 | }, |
| 31 | { |
| 32 | // Workflow jobs with `runs-on: g1t-4core`: 4 vCPU, 12 GiB, 20 GB. |
| 33 | "class_name": "Sandbox4Core", |
| 34 | "image": "./Dockerfile", |
| 35 | "instance_type": "standard-4", |
| 36 | "max_instances": 10, |
| 37 | "rollout_active_grace_period": 7200 |
| 38 | } |
| 39 | ], |
| 40 | "durable_objects": { |
| 41 | "bindings": [ |
| 42 | { "name": "SANDBOX", "class_name": "AttemptSandbox" }, |
| 43 | { "name": "SANDBOX_2CORE", "class_name": "Sandbox2Core" }, |
| 44 | { "name": "SANDBOX_4CORE", "class_name": "Sandbox4Core" } |
| 45 | ] |
| 46 | }, |
| 47 | "migrations": [ |
| 48 | { "tag": "v1", "new_sqlite_classes": ["AttemptSandbox"] }, |
| 49 | { "tag": "v2", "new_sqlite_classes": ["Sandbox2Core", "Sandbox4Core"] } |
| 50 | ], |
| 51 | "services": [ |
| 52 | { "binding": "IDENTITY", "service": "g1t-identity" }, |
| 53 | { "binding": "REPOS", "service": "g1t-repos" }, |
| 54 | { "binding": "WORK", "service": "g1t-work" }, |
| 55 | { "binding": "BILLING", "service": "g1t-billing" }, |
| 56 | { "binding": "INTEGRATIONS", "service": "g1t-integrations" }, |
| 57 | { "binding": "ACTIONS", "service": "g1t-actions" }, |
| 58 | { "binding": "DEPLOYMENTS", "service": "g1t-deployments" }, |
| 59 | { "binding": "PROJECTS", "service": "g1t-projects" }, |
| 60 | // The context hub: the Context section every agent run starts with. |
| 61 | { "binding": "CONTEXT", "service": "g1t-context" }, |
| 62 | // The event bus: abuse.flagged, when a sandbox looks like it is mining. |
| 63 | { "binding": "EVENTS", "service": "g1t-events" } |
| 64 | ], |
| 65 | // A sweep for lifecycle steps whose trigger was missed or whose sandbox |
| 66 | // died before reporting, which also starts queued nightly backups. |
| 67 | "triggers": { "crons": ["*/5 * * * *"] }, |
| 68 | // Events it reacts to: a pull request ready for review, or its head moving. |
| 69 | "queues": { |
| 70 | "consumers": [{ "queue": "g1t-events-runner", "max_batch_size": 20, "max_batch_timeout": 1 }] |
| 71 | }, |
| 72 | "vars": { |
| 73 | // Each workspace chooses where its agents' model spend goes: its own |
| 74 | // provider (under Integrations) or g1t's hosted models, paid from its |
| 75 | // credit. While billing takes no real money, hosted models are open |
| 76 | // only to these workspaces; once it does, to every workspace. |
| 77 | "HOSTED_AGENT_WORKSPACES": "flagon-io", |
| 78 | // How g1t routes agent work: "Auto" (AgentRouting and route in |
| 79 | // src/model-env.ts). Nobody assigning an agent has to choose; a workspace |
| 80 | // can still choose a tier per kind of work under Integrations. Staff |
| 81 | // choose each tier's model, the background model and each job's tier and |
| 82 | // effort in sudo (Agents & models; billing's model_defaults), which the |
| 83 | // runner reads once a minute and puts on top of this. So "tiers", "tasks" |
| 84 | // and "effort" here apply only while billing cannot be read; the labels, |
| 85 | // change sizes, "frontierAfter" and "learning" always do. "tiers": the |
| 86 | // catalogue, the model behind small (fast), large (standard) and frontier |
| 87 | // (most capable); "modelName" is shown to people, "model" is sent to the |
| 88 | // provider, "price" (dollars per million tokens) is for estimates only. |
| 89 | // "tasks": the tier each kind of job starts on, or "change" to size the |
| 90 | // change a review reads ("smallChange" or less and nothing sensitive: small; |
| 91 | // more than "largeChange": frontier). "frontierLabels", "largeLabels" and |
| 92 | // "smallLabels" move work by its issue's labels. A failed attempt goes one |
| 93 | // tier up and "frontierAfter" failures in a row to frontier; "learning" |
| 94 | // steps work down or up by the repository's own recent runs of the kind. |
| 95 | "AGENT_ROUTING": "{\"tiers\":{\"small\":{\"modelName\":\"Claude Haiku 5.5\",\"model\":\"claude-haiku-5-5\",\"price\":{\"input\":0.1,\"output\":0.5,\"cacheRead\":0.01,\"cacheWrite\":0.125}},\"large\":{\"modelName\":\"Claude Sonnet 5.5\",\"model\":\"claude-sonnet-5-5\",\"price\":{\"input\":2,\"output\":10,\"cacheRead\":0.1,\"cacheWrite\":2.5}},\"frontier\":{\"modelName\":\"Claude Opus 5.5\",\"model\":\"claude-opus-5-5\",\"price\":{\"input\":4,\"output\":20,\"cacheRead\":0.2,\"cacheWrite\":5}}},\"tasks\":{\"implement\":\"large\",\"revise\":\"large\",\"answer\":\"small\",\"review\":\"change\",\"update\":\"small\",\"plan\":\"small\"},\"effort\":{\"plan\":\"high\",\"answer\":\"medium\",\"update\":\"low\"},\"smallChange\":{\"files\":10,\"lines\":200},\"largeChange\":{\"files\":60,\"lines\":3000},\"largeLabels\":[\"security\"],\"frontierLabels\":[\"architecture\"],\"smallLabels\":[\"documentation\",\"docs\",\"typo\"],\"frontierAfter\":2,\"learning\":{\"window\":20,\"minRuns\":5,\"stepDownAt\":0.9,\"stepUpAt\":0.5}}", |
| 96 | // Where sandboxes send model requests, with a token for their run. |
| 97 | // The proxy holds the keys: g1t's gateway's, or the workspace's own. |
| 98 | "MODELS_URL": "https://models.g1t.sh", |
| 99 | // Set to a Cloudflare AI Gateway id to route model traffic through it. |
| 100 | // Used only when MODELS_URL is unset. |
| 101 | "AI_GATEWAY_ID": "g1t", |
| 102 | "CLOUDFLARE_ACCOUNT_ID": "1e6f2cffa3f445920836e8ebe446bb58", |
| 103 | // Guardrails' network list is enforced by starting sandboxes without |
| 104 | // internet and passing their HTTP(S) through this Worker. "off" opens |
| 105 | // every sandbox's network again, whatever its guardrails say. |
| 106 | "EGRESS": "enforce", |
| 107 | // Sandboxes stop themselves when they look like they are mining |
| 108 | // (crates/runner abuse.rs). "off" turns the CPU watch off; miners |
| 109 | // named in commands are refused either way. |
| 110 | "ABUSE_WATCH": "on", |
| 111 | // Nightly backups (src/backup.ts): each sweep starts this many of the |
| 112 | // backups the repos service queued, with at most BACKUPS_RUNNING at |
| 113 | // once. "0" starts none. |
| 114 | "BACKUPS_PER_SWEEP": "4", |
| 115 | "BACKUPS_RUNNING": "6" |
| 116 | }, |
| 117 | "observability": { "enabled": true } |
| 118 | } |