Skip to content

Commit 7074816

Browse files
docs(relayflows): define the agent's CLI inline in the intro example
The intro's 'A whole flow' example called f.agent('greeter', {...}) / had an agent step named greeter without ever showing which CLI or model it actually runs on, which read as if 'greeter' had to be declared somewhere else. Fixed by showing the real, verified mechanism for each dialect: - YAML: AgentStepSpec has its own cli?/model? fields (packages/sdk/src/spec.ts lines 184/191) — added cli: claude / model: claude-sonnet-4-6 directly on the greeter step. Confirmed real via packages/sdk/src/preflight.ts's CLI resolution order (step > named > flow > project). - TypeScript: Ctx.agent's AgentOptions is only { task, workspace? } (packages/surface/src/context.ts) — there is no cli/model field to add. What actually happens, per packages/sdk/src/authored-flow-executor.ts's comments ('The kernel never resolves a cli on its own... searching for the nearest flows.json from flowPath'), is that CLI/model resolve from the project's flows.json. Added that file's real shape ({ cli, models }, validated in packages/sdk/src/cli/check.ts) and the real refusal code (agent_cli_unresolved) it produces when missing. No fabricated TypeScript API added — verified both mechanisms by reading the actual source before writing the docs. Verified: cd web && npx tsc --noEmit -p . -> exit 0 cd web && npx vitest run -> 11 files, 32 passed cd web && npm run build -> exit 0 grep against .next/server/app/docs/relayflows/introduction.html confirms 'flows.json', 'claude-sonnet-4-6', and 'agent_cli_unresolved' all render on the built page. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2352509 commit 7074816

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎web/content/docs/relayflows/introduction.mdx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,24 @@ steps:
4747
type: agent
4848
dependsOn: [greeting]
4949
instruction: 'Reply with one short hello sentence. Do not use tools or modify files.'
50+
cli: claude
51+
model: claude-sonnet-4-6
5052
```
5153
</CodeGroup>
5254
5355
`f.run` (a `deterministic` step in YAML) executes a shell command and returns its output. `f.agent` (an `agent` step) hands a task to a coding agent and returns a summary rather than a raw transcript. `f.done` finishes the run with one reason from a closed set: `success`, `step_failed`, `canceled`, or `budget_exceeded`. There's no fifth option to guess about.
5456

57+
The YAML step above names its own `cli` and `model` directly. TypeScript's `f.agent` has no `cli`/`model` fields at all — it resolves both from the nearest `flows.json`:
58+
59+
```json
60+
{
61+
"cli": "claude",
62+
"models": ["claude-sonnet-4-6"]
63+
}
64+
```
65+
66+
Without one, an authored agent step refuses to run as `agent_cli_unresolved` rather than guessing a CLI.
67+
5568
## Verification
5669

5770
An agent rarely fails by crashing. It fails by returning something plausible and wrong, which a plain retry-on-error never catches. So a step's completion is decided by a check the kernel runs against the real output, not by the agent's own account of what happened.

0 commit comments

Comments
 (0)