Skip to content

Commit f90bd81

Browse files
feat!: align engine front matter with gh-aw and hook up Engine enum (#286)
* feat!: align engine front matter with gh-aw and hook up Engine enum BREAKING CHANGE: The engine front matter format changed from model names (engine: claude-opus-4.5) to engine identifiers (engine: copilot). Model is now a sub-field in the object form (engine: { id: copilot, model: ... }). - Redefine EngineConfig to use engine identifiers aligned with gh-aw - Add full gh-aw field set: id, version, model, agent, api-target, args, env, command, timeout-minutes - Replace Engine trait + dyn dispatch with Engine enum (Engine::Copilot) - Add get_engine() factory that rejects non-copilot identifiers - Supply resolved Engine in CompileContext - Route generate_copilot_params through ctx.engine.args() - Consolidate engine env vars (GITHUB_TOKEN, COPILOT_OTEL_*) into Engine::env(), remove from pipeline templates - Rename {{ copilot_ado_env }} to {{ engine_env }} - Remove SYSTEM_ACCESSTOKEN injection from agent sandbox step - Remove AZURE_DEVOPS_EXT_PAT from engine env (handled by MCPG) - Remove cancel_previous_builds functionality (used System.AccessToken) - Update examples to new engine format Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: remove engine from example front matters Default engine (copilot) and model (claude-opus-4.5) are applied automatically when engine: is omitted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(engine): update AGENTS.md and engine.rs for new engine format - Update AGENTS.md front matter example to use `engine: copilot` instead of the old `engine: claude-opus-4.5` format (which now fails at compile) - Update Engine Configuration section to document `id` field, object form with `id: copilot`, and all new EngineOptions fields - Add compile-time warnings for engine options that are parsed but not yet wired into the pipeline (args, version, agent, api-target, command, env) - Fix 8-space indent in copilot_args() body left over from impl extraction - Add #[allow(dead_code)] and clarifying doc comment to Engine::command() - Remove obsolete {{ cancel_previous_builds }} section from AGENTS.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(prompts): update dispatcher prompts for new engine format, simplify generate_copilot_params - Fix create-ado-agentic-workflow.md: Step 2 now teaches engine as an engine identifier (not a model name), object form includes id: copilot, complete example uses object form with model selection - Fix debug-ado-agentic-workflow.md: Model/Engine Failures section now shows correct format and explains the engine vs model distinction - Remove redundant front_matter parameter from generate_copilot_params — ctx.front_matter is the same value; updated all 25+ call sites Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(engine): remove generate_copilot_params wrapper, use Engine::args directly The wrapper was a trivial one-liner delegating to ctx.engine.args(). All call sites (production + 25 tests) now call Engine::args() directly via the CompileContext, removing an unnecessary layer of indirection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9f28cbd commit f90bd81

16 files changed

Lines changed: 592 additions & 415 deletions

AGENTS.md

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ The compiler expects markdown files with YAML front matter similar to gh-aw:
121121
name: "name for this agent"
122122
description: "One line description for this agent"
123123
target: standalone # Optional: "standalone" (default) or "1es". See Target Platforms section below.
124-
engine: claude-opus-4.5 # AI engine to use. Defaults to claude-opus-4.5. Other options include claude-sonnet-4.5, gpt-5.2-codex, gemini-3-pro-preview, etc.
124+
engine: copilot # Engine identifier. Defaults to copilot. Currently only 'copilot' (GitHub Copilot CLI) is supported.
125125
# engine: # Alternative object format (with additional options)
126+
# id: copilot
126127
# model: claude-opus-4.5
127128
# timeout-minutes: 30
128129
schedule: daily around 14:00 # Fuzzy schedule syntax - see Schedule Syntax section below
@@ -314,14 +315,15 @@ schedule:
314315

315316
### Engine Configuration
316317

317-
The `engine` field specifies which AI model to use and optional execution parameters. It accepts both a simple string format (model name only) and an object format with additional options.
318+
The `engine` field specifies which engine to use for the agentic task. The string form is an engine identifier (currently only `copilot` is supported). The object form uses `id` for the engine identifier plus additional options like model selection and timeout.
318319

319320
```yaml
320-
# Simple string format (just a model name)
321-
engine: claude-opus-4.5
321+
# Simple string format (engine identifier, defaults to copilot)
322+
engine: copilot
322323
323324
# Object format with additional options
324325
engine:
326+
id: copilot
325327
model: claude-opus-4.5
326328
timeout-minutes: 30
327329
```
@@ -330,11 +332,20 @@ engine:
330332

331333
| Field | Type | Default | Description |
332334
|-------|------|---------|-------------|
335+
| `id` | string | `copilot` | Engine identifier. Currently only `copilot` (GitHub Copilot CLI) is supported. |
333336
| `model` | string | `claude-opus-4.5` | AI model to use. Options include `claude-sonnet-4.5`, `gpt-5.2-codex`, `gemini-3-pro-preview`, etc. |
334337
| `timeout-minutes` | integer | *(none)* | Maximum time in minutes the agent job is allowed to run. Sets `timeoutInMinutes` on the `Agent` job in the generated pipeline. |
338+
| `version` | string | *(none)* | Engine CLI version to install (e.g., `"0.0.422"`, `"latest"`). **Not yet wired** — parsed but ignored with a warning. |
339+
| `agent` | string | *(none)* | Custom agent file identifier (Copilot only). **Not yet wired** — parsed but ignored with a warning. |
340+
| `api-target` | string | *(none)* | Custom API endpoint hostname for GHES/GHEC (e.g., `"api.acme.ghe.com"`). **Not yet wired** — parsed but ignored with a warning. |
341+
| `args` | list | `[]` | Custom CLI arguments injected before the prompt. **Not yet wired** — parsed but ignored with a warning. |
342+
| `env` | map | *(none)* | Engine-specific environment variables. **Not yet wired** — parsed but ignored with a warning. |
343+
| `command` | string | *(none)* | Custom engine executable path (skips default installation). **Not yet wired** — parsed but ignored with a warning. |
335344

336345
> **Deprecated:** `max-turns` is still accepted in front matter for backwards compatibility but is ignored at compile time (a warning is emitted). It was specific to Claude Code and is not supported by Copilot CLI.
337346

347+
> **Note:** Fields marked "not yet wired" are accepted in the schema for forward compatibility with gh-aw but produce a compile-time warning. Pipeline wiring for these fields is incremental.
348+
338349
#### `timeout-minutes`
339350

340351
The `timeout-minutes` field sets a wall-clock limit (in minutes) for the entire agent job. It maps to the Azure DevOps `timeoutInMinutes` job property on `Agent`. This is useful for:
@@ -838,29 +849,6 @@ Tool names are validated at compile time:
838849
- Names must contain only ASCII alphanumerics and hyphens (shell injection prevention)
839850
- Unrecognized names (not in `ALL_KNOWN_SAFE_OUTPUTS`) emit a warning to catch typos
840851

841-
## {{ cancel_previous_builds }}
842-
843-
When `triggers.pipeline` is configured, this generates a bash step that cancels any previously queued or in-progress builds of the same pipeline definition. This prevents multiple builds from accumulating when the upstream pipeline triggers rapidly (e.g., multiple PRs merged in quick succession).
844-
845-
The step:
846-
- Uses the Azure DevOps REST API to query builds for the current pipeline definition
847-
- Filters to only `notStarted` and `inProgress` builds
848-
- Excludes the current build from cancellation
849-
- Cancels each older build via PATCH request
850-
851-
Example output:
852-
```yaml
853-
- bash: |
854-
CURRENT_BUILD_ID=$(Build.BuildId)
855-
BUILDS=$(curl -s -u ":$SYSTEM_ACCESSTOKEN" \
856-
"$(System.CollectionUri)$(System.TeamProject)/_apis/build/builds?definitions=$(System.DefinitionId)&statusFilter=notStarted,inProgress&api-version=7.1" \
857-
| jq -r --arg current "$CURRENT_BUILD_ID" '.value[] | select(.id != ($current | tonumber)) | .id')
858-
# ... cancels each build
859-
displayName: "Cancel previous queued builds"
860-
env:
861-
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
862-
```
863-
864852
## {{ threat_analysis_prompt }}
865853

866854
Should be replaced with the embedded threat detection analysis prompt from `src/data/threat-analysis.md`. This prompt template includes markers for `{{ source_path }}`, `{{ agent_name }}`, `{{ agent_description }}`, and `{{ working_directory }}` which are replaced during compilation.

examples/azure-devops-mcp.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name: "ADO Work Item Triage"
33
description: "Triages work items using the Azure DevOps MCP"
44
schedule: daily around 9:00
5-
engine: claude-sonnet-4.5
65
tools:
76
azure-devops:
87
toolsets: [core, work, work-items]

examples/lean-verifier.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
name: "Lean Formal Verifier"
33
description: "Analyzes code and builds formal Lean 4 proofs of critical invariants"
4-
engine: claude-opus-4.5
54
schedule: weekly on friday around 17:00
65
tools:
76
cache-memory: true

prompts/create-ado-agentic-workflow.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,23 @@ name: "Weekly Dependency Updater"
6262
description: "Checks for outdated dependencies and opens PRs to update them"
6363
```
6464
65-
### Step 2 — AI Model (engine)
65+
### Step 2 — Engine
6666
67-
Default is `claude-opus-4.5`. Only include `engine:` if the user requests a different model.
67+
Default engine is `copilot` (GitHub Copilot CLI). The `engine:` field is an engine identifier, not a model name. Only include `engine:` if you need to set a non-default model or timeout.
6868

69-
| Value | Use when |
69+
The default model is `claude-opus-4.5`. To use a different model, use the object form:
70+
71+
| Model | Use when |
7072
|---|---|
7173
| `claude-opus-4.5` | Default. Best reasoning, complex tasks. |
7274
| `claude-sonnet-4.5` | Faster, cheaper, simpler tasks. |
7375
| `gpt-5.2-codex` | Code-heavy tasks. |
7476
| `gemini-3-pro-preview` | Google ecosystem tasks. |
7577

76-
Object form with extra options:
78+
Object form with model selection and extra options:
7779
```yaml
7880
engine:
81+
id: copilot
7982
model: claude-sonnet-4.5
8083
timeout-minutes: 30
8184
```
@@ -427,7 +430,9 @@ Use `noop` with a brief summary of what was reviewed.
427430
---
428431
name: "Dependency Updater"
429432
description: "Checks for outdated npm dependencies and opens PRs to update them"
430-
engine: claude-sonnet-4.5
433+
engine:
434+
id: copilot
435+
model: claude-sonnet-4.5
431436
schedule: weekly on monday around 9:00
432437
tools:
433438
azure-devops: true

prompts/debug-ado-agentic-workflow.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,20 @@ network:
133133

134134
**Common causes**:
135135

136-
- **Invalid model name**: Check the `engine:` field matches a supported model (`claude-opus-4.5`, `claude-sonnet-4.5`, `gpt-5.2-codex`, `gemini-3-pro-preview`, etc.)
136+
- **Invalid engine or model**: The `engine:` field is an engine identifier (e.g., `copilot`), not a model name. To specify a model, use the object form. Check that the engine identifier is valid and the model name is correct:
137+
```yaml
138+
# Wrong — model name as engine identifier
139+
engine: claude-opus-4.5
140+
141+
# Correct — engine identifier with model
142+
engine:
143+
id: copilot
144+
model: claude-opus-4.5
145+
```
137146
- **Timeout**: Agent hits the Azure DevOps job timeout (default 60 minutes). Set an explicit timeout:
138147
```yaml
139148
engine:
149+
id: copilot
140150
model: claude-opus-4.5
141151
timeout-minutes: 120
142152
```

0 commit comments

Comments
 (0)