From a428151ad21edc19d9d9c545577ca7929d2f3b24 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:50:50 +0000 Subject: [PATCH] Document missing default Claude model when porting dynamic workflows Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- skills/rig/claude-workflow-conversion.md | 18 +++++++++++++++++- .../samples/411-anthropic-engine-workflow.md | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/skills/rig/claude-workflow-conversion.md b/skills/rig/claude-workflow-conversion.md index 3c7350e..304208e 100644 --- a/skills/rig/claude-workflow-conversion.md +++ b/skills/rig/claude-workflow-conversion.md @@ -33,7 +33,7 @@ Then read [Behavior differences](#behavior-differences-to-keep-in-mind) before y | --- | --- | --- | | `export const meta = { name, description, phases, whenToUse }` | `workflow({ meta: { name, description, phases, whenToUse } })` | `phases` accepts `"Title"` or `{ title, detail }`; `meta` may reference variables | | `args` (JSON string or object) | `input` schema + `context.input` | Parsed and validated by the launcher; no defensive `JSON.parse` | -| `await agent(prompt)` | `await call.text(prompt, options?)` | Returns `string \| null` | +| `await agent(prompt)` | `await call.text(prompt, options?)` | Returns `string \| null`. A call with no `model` uses Rig's default `"small"`, which Anthropic rejects: pass a Claude model id on every call or agent (see [Model defaults](#model-defaults-on-claude)) | | `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, 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. | @@ -248,6 +248,20 @@ Use the `model` field on `agent({ model })` for a stable default, or override per call with `call(agent, input, { model })`. There is no global `effort` knob; pick a model tier that matches the task's quality requirement. +### Model defaults on Claude + +A Claude dynamic workflow's `agent(prompt)` with no `model` runs on the session's +Claude model. Rig has no session model: an `agent()` or `call.text`/`call.json` +without `model` sends `"small"` to the engine, and `anthropicEngine()` forwards it +unchanged, so the Anthropic API rejects the call and `call` returns `null`. +When porting, set `model` on every `agent({ model })` or call, or define the +Claude Sonnet id once and spread it into call options: + +```ts +const sonnet = { model: "claude-sonnet-4-5" }; +const plan = await call.json("Draft a fix plan.", s.object({ plan: s.string }), { ...sonnet, label: "plan" }); +``` + ## Behavior differences to keep in mind - **Failure holes.** `call` returns `null` when an agent fails, and `parallel` @@ -260,6 +274,8 @@ pick a model tier that matches the task's quality requirement. first parameter and access the prior result through it in stage 2+. See [401-multi-stage-pipeline-workflow.md](./samples/401-multi-stage-pipeline-workflow.md) for a worked example. +- **No default Claude model.** Omitting `model` selects `"small"`, not the + session's Claude model; see [Model defaults](#model-defaults-on-claude). - **Budget units.** rig counts agent calls, not tokens, so guard loops with `budget.remaining() > n` where `n` is a call count. - **Nesting depth.** `call.workflow` has no one-level restriction, but it shares diff --git a/skills/rig/samples/411-anthropic-engine-workflow.md b/skills/rig/samples/411-anthropic-engine-workflow.md index 45894bb..d6b10c4 100644 --- a/skills/rig/samples/411-anthropic-engine-workflow.md +++ b/skills/rig/samples/411-anthropic-engine-workflow.md @@ -15,6 +15,9 @@ dynamic workflow. Per-call `{ model }` overrides still work the same way. | Balanced (default for most Claude workflows) | `"sonnet"` | `"claude-sonnet-4-5"` | | Most capable | `"opus"` | `"claude-opus-4-5"` | +Unlike a dynamic workflow's `agent(prompt)`, a Rig call with no `model` uses +`"small"`, which Anthropic rejects, so every call below names a Claude model. + Set `RIG_ENGINE=anthropic` or call `configureAgent(anthropicEngine())` at the top of your program. Requires `ANTHROPIC_API_KEY` in the environment.