From b01814bcb44b4f921ad664eeee17bc502d05b888 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 30 Aug 2026 07:49:12 +0000 Subject: [PATCH] docs: clarify parallel vs Promise.all for heterogeneous agents Promise.all bypasses the shared concurrency limiter, which breaks the Claude dynamic-workflow porting contract. Update the primitive mapping to make the cast approach primary and warn against Promise.all in workflow bodies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- skills/rig/references/claude-workflow-conversion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/rig/references/claude-workflow-conversion.md b/skills/rig/references/claude-workflow-conversion.md index 9d049a2..92f2726 100644 --- a/skills/rig/references/claude-workflow-conversion.md +++ b/skills/rig/references/claude-workflow-conversion.md @@ -34,7 +34,7 @@ Then read [Behavior differences](#behavior-differences-to-keep-in-mind) before y | `await agent(prompt)` | `await call.text(prompt, options?)` | Returns `string \| null` | | `await agent(prompt, { schema })` | `await call.json(prompt, schema, options?)` | `schema` is any `s.*` value (`s.object`, `s.enum`, `s.array`, …); result is typed and validated. Claude workflows only support object schemas; rig accepts any schema type. | | Reused prompt + schema pair | `agent({ input, output, instructions })` then `call(worker, input, options?)` | Preferred for anything invoked more than once | -| `parallel(thunks)` | `parallel(thunks)` | Same barrier semantics; failures become `null` holes. **TypeScript note:** `parallel` uses a single generic `Result` type, so all thunks must return the same type. For agents with different output types, use `Promise.all` (which skips the concurrency limiter) or cast: `parallel([...]) as Promise<[TypeA \| null, TypeB \| null]>`. | +| `parallel(thunks)` | `parallel(thunks)` | Same barrier semantics; failures become `null` holes. **TypeScript note:** `parallel` uses a single generic `Result` type, so all thunks must return the same type. For agents with different output types, cast to preserve limiter semantics: `parallel([...]) as Promise<[TypeA \| null, TypeB \| null]>`. Avoid `Promise.all` in workflow bodies — it bypasses the concurrency limiter and skips the `null`-hole failure model that `parallel` provides. | | `pipeline(items, ...stages)` | `pipeline(items, ...stages)` | Stages receive `(previous, item, index)`; the first stage's `previous` is the item | | `phase(title)` | `phase(title)` | Same | | `{ phase: "Verify" }` on a call | `{ phase: "Verify" }` in call options | Overrides the ambient phase for that call only |