Add declarative custom-engine frontmatter and migrate Crush/OpenCode to shared behavior definitions#44465
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot remove crush/opencode from Go code and only keep them as shared agentic workflow files. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot create a new instruction file to help with configuring new agentic engines |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main and recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…c-engine-syntax Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR expands the workflow frontmatter engine-definition format to support declarative, behavior-driven engines (including experimental flags, auth bindings, and runtime behavior blocks), and migrates the Crush and OpenCode engines off bespoke Go implementations onto this shared declarative runtime path.
Changes:
- Introduces
BehaviorDefinedEngineto materializeCodingAgentEngineruntimes fromengine.behaviors, including installation/config/execution/MCP wiring and optional auth secret bindings. - Moves Crush/OpenCode engine behavior into embedded markdown definitions (
pkg/workflow/data/engines/*.md) and updates engine registration + tests accordingly. - Extends the workflow JSON schema and docs to document
engine.experimental,engine.auth, andengine.behaviors, and adds an internal guide for configuring declarative engines.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/opencode_mcp.go | Removes OpenCode-specific MCP renderer (superseded by behavior-defined path). |
| pkg/workflow/opencode_engine.go | Removes bespoke OpenCode engine implementation (superseded by behavior-defined path). |
| pkg/workflow/opencode_engine_test.go | Updates OpenCode tests to use builtin behavior-defined engine loader. |
| pkg/workflow/engine_includes_test.go | Adds coverage for importing behavior-defined engine definitions from shared workflows. |
| pkg/workflow/engine_definition.go | Extends engine definition structs to include experimental/auth/behaviors blocks. |
| pkg/workflow/engine_definition_loader.go | Adds cached lookup for embedded builtin engine definitions. |
| pkg/workflow/engine_definition_loader_test.go | Asserts Crush/OpenCode definitions are experimental and have behaviors. |
| pkg/workflow/engine_catalog_test.go | Ensures schema surface includes experimental/auth/behaviors properties. |
| pkg/workflow/data/engines/opencode.md | Defines OpenCode runtime behavior declaratively (install/config/exec/MCP). |
| pkg/workflow/data/engines/crush.md | Defines Crush runtime behavior declaratively (install/config/exec/MCP). |
| pkg/workflow/crush_mcp.go | Removes Crush-specific MCP renderer (superseded by behavior-defined path). |
| pkg/workflow/crush_engine.go | Removes bespoke Crush engine implementation (superseded by behavior-defined path). |
| pkg/workflow/crush_engine_test.go | Updates Crush tests to use builtin behavior-defined engine loader. |
| pkg/workflow/compiler_orchestrator_engine.go | Registers named engine definitions found in includes/imports during compilation. |
| pkg/workflow/behavior_defined_engine.go | Adds the shared declarative engine runtime implementation. |
| pkg/workflow/agentic_engine.go | Registers Crush/OpenCode via builtin behavior-defined engines. |
| pkg/workflow/agent_validation_model_test.go | Updates model-validation tests to use behavior-defined Crush/OpenCode engines. |
| pkg/parser/schemas/main_workflow_schema.json | Extends schema for engine definition format with experimental/auth/behaviors. |
| pkg/cli/data/agentic_workflows_skill.md | Adds pointer to the new declarative-engine configuration guide. |
| pkg/cli/data/agentic_workflows_fallback_aw_files.json | Adds the new guide to fallback AW file list. |
| docs/src/content/docs/reference/frontmatter-full.md | Documents the new engine definition fields and behaviors block. |
| .github/workflows/test-workflow.lock.yml | Adds generated lock workflow for test workflow. |
| .github/workflows/test-dispatcher.lock.yml | Adds generated lock workflow for dispatcher workflow. |
| .github/workflows/smoke-opencode.lock.yml | Updates compiled smoke workflow to reflect declarative OpenCode behavior. |
| .github/workflows/smoke-crush.lock.yml | Updates compiled smoke workflow to reflect declarative Crush behavior. |
| .github/skills/agentic-workflows/SKILL.md | Adds reference to the new declarative-engine configuration guide. |
| .github/aw/github-agentic-workflows.md | Links the new declarative engine configuration guide in the index. |
| .github/aw/configure-agentic-engine.md | Adds a new guide for adding/updating declarative engine definitions. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 27/30 changed files
- Comments generated: 4
- Review effort level: Low
| if exec.MCPConfigEnvVar != "" && HasMCPServers(workflowData) { | ||
| if behavior.ConfigFile != nil { | ||
| env[exec.MCPConfigEnvVar] = "${{ github.workspace }}/" + behavior.ConfigFile.Path | ||
| } | ||
| } |
There was a problem hiding this comment.
Fixed in the previous commit. The env var is now set even when there's no config-file block — it falls back to constants.McpServersJsonPathExpr, or to behavior.MCP.ConfigPath if a behaviors.mcp.config-path is present.
|
@copilot please run the Unresolved review feedback to address first:
Run: https://github.com/github/gh-aw/actions/runs/29016118662
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
- GetSecretValidationStep: pass actual workflowData instead of empty WorkflowData{} so MCP/GitHub-tool secrets are included in validation
- buildFirewallCommand: pass actual workflowData to ComputeAWFExcludeEnvVarNames so provider API-key env vars are correctly excluded
- MCP config env var: also set env var when engine has mcp.config-path but no config-file block
- buildConfigFileStep json-merge: use dirname() to create parent directories for nested config paths
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Addressed all four open review threads from
All unit tests pass locally. |
🤖 PR Triage — Run §29020837798
Score breakdown: Impact 35 + Urgency 8 + Quality 7 Rationale: Very large diff (7 474 +/ 394 −) introducing a new declarative engine frontmatter system and migrating Crush/OpenCode. High architectural impact warrants careful design review before merging. No urgency signal. Recommend review as a standalone design session, not batch. Defer until scoped down or design reviewed.
|
|
@copilot please run the Unresolved review feedback:
|
All four review threads have been addressed:
All unit tests pass locally. |
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
All four review threads have been addressed and the branch is now up to date with main:
Branch has been merged with main (resolving the |
This introduces a richer engine-definition frontmatter shape for shared/custom agentic engines and uses it to move Crush and OpenCode off bespoke Go implementations onto a common declarative runtime path. The new syntax is expressive enough for CLI-style engines that need install, config, execution, MCP, capability, and auth wiring, including Auggie-like cases.
New engine-definition surface
engine.experimental,engine.auth, andengine.behaviorsto the named engine definition form.behaviorscaptures the runtime contract instead of hard-coding it in Go:authprovides explicit secret bindings for engines that need engine-specific credentials forwarded into the runtime.Shared behavior-defined runtime
BehaviorDefinedEnginethat materializes aCodingAgentEnginefrom frontmatter.Crush/OpenCode refactor
pkg/workflow/data/engines/crush.mdpkg/workflow/data/engines/opencode.mdSchema and docs
Coverage
Example of the new shared engine definition shape: