Skip to content

Commit 9eac08b

Browse files
committed
test: add comprehensive taskflow exercising all grammar features
Covers: shell tasks, repeat_prompt, async iteration, model_config, globals, inputs, env, MCP toolboxes, headless, blocked_tools, reusable tasks (uses), reusable prompts (include), and handoffs.
1 parent c86c76c commit 9eac08b

1 file changed

Lines changed: 125 additions & 0 deletions

File tree

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# SPDX-FileCopyrightText: GitHub, Inc.
2+
# SPDX-License-Identifier: MIT
3+
4+
# Comprehensive test taskflow that exercises every grammar feature:
5+
# - model_config reference with model aliases
6+
# - globals (with CLI override via -g)
7+
# - inputs (task-level template variables)
8+
# - env (task-scoped environment variables)
9+
# - must_complete
10+
# - exclude_from_context
11+
# - max_steps
12+
# - MCP toolboxes (echo)
13+
# - shell task (run)
14+
# - repeat_prompt + async iteration
15+
# - reusable tasks (uses)
16+
# - reusable prompts ({% include %})
17+
# - agent handoffs (multi-agent)
18+
# - headless mode
19+
# - blocked_tools
20+
21+
seclab-taskflow-agent:
22+
version: "1.0"
23+
filetype: taskflow
24+
25+
model_config: examples.model_configs.model_config
26+
27+
globals:
28+
topic: fruit
29+
detail_level: brief
30+
31+
taskflow:
32+
# ---------------------------------------------------------------
33+
# Task 1: Shell task — produces a JSON array for repeat_prompt
34+
# Features: run, must_complete
35+
# ---------------------------------------------------------------
36+
- task:
37+
name: generate-items
38+
must_complete: true
39+
run: |
40+
echo '[{"name": "apple", "color": "red"}, {"name": "banana", "color": "yellow"}, {"name": "orange", "color": "orange"}]'
41+
42+
# ---------------------------------------------------------------
43+
# Task 2: Repeat prompt over shell output, async iteration
44+
# Features: repeat_prompt, async, async_limit, exclude_from_context,
45+
# model (alias), inputs, globals, env, max_steps
46+
# ---------------------------------------------------------------
47+
- task:
48+
name: describe-items
49+
repeat_prompt: true
50+
async: true
51+
async_limit: 3
52+
exclude_from_context: true
53+
must_complete: true
54+
model: gpt_default
55+
max_steps: 10
56+
agents:
57+
- examples.personalities.fruit_expert
58+
inputs:
59+
format: one-sentence
60+
env:
61+
FRUIT_MODE: "analysis"
62+
user_prompt: |
63+
The topic is {{ globals.topic }} at {{ globals.detail_level }} detail level.
64+
Describe the {{ result.name }} (which is {{ result.color }}) in {{ inputs.format }} format.
65+
66+
# ---------------------------------------------------------------
67+
# Task 3: MCP tool call with echo server
68+
# Features: toolboxes, headless, blocked_tools
69+
# ---------------------------------------------------------------
70+
- task:
71+
name: echo-test
72+
must_complete: true
73+
headless: true
74+
agents:
75+
- examples.personalities.echo
76+
user_prompt: |
77+
Echo the following message: "All {{ globals.topic }} items processed successfully"
78+
blocked_tools:
79+
- nonexistent_tool_to_test_filtering
80+
81+
# ---------------------------------------------------------------
82+
# Task 4: Reusable task via `uses`
83+
# Features: uses (inherits from single_step_taskflow)
84+
# ---------------------------------------------------------------
85+
- task:
86+
name: reusable-task
87+
uses: examples.taskflows.single_step_taskflow
88+
model: gpt_default
89+
90+
# ---------------------------------------------------------------
91+
# Task 5: Reusable prompt via {% include %}
92+
# Features: Jinja2 include directive, reusable prompts
93+
# ---------------------------------------------------------------
94+
- task:
95+
name: include-prompt
96+
agents:
97+
- examples.personalities.fruit_expert
98+
model: gpt_default
99+
max_steps: 5
100+
user_prompt: |
101+
Tell me about apples.
102+
103+
{% include 'examples.prompts.example_prompt' %}
104+
105+
Keep your answer to two sentences per fruit.
106+
107+
# ---------------------------------------------------------------
108+
# Task 6: Agent handoffs (multi-agent)
109+
# Features: multiple agents (first=primary, rest=handoff targets)
110+
# ---------------------------------------------------------------
111+
- task:
112+
name: handoff-test
113+
model: gpt_default
114+
max_steps: 15
115+
agents:
116+
- examples.personalities.fruit_expert
117+
- examples.personalities.apple_expert
118+
- examples.personalities.banana_expert
119+
- examples.personalities.orange_expert
120+
user_prompt: |
121+
You are a fruit coordinator. I need specific expert advice on each fruit.
122+
Please hand off to the apple expert for a one-sentence fact about apples,
123+
then to the banana expert for a one-sentence fact about bananas,
124+
then to the orange expert for a one-sentence fact about oranges.
125+
Each expert should provide exactly one interesting fact.

0 commit comments

Comments
 (0)