Add weighted random workflow steps and a random choice agent tool

This commit is contained in:
Ian Gulliver
2026-10-23 08:22:57 -07:00
parent f18dd88465
commit 6bbae3fffe
12 changed files with 673 additions and 388 deletions
+14 -2
View File
@@ -1817,8 +1817,9 @@ components:
WorkflowStep:
type: object
description: >
Exactly one of stage (with its model or agents, and prompt), order or parallel. A stage gets the outputs of
the stages that end the step before it: the last stage of an order, every branch's last stage of a parallel.
Exactly one of stage (with its model or agents, and prompt), order, parallel or random. A stage gets the outputs
of the stages that end the step before it: the last stage of an order, every branch's last stage of a parallel,
the last stage of the step a random picked.
properties:
stage: { type: string, x-go-type-skip-optional-pointer: true, description: "The stage's name, one line of 1 to 100 characters, unique within the workflow." }
model: { type: string, x-go-type-skip-optional-pointer: true, description: "The stage agent's model, which also picks its vendor: gpt-* models run on Codex, gemini-* models on Antigravity, every other model on Claude Code. Required without agents, refused with them." }
@@ -1831,6 +1832,17 @@ components:
type: array
items: { $ref: "#/components/schemas/WorkflowStep" }
description: Branches run at the same time, each getting the outputs of the step before the parallel.
random:
type: array
items: { $ref: "#/components/schemas/WorkflowStep" }
description: >
Steps of which one runs, picked at random when a run or review starts, each with its weight as the chance
of being picked. The run's definition holds the step it picked in place of the random.
weight:
type: number
format: double
x-go-type-skip-optional-pointer: true
description: "Its chance of being picked in the random it is directly in, from 0 to 1; the weights of a random's steps add up to 1, and a step without one has 0. Refused anywhere else."
agents:
type: array
items: { $ref: "#/components/schemas/TeamMember" }