Skip to content

Add declarative custom-engine frontmatter and migrate Crush/OpenCode to shared behavior definitions#44465

Open
pelikhan with Copilot wants to merge 67 commits into
mainfrom
copilot/define-agentic-engine-syntax
Open

Add declarative custom-engine frontmatter and migrate Crush/OpenCode to shared behavior definitions#44465
pelikhan with Copilot wants to merge 67 commits into
mainfrom
copilot/define-agentic-engine-syntax

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

    • Adds engine.experimental, engine.auth, and engine.behaviors to the named engine definition form.
    • behaviors captures the runtime contract instead of hard-coding it in Go:
      • capabilities
      • manifest files/path prefixes
      • installation metadata
      • config file generation
      • execution command/args/env
      • MCP config target
    • auth provides explicit secret bindings for engines that need engine-specific credentials forwarded into the runtime.
  • Shared behavior-defined runtime

    • Adds a generic BehaviorDefinedEngine that materializes a CodingAgentEngine from frontmatter.
    • Reuses the existing universal provider/model routing where applicable, but also supports engine-specific secret/env bindings for nonstandard CLIs.
    • Registers imported named engine definitions during compilation so shared workflows can define engines declaratively instead of requiring Go registration.
  • Crush/OpenCode refactor

    • Replaces the bespoke Crush/OpenCode runtime logic with thin wrappers over builtin engine definitions.
    • Moves engine-specific behavior into:
      • pkg/workflow/data/engines/crush.md
      • pkg/workflow/data/engines/opencode.md
    • Keeps their existing runtime identity while making their install/config/execute behavior data-driven.
  • Schema and docs

    • Extends the workflow schema and frontmatter reference docs to describe the new engine-definition fields.
    • Documents the custom-engine shape with behavior blocks and auth bindings so new engines can be added without copy-pasting a dedicated Go implementation.
  • Coverage

    • Adds/updates tests for:
      • schema shape
      • builtin engine definitions
      • imported behavior-defined engines
      • Crush/OpenCode parity through the shared path
    • Includes an imported Auggie-style engine example to exercise explicit auth binding and declarative execution.

Example of the new shared engine definition shape:

engine:
  id: auggie
  display-name: Auggie
  experimental: true
  auth:
    - role: session
      secret: AUGMENT_SESSION_AUTH
  behaviors:
    supported-env-var-keys:
      - AUGMENT_SESSION_AUTH
    installation:
      package-manager: npm
      package-name: "@augmentcode/auggie"
      version: "1.0.0"
      step-name: Install Auggie
      binary-name: auggie
      include-node-setup: true
    config-file:
      path: .auggie.json
      step-name: Write Auggie Config
      content: '{"sandbox":"workspace-write"}'
      merge-strategy: json-merge
    execution:
      command-name: auggie
      args: [run]
      step-name: Execute Auggie CLI
      model-env-var: AUGGIE_MODEL
      mcp-config-env-var: AUGGIE_MCP_CONFIG
      write-timestamp: true

Generated by 👨‍🍳 PR Sous Chef · 10.4 AIC · ⌖ 5.15 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 16.6 AIC · ⌖ 7.21 AIC · ⊞ 4.7K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 8.9 AIC · ⌖ 5.99 AIC · ⊞ 4.7K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 6.57 AIC · ⌖ 6.74 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 4.36 AIC · ⌖ 7.98 AIC · ⊞ 4.7K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 7.94 AIC · ⌖ 6.73 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 9.71 AIC · ⌖ 6.72 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 12.5 AIC · ⌖ 6.14 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 4.34 AIC · ⌖ 5.93 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 11.3 AIC · ⌖ 6.23 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 10.4 AIC · ⌖ 4.23 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 11.7 AIC · ⌖ 6.78 AIC · ⊞ 4.2K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 4.72 AIC · ⌖ 6.03 AIC · ⊞ 7.5K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · 6.21 AIC · ⌖ 8.01 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI and others added 3 commits July 9, 2026 03:49
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 AI changed the title Add declarative frontmatter syntax for custom agentic engines Add declarative custom-engine frontmatter and migrate Crush/OpenCode to shared behavior definitions Jul 9, 2026
Copilot AI requested a review from pelikhan July 9, 2026 04:18
@pelikhan

pelikhan commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

@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>
@pelikhan

pelikhan commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

@copilot create a new instruction file to help with configuring new agentic engines

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot remove crush/opencode from Go code and only keep them as shared agentic workflow files.

Addressed in 5537932.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot create a new instruction file to help with configuring new agentic engines

Addressed in ab02806.

@pelikhan

pelikhan commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile
Run pr-finisher skill

Copilot AI and others added 3 commits July 9, 2026 05:20
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>

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile
Run pr-finisher skill

Addressed in 1610bec.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot please run the pr-finisher skill, address the remaining unresolved review feedback, and rerun checks once the branch is up to date. Focus on the open behavior-defined engine issues around required-secret validation, firewall secret exclusion parity, and config/MCP path wiring so maintainers can re-review quickly.

Run: https://github.com/github/gh-aw/actions/runs/29171299425

Generated by 👨‍🍳 PR Sous Chef · 14.9 AIC · ⌖ 5.63 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

pr-sous-chef
@copilot please run the pr-finisher skill, address the remaining unresolved review feedback, and rerun checks once the branch is up to date. Focus on the open behavior-defined engine ...

All four behavior-defined engine issues were fixed in commit a1011e8 on July 9th — all review threads are resolved and the code is correct:

  • Required-secret validation (GetSecretValidationStep): passes actual workflowData to GetRequiredSecretNames, so MCP/GitHub-tool secrets are included.
  • Firewall secret exclusion parity (ComputeAWFExcludeEnvVarNames): uses e.GetRequiredSecretNames(workflowData) with the actual workflow data, so provider API-key env vars are correctly excluded.
  • MCP config path wiring: sets the env var even without a config-file block — falls back to constants.McpServersJsonPathExpr or behavior.MCP.ConfigPath.
  • Config-file mkdir: uses dirname() to create parent directories for nested config paths.

Branch is up to date with main, working tree is clean, and local validation (make fmt, make test-unit, make agent-report-progress) all pass. Hand-off: a maintainer /smoke-opencode re-trigger is needed to confirm CI green before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, make sure the branch is up to date with the base branch, and rerun checks once everything is green.

Generated by 👨‍🍳 PR Sous Chef · 12.6 AIC · ⌖ 7.9 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, make sure the branch is up to date with the base branch, and rerun checks once everything is green.

...

  • ✅ Reviews — All 4 review threads are resolved.
  • ✅ Checks (local) — make fmt, make test-unit, make agent-report-progress all pass. 256/256 workflows compiled, 0 errors, lock files in sync.
  • ❓ Checks (CI) — Stale after last agent push (26a6570). Smoke CI is action_required on the current HEAD; the last smoke-opencode run (29159704698) failed on 6fb41bb7 due to gpt-5 not being in the model registry — that was fixed in commit 5d50cc5 (gpt-5 → gpt-5.5). A /smoke-opencode re-trigger is needed to confirm green on HEAD 26a6570.
  • ✅ Mergeable — Branch is up to date with main, no conflicts.

Actions taken: none — working tree was clean (reverted an incidental SKILL.md modification from skill loading), no code changes needed. Hand-off: CI must be re-triggered by a maintainer (/smoke-opencode) before merge.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

pr-sous-chef
@copilot please run the pr-finisher skill and address the unresolved review feedback in the PR threads, then rerun checks once the branch is ready.

Run: https://github.com/github/gh-aw/actions/runs/29180928196

Generated by 👨‍🍳 PR Sous Chef · 15 AIC · ⌖ 6.07 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI and others added 2 commits July 12, 2026 05:31
…c-engine-syntax

# Conflicts:
#	.github/workflows/smoke-copilot.lock.yml
#	.github/workflows/smoke-crush.lock.yml
#	.github/workflows/smoke-opencode.lock.yml

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…ging main

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

pr-sous-chef
@copilot please run the pr-finisher skill and address the unresolved review feedback in the PR threads, then rerun checks once the branch is ready.
...

  • ✅ Reviews — All 4 review threads are resolved.
  • ✅ Checks (local) — make fmt, make test-unit, make agent-report-progress all pass. 256/256 workflows compiled, 0 errors, lock files in sync.
  • ❓ Checks (CI) — Stale after push. Branch was 2 commits behind main (bc7d2db firewall v0.27.30 bump, b4f3c45 docker-sbx runtime). Merged in commits 1f1fcdf and c14325b; recompiled smoke-copilot/crush/opencode lock files to fix hash mismatch that appeared post-merge.
  • ✅ Mergeable — Branch is now up to date with main, no conflicts.

Actions taken: merged origin/main, resolved lock-file conflicts by recompile, committed 1f1fcdf + c14325b. Hand-off: CI must be re-triggered by a maintainer (/smoke-opencode) before merge.

@pelikhan

Copy link
Copy Markdown
Collaborator

/smoke-copilot

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this issue comment. Sources say the story is developing...

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category feature
Risk 🔴 high
Score 60/100 (impact:35 + urgency:15 + quality:10)
Action ⏳ defer

Rationale: Large, high-risk feature (32 files, +1577/-423). Carry-over (opened 2026-07-09). Significant scope — declarative engine frontmatter + Crush/OpenCode migration. No reviews yet. Defer until scope review / dedicated review session.

Triage run §29183606049

Generated by 🔧 PR Triage Agent · 171.6 AIC · ⌖ 5.63 AIC · ⊞ 5.6K ·

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke test review submitted for run 29183677811.

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · 108.9 AIC · ⌖ 7.1 AIC · ⊞ 19.1K
Comment /smoke-copilot to run again
Add label smoke to run again

@pelikhan

Copy link
Copy Markdown
Collaborator

/smoke-opencode

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

⚠️ Smoke OpenCode failed. OpenCode encountered unexpected challenges...

@pelikhan

Copy link
Copy Markdown
Collaborator

Copilot AI and others added 2 commits July 12, 2026 09:23
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/github/gh-aw/actions/runs/29185974274/job/86632117182#step:28:1

Fixed. Root cause: Bun (OpenCode's runtime) compares the full host:port string against NO_PROXY entries rather than stripping the port first (unlike Go's net/http.ProxyFromEnvironment). So host.docker.internal:10002 did not match the bare host.docker.internal pattern → Bun routed through Squid → Squid's Azure DNS couldn't resolve host.docker.internal → HTTP 503.

The fix adds explicit host:port entries for all AWF LLM gateway ports (10000-10003) to a new constants.AWFNoProxyHosts constant and also emits the lowercase no_proxy alongside the uppercase NO_PROXY for maximum runtime compatibility:

localhost,127.0.0.1,host.docker.internal,host.docker.internal:10000,host.docker.internal:10001,host.docker.internal:10002,host.docker.internal:10003

Both behavior_defined_engine.go (OpenCode/Auggie path) and universal_llm_consumer_engine.go (Claude/Copilot/Gemini path) are updated. The compiled smoke-opencode.lock.yml now carries the correct NO_PROXY value.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address any unresolved review feedback, and rerun checks once the branch is up to date.

Run: https://github.com/github/gh-aw/actions/runs/29187567992

Generated by 👨‍🍳 PR Sous Chef · 6.21 AIC · ⌖ 8.01 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address any unresolved review feedback, and rerun checks once the branch is up to date.

Run: https://github.com/github/gh-aw/actions/runs/29187567992...

  • ✅ Reviews — All 4 review threads are resolved.
  • ✅ Checks (local) — make test-unit, make check-stale-lock-files, make agent-report-progress all pass. 256/256 workflows compiled, 0 errors, lock files in sync.
  • ❓ Checks (CI) — Stale after agent push. Latest smoke-opencode run (29187656459 on 47dbc75) shows failure with 0 jobs and 0 artifacts uploaded — the runner was never assigned, which indicates an infra/quota issue rather than a code failure. All prior code-caused failures are fixed in the branch (Bun NO_PROXY port-inclusive bypass, gpt-5gpt-5.5 model, AWF proxy provider wiring). Smoke Copilot is green (29183677811 ✅).
  • ✅ Mergeable — Branch is up to date with main (0 commits behind), no conflicts.

Actions taken: none — working tree is clean, no new issues to address. Hand-off: a maintainer /smoke-opencode re-trigger is needed to confirm green on HEAD before merge.

@pelikhan

Copy link
Copy Markdown
Collaborator

/smoke-opencode

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

🚀 skillet has started processing this pull request comment

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address any unresolved review feedback still open on this PR, and rerun checks once the branch is ready.

Run: https://github.com/github/gh-aw/actions/runs/29190625506

Generated by 👨‍🍳 PR Sous Chef · 13 AIC · ⌖ 6.51 AIC · ⊞ 4.2K ·
Comment /souschef to run again

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address any unresolved review feedback still open on this PR, and rerun checks once the branch is ready.

Run: https://github.com/github/gh-aw/actions/runs...

  • ✅ Reviews — All 4 review threads are resolved.
  • ✅ Checks (local) — make agent-report-progress passes. 256 workflows compiled, 0 errors, lock files in sync.
  • ❓ Checks (CI) — Stale after last agent push. Latest smoke-opencode run (29187656459 on 47dbc75) failed with 0 jobs — confirmed infra/runner flake, not a code failure. All code-caused failures are fixed (Bun NO_PROXY port-inclusive entries in 47dbc75, gpt-5gpt-5.5 in 5d50cc5). Smoke Copilot is green (29183677811 ✅). @pelikhan's /smoke-opencode comment should trigger a new run to confirm green on HEAD.
  • ✅ Mergeable — Branch is up to date with main (0 commits behind), no conflicts.

Actions taken: none — working tree was already clean, no new issues to address.
Hand-off: CI must be re-triggered by a maintainer (/smoke-opencode) before merge to confirm green on HEAD c8a5186.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

\n@copilot please run the skill, address the unresolved Copilot review feedback on required secret validation, MCP config env wiring, and config-file parent-directory creation, then rerun checks once the branch is ready.

Generated by 👨‍🍳 PR Sous Chef · 8.41 AIC · ⌖ 10.8 AIC · ⊞ 4.2K ·
Comment /souschef to run again

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category feature
Risk 🔴 High
Score 62/100 (impact: 35, urgency: 12, quality: 15)
Action defer

Declarative custom-engine frontmatter. Very large change (+1609/-423). 3-day old open PR. Labeled custom-engine — complex feature with high risk. Defer for dedicated focused review.

Generated by 🔧 PR Triage Agent · 48.3 AIC · ⌖ 7.99 AIC · ⊞ 5.6K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants