Skip to content
Myr

Wait for a claim's fork before cloning it, and run the swarm's tamsin on OpenCode Go's gpt-6-luna

Before adoption: this commit came in with the history the project adopted, so no landing records it.

- Found in the swarm's first live run on dev-oscabriel (804, 16:31 UTC, six claims at once on a seed --as copy of burrow): ivo's claim came back with its fork's remote, but the clone a second later got `remote: no repo …` and `fatal: repository '…' not found`; the fork answered with ivo's token 20 s later. A claim returns before its outbox has made the fork, and an Artifacts fork that fails under load (S7) is made again only at the Project's next alarm, with backoff. ivo's run ended failed with 0 attempts. - prepareWorkspace now tries the clone again while git says the repo is not found: every ForkWait (a Context.Reference, 2 s by default) after the first, FORK_TRIES (30) more at most, about a minute. Any other failure (a 403, an auth error) still fails at once. - Tests, red first by assertion (a planted `times: 0` fails both again): swarm.test.ts "clones again while the fork is not made yet…" (two 404s, then a clone: three clones and a workspace) and "stops waiting for the fork after 30 more tries, and never clones again for any other failure" (31 clones, then SwarmFailed naming the 404; one clone on a 403). Both run live with ForkWait at 1 ms. The fake spawner gives stderr and how many commands came before. - tamsin: OpenCode's ChatGPT sign-in hit its usage limit in the same run (provider.quota, "The usage limit has been reached"); Codex on the same account says it is back on Oct 16, after the deadline, so the take could not run it. tamsin now runs opencode-go/gpt-6-luna (OpenCode Go is signed in; one headless probe answered). Putting openai/gpt-5.5 back is the roster's one line once the plan has headroom (a purchase, the user's). - Tests for the swap, red first (5 failing before the roster changed): the roster's regex for OpenCode's GPT, the dry-run row, the herdr pane's inline config, the driver's start and resume argv, and demo-docs.test.ts's hold on swarm-scenario.md's table. - docs/demo/swarm-scenario.md, rehearsal.md and infra/stages.md say what changed and why, and how to swap back.

authored by oscabriel · committed by oscabriel · parent 25a727e · Browse files · 8 files+156 added−25 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

8 files+156 added−25 removed

  • tests:+103 added−13 removed
  • other:+53 added−12 removed

8 files+156 added−25 removed

modified:docs/demo/rehearsal.md+1 added-1 removed
modified:docs/demo/swarm-scenario.md+2 added-2 removed
9 unmodified lines
1011| # | Contributor | Harness | Model | Adapter | Child (when all six are open) |12| --- | --- | --- | --- | --- | --- |13| 1 | wren | Claude Code, as it ships | `claude-opus-5-5` | none | `drop-legacy-fetch-burrow-auth` |14| 2 | tamsin | OpenCode | `openai/gpt-5.5` | none | `drop-legacy-fetch-burrow-billing` |14| 2 | tamsin | OpenCode | `opencode-go/gpt-6-luna` | none | `drop-legacy-fetch-burrow-billing` |15| 3 | ivo | Amp | `medium` (one of its modes) | none | `drop-legacy-fetch-burrow-catalog` |16| 4 | marisol | pi | `opencode-go/kimi-k3` | none | `drop-legacy-fetch-burrow-kit` |17| 5 | dagny | pi | `opencode-go/glm-5.3` | none | `drop-legacy-fetch-burrow-notify` |18| 6 | pell | pi | `opencode-go/qwen3.8-flash` | the pi adapter (`-e`): the brief, the scope guard and a verdict gate | `drop-legacy-fetch-burrow-search` |1920Each handle and model id is the one `scripts/lib/swarm/roster.ts` holds, word for word; the plan prints them (S09), and that printout is what the video shows. pell ran OpenCode Zen's Gemini flash (`opencode/gemini-3.8-flash`) until 2026-10-08, when the swarm's live rehearsal swapped it for `opencode-go/qwen3.8-flash`: pi on this machine has no OpenCode Zen key, and the qwen flash runs headless with the adapter. Putting Gemini back is the one-line swap in the roster, once the key is in pi on the machine that runs the take.20Each handle and model id is the one `scripts/lib/swarm/roster.ts` holds, word for word; the plan prints them (S09), and that printout is what the video shows. Two models changed in the swarm's live rehearsal on 2026-10-08, each a one-line swap back in the roster. tamsin ran `openai/gpt-5.5` on OpenCode's ChatGPT sign-in until that account's usage limit ran out (ChatGPT says it is back on Oct 16, after the deadline); OpenCode Go's `opencode-go/gpt-6-luna` runs headless in its place. pell ran OpenCode Zen's Gemini flash (`opencode/gemini-3.8-flash`), which pi on this machine cannot reach without OpenCode Zen's key; `opencode-go/qwen3.8-flash` runs headless with the adapter.2122Every agent gets the same zero-install brief: the ask as its page says it, the fork's remote, and the loop the project's AGENTS.md gives (claim, work inside the territory, `myr check`, push, read the verdict). Nothing about the gate's internals.2324## The plan for the burrow family
69 unmodified lines
modified:infra/stages.md+1 added
122 unmodified lines
123| H6: Workers Paid | Confirmed. | The account's subscriptions, read again on 2026-10-08, list `workers_paid` as Paid. The sandbox (containers) and both Workflows have run on `dev-oscabriel` since 2026-10-07. | Nothing. |124| H7: the recording | Open (Oct 13). | `docs/demo/` holds the script, the shot list and the rehearsal checklist. The demo stage is deployed and seeded (2026-10-08, 15:44 UTC), with nothing claimed; the rehearsal comes next. The recording lock exists: while `infra/.recording` is there, `infra/deploy.ts` refuses every deploy. | Run `bun infra/recording.ts on` before the first take and `bun infra/recording.ts off` after the last (the rehearsal checklist says when). |125| H8: submitting | Open, due Oct 14 by noon PDT. | The demo URL is `https://web-demo.oscargabriel.workers.dev` (section 6). | Submit the repo URL, the video and the demo URL. |126| H9: `docker login` | Not needed so far. No image pull has been rate-limited. | Nothing. | Only if a deploy's image pull is rate-limited: run `docker login` in your own terminal. |127| ChatGPT usage for the swarm's tamsin | Not blocking: the fallback was taken on 2026-10-08. | OpenCode's ChatGPT sign-in hit its usage limit during the swarm's live rehearsal, and Codex says it is back on Oct 16, after the deadline. The roster now runs tamsin on `opencode-go/gpt-6-luna` (OpenCode Go, signed in). | Nothing. To show `openai/gpt-5.5` in the take instead, raise the ChatGPT plan's limit (a purchase, yours to make) and swap the roster's one line back. |128| OpenCode Zen key for the swarm's pell | Not blocking: the fallback was taken on 2026-10-08. | pi here still has no OpenCode Zen key, so the roster now runs pell on `opencode-go/qwen3.8-flash`, as it ran in the swarm's live rehearsal on `dev-oscabriel`. | Nothing. To show Gemini flash in the take instead, add OpenCode Zen's key to pi and swap the roster's one line back. |129| Deleting the throwaways | Open, after the rehearsal. | The teardown plan (section 4). | Read the teardown script and run it in your own terminal. |130131## 6. URLs
123 unmodified lines
modified:packages/config/test/swarm-herdr.test.ts+3 added-1 removed
177 unmodified lines
178 },179 {180 argv: ["--standalone", "--auto"],181 // OpenCode's interface takes no model flag: its inline config does.182 env: { OPENCODE_CONFIG_CONTENT: '{"model":"openai/gpt-5.5"}' },182 env: {183 OPENCODE_CONFIG_CONTENT: '{"model":"opencode-go/gpt-6-luna"}',184 },185 kind: "opencode",186 },187 {188 argv: [
1102 unmodified lines
modified:packages/config/test/swarm-loop.test.ts+2 added-2 removed
916 unmodified lines
917 "--format",918 "json",919 "--auto",920 "-m",921 "openai/gpt-5.5",921 "opencode-go/gpt-6-luna",922 "-s",923 "S-1",924 "Fix it.",925 ],
4 unmodified lines
930 "--format",931 "json",932 "--auto",933 "-m",934 "openai/gpt-5.5",934 "opencode-go/gpt-6-luna",935 "Answer it.",936 ],937 },938 {
192 unmodified lines
modified:packages/config/test/swarm.test.ts+98 added-10 removed
13 unmodified lines
14import {15 Array,16 ConfigProvider,17 Console,18 Duration,19 Effect,20 FileSystem,21 Layer,22 Option,
23 unmodified lines
46} from "../../../scripts/lib/swarm/results.ts";47import { roster } from "../../../scripts/lib/swarm/roster.ts";48import type { Contributor } from "../../../scripts/lib/swarm/roster.ts";49import { nudges } from "../../../scripts/lib/swarm/scenario.ts";50import {51 ForkWait,52 prepareWorkspace,49import { prepareWorkspace } from "../../../scripts/lib/swarm/workspace.ts";53} from "../../../scripts/lib/swarm/workspace.ts";54import { main } from "../../../scripts/swarm.ts";55import { Brand } from "../../brand/src/index.ts";56import { repoRoot } from "./root.ts";57
306 unmodified lines
364365 // An Anthropic id, OpenCode's GPT, an Amp mode, then pi's three.366 const models = [367 /^claude-/u,364 /^openai\/gpt-/u,368 /^opencode-go\/gpt-/u,369 /^(?:low|medium|high|ultra)$/u,370 /\/kimi-k3$/u,371 /\/glm-5\.3$/u,372 /\/qwen[\d.]+-flash$/u,
107 unmodified lines
480481/**482 * A `ChildProcessSpawner` that runs nothing: it records each command and483 * answers with what `answer` gives it (exit 0 and no output by default).484 * `answer` also gets how many commands came before this one.485 */486const fakeSpawner = (482 answer: (spawned: Spawned) => {487 answer: (488 spawned: Spawned,489 before: number490 ) => {491 readonly code?: number;492 readonly stdout?: string;493 readonly stderr?: string;494 } = () => ({})495) =>496 Effect.gen(function* () {497 const spawned = yield* Ref.make<readonly Spawned[]>([]);
10 unmodified lines
508 cwd: command.options.cwd,509 env: command.options.env ?? {},510 };511503 yield* Ref.update(spawned, (calls) => [...calls, call]);512 const before = (yield* Ref.getAndUpdate(spawned, (calls) => [513 ...calls,514 call,515 ])).length;516505 const { code = 0, stdout = "" } = answer(call);517 const { code = 0, stderr = "", stdout = "" } = answer(call, before);518 const out = Stream.make(new TextEncoder().encode(stdout));519 const err = Stream.make(new TextEncoder().encode(stderr));520521 return ChildProcessSpawner.makeHandle({522 all: out,523 exitCode: Effect.succeed(ChildProcessSpawner.ExitCode(code)),
1 unmodified line
525 getOutputFd: () => Stream.empty,526 isRunning: Effect.succeed(false),527 kill: () => Effect.void,528 pid: ChildProcessSpawner.ProcessId(1),516 stderr: Stream.empty,529 stderr: err,530 stdin: Sink.drain,531 stdout: out,532 unref: Effect.succeed(Effect.void),533 });
27 unmodified lines
561});562563const wrensToken = "wren-token-0123456789abcdef0123456789abcdef";564552/** wren's workspace for run `r1`, below a temp dir, over a fake spawner. */553const wrensWorkspace = (code = 0) =>565/** What git prints when the gateway answers 404 for the fork: it is not made yet. */566const forkNotMade = `remote: no repo ${wrensClaim.fork}567fatal: repository '${wrensClaim.remote}/' not found568`;569570/**571 * wren's workspace for run `r1`, below a temp dir, over a fake spawner572 * whose every clone exits `code`, or answers as `clone` says (given how573 * many clones came before it).574 */575const wrensWorkspace = (576 code = 0,577 clone: (before: number) => {578 readonly code?: number;579 readonly stderr?: string;580 } = () => ({ code })581) =>582 Effect.gen(function* () {583 const fs = yield* FileSystem.FileSystem;584 const swarm = yield* fs.makeTempDirectoryScoped();557 const fake = yield* fakeSpawner(() => ({ code }));585 const fake = yield* fakeSpawner((_, before) => clone(before));586587 const [wren] = roster;588589 const workspace = yield* prepareWorkspace({
117 unmodified lines
707 expect(reason).toContain(wrensClaim.remote);708 expect(reason).not.toContain(wrensToken);709 }).pipe(Effect.scoped, Effect.provide(NodeServices.layer))710 );711712 it.live(713 "clones again while the fork is not made yet, since the claim returns before its outbox makes the fork",714 () =>715 Effect.gen(function* () {716 // Found live (804): one of six claims at once came back before717 // Artifacts had its fork, and the clone answered 404.718 const { spawned, workspace } = yield* wrensWorkspace(0, (before) =>719 before < 2 ? { code: 128, stderr: forkNotMade } : { code: 0 }720 );721722 expect({723 clones: spawned.map(({ args }) => args[0]),724 made: Result.isSuccess(workspace),725 }).toStrictEqual({726 clones: ["clone", "clone", "clone"],727 made: true,728 });729 }).pipe(730 Effect.scoped,731 Effect.provideService(ForkWait, Duration.millis(1)),732 Effect.provide(NodeServices.layer)733 )734 );735736 it.live(737 "stops waiting for the fork after 30 more tries, and never clones again for any other failure",738 () =>739 Effect.gen(function* () {740 const waited = yield* wrensWorkspace(0, () => ({741 code: 128,742 stderr: forkNotMade,743 }));744745 const once = yield* wrensWorkspace(0, () => ({746 code: 128,747 stderr:748 "remote: wren may not read it\nfatal: unable to access it: The requested URL returned error: 403\n",749 }));750751 expect({752 neverMade: Option.map(753 Result.getFailure(waited.workspace),754 ({ reason }) => reason.includes("not found")755 ),756 neverMadeClones: waited.spawned.length,757 refusedClones: once.spawned.length,758 refusedFailed: Result.isFailure(once.workspace),759 }).toStrictEqual({760 neverMade: Option.some(true),761 neverMadeClones: 31,762 refusedClones: 1,763 refusedFailed: true,764 });765 }).pipe(766 Effect.scoped,767 Effect.provideService(ForkWait, Duration.millis(1)),768 Effect.provide(NodeServices.layer)769 )770 );771});772773describe("the run's summary", () => {774 it.effect(
283 unmodified lines
1058 ],1059 [1060 "tamsin",1061 "opencode",974 "openai/gpt-5.5",1062 "opencode-go/gpt-6-luna",1063 children[1],1064 "@burrow/billing",1065 ],1066 ["ivo", "amp", "medium", children[2], "@burrow/catalog"],
407 unmodified lines
modified:scripts/lib/swarm/roster.ts+7 added-6 removed
5 unmodified lines
6 *7 * The model ids are what this machine's harnesses list and run (2026-10-08):8 * `opencode models` for OpenCode's GPT model, `pi --offline --list-models`9 * for pi's (its ready provider is `opencode-go`), `amp --help` for Amp's10 * modes. OpenCode signed in with a ChatGPT account refuses11 * `openai/gpt-6.1-sol` ("not supported when using Codex with a ChatGPT12 * account"), so tamsin runs `openai/gpt-5.5`, which ran headless.10 * modes. tamsin ran `openai/gpt-5.5` on OpenCode's ChatGPT sign-in until11 * that account's usage limit ran out in the swarm's live rehearsal (804,12 * not back before Oct 16); OpenCode Go's `gpt-6-luna` ran headless in its13 * place, and putting the ChatGPT model back is tamsin's one line.14 */15import { Handle } from "@repo/protocol/ids";16import { Schema } from "effect";17
6 unmodified lines
24 /** A fictional person: a key of the stage's `SESSION_TOKENS` (human step H5 on demo). */25 handle: Handle,26 harness: Harness,27 /**27 * Claude Code: an Anthropic model id. OpenCode: `openai/<gpt id>`. Amp: its28 * mode. pi: `<provider>/<id>`.28 * Claude Code: an Anthropic model id. OpenCode: `<provider>/<gpt id>`.29 * Amp: its mode. pi: `<provider>/<id>`.30 */31 model: Schema.NonEmptyString,32});33
21 unmodified lines
55 {56 adapter: false,57 handle: Handle.make("tamsin"),58 harness: "opencode",58 model: "openai/gpt-5.5",59 model: "opencode-go/gpt-6-luna",60 },61 {62 adapter: false,63 handle: Handle.make("ivo"),
25 unmodified lines
modified:scripts/lib/swarm/workspace.ts+42 added-3 removed
6 unmodified lines
7 * as `<SLUG>_TOKEN`, never in a file, an argv or a URL.8 */9import { Brand } from "@repo/brand";10import type { ClaimView } from "@repo/protocol/domain/claim";11import { Config, Effect, FileSystem, Redacted, Schema, Stream } from "effect";11import {12 Config,13 Context,14 Duration,15 Effect,16 FileSystem,17 Redacted,18 Schedule,19 Schema,20 Stream,21} from "effect";22import { ChildProcess, ChildProcessSpawner } from "effect/process";2324import { runDir } from "./results.ts";25import type { Contributor } from "./roster.ts";
146 unmodified lines
172 )173 );174175/**176 * How long a clone waits for the claim's fork: one try every `ForkWait`177 * (2 s unless a test says otherwise) after the first, `FORK_TRIES` more at178 * most, so about a minute. A claim returns before its outbox has made the179 * fork, and an Artifacts fork that failed under load is made again only at180 * the Project's next alarm, with backoff. Found live (804): one of six181 * claims made at once was cloned too soon.182 */183export const ForkWait = Context.Reference<Duration.Duration>("swarm/ForkWait", {184 defaultValue: () => Duration.seconds(2),185});186187export const FORK_TRIES = 30;188189/** git's words when the gateway answers 404: the repo is not there (yet). */190const NOT_FOUND = /^fatal: repository '.*' not found$/mu;191192/** A clone that failed only because the fork is not made yet. */193const forkNotMadeYet = (ran: Ran) =>194 ran.code !== 0 && NOT_FOUND.test(ran.stderr);195196/**197 * Makes one contributor's workspace for their claim, below `<swarm>/<run>/`:198 *199 * - `bin/<cli>` and `bin/git-credential-<slug>`, shims that run this repo's200 * CLI from source (the helper as `<cli> credential`), first on `PATH`;
1 unmodified line
202 * helper reads the user's own login (HOME stays the user's: the203 * harnesses' own sign-ins live there);204 * - `clone/`, the claim's fork, cloned with the helper in its config for205 * the platform (after an empty helper that drops any other, as `login`175 * sets it globally), and the person as its author;206 * sets it globally), and the person as its author; while the fork is not207 * made yet, the clone is tried again (`ForkWait`, `FORK_TRIES`);208 * - the env: `PATH`, git's non-interactive settings, `XDG_CONFIG_HOME`, and209 * the person's token and platform as `<SLUG>_TOKEN` and `<SLUG>_URL`.210 */211export const prepareWorkspace = (input: {
63 unmodified lines
275 redacted: [TOKEN_VARIABLE],276 };277278 const credential = `credential.${input.platformUrl}`;279 const forkWait = yield* ForkWait;280281 const cloned = yield* run({282 args: [283 "clone",
11 unmodified lines
295 ],296 command: "git",297 cwd: dir,298 env,266 });299 }).pipe(300 Effect.repeat({301 schedule: Schedule.spaced(forkWait),302 times: FORK_TRIES,303 while: forkNotMadeYet,304 })305 );306307 if (cloned.code !== 0) {308 return yield* new SwarmFailed({309 reason: scrubbed(
8 unmodified lines