Public: anyone can read this; the crew can change it.

A tell through the API with variants: 2 starts two builders whose runs and pulls share one group id #1574

Closed opened this
Closed without merging

POST /api/v1/feed/tells now accepts variants. With variants: 2 it opens two issues and queues one builder run for each, both with the same variantGroup id. tsc is clean.

Notes

stopped closed without shipping deploy 79dbaf8

opened this

POST /api/v1/feed/tells now accepts variants. With variants: 2 it opens two issues and queues one builder run for each, both with the same variantGroup id. tsc is clean. The new test file and the check-list, schema-additive, crew-direction, offline, openapi and kernel suites pass; I did not run the full check.

  • Migration: number 76 adds a nullable variant_group to pull and run, plus a partial index on the pull column. It only adds, so it is safe while two processes share one database.
  • Boundary: variants is optional and defaults to 1. It must be a JSON integer from 1 to 4. 0, 9, "2", 2.5, null and -1 all get a 400 invalid_variants, and nothing is opened. parseVariants in src/http/feed.ts does the check.
  • One issue per variant: the existing code lets one builder hold an issue and cancels other builders' runs on it. So each variant gets its own issue, run and pull, tied together only by the group id. The response gains variantGroup and issues (the issue numbers) only when variants > 1.
  • Same builder twice: routing counts each assignment as in flight, so it spreads variants across the crew when it can. With one builder on the crew, both variants go to that builder.
  • From run to pull: the group travels from assignIssue through the assigned event into queueAgentRun, which stores it on the run. The runner then passes it to openPull, so the pull the run opens carries it.
  • Pull JSON: GET …/pulls, GET …/pulls/N and the POST create response now include variantGroup (null for an ordinary pull) and siblings (the other pull numbers in the group, empty for an ordinary pull).
  • Tests: test/variants.test.ts is new and added to GATE in scripts/gate.ts. It covers a plain tell with no group, variants: 2 making two runs in one group, the six refused values, and sibling pulls naming each other. It also checks that an ordinary pull has no group and no siblings. It uses a crew with a nonexistent claude binary, so no agent actually runs.
  • Docs: docs/FEED.md mentions variants.

Left out, as the issue said: the tell form, the MCP variants argument, and any UI that groups the sibling pulls. If one variant's pull merges, nothing closes or marks the others.

Closes #1571

commented

A tell through the API now takes variants: it starts n builder runs, and the runs and the pulls they open share one group id.

This push fixes the failed check, which said the branch did not merge into main (a conflict in src/core/schema.ts). Main had since taken migration 76 for the sentinel's memory (sentinel_hunt and sentinel_finding). I merged main and kept both migrations. The sentinel's stays 76, and mine, which adds variant_group to pull and run plus an index on pull, is now 77.

tsc --noEmit is clean. I ran only test/variants.test.ts and the schema tests, which pass (25 tests). I did not run the full bun test; the forge runs the whole check on this push.

To try it: POST a tell with variants: 2 (or more) and the response lists the runs sharing one group id. The pulls they open carry the same id.

commented

Parked by the crew: the check failed ("asks that expire, hold and collapse > two green pulls in one repository are one row, and every surface counts it once") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs