Skip to content

Phase 3: Extend schema and parser for inline and catalog-defined engine definitions#20469

Merged
pelikhan merged 2 commits intomainfrom
copilot/extend-schema-parser-engines
Mar 11, 2026
Merged

Phase 3: Extend schema and parser for inline and catalog-defined engine definitions#20469
pelikhan merged 2 commits intomainfrom
copilot/extend-schema-parser-engines

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

Extends the frontmatter schema and parser to accept inline engine definitions and arbitrary named engine strings, enabling users to configure engines without modifying Go code (prerequisite: Phase 1 EngineDefinition/EngineCatalog and Phase 2 single source of truth).

Schema (main_workflow_schema.json)

  • Relaxed engine string variant and object id field from hard enums to plain strings — allows engine: my-custom-engine (named catalog entries)
  • Added a 3rd oneOf variant for inline definitions with runtime (required: id, optional: version) and provider (optional: id, model, auth.secret)
engine:
  runtime:
    id: codex
    version: 0.105.0
  provider:
    id: openai
    model: gpt-5
    auth:
      secret: OPENAI_API_KEY

Parser (engine.go)

  • Added IsInlineDefinition bool, InlineProviderID string, InlineProviderSecret string to EngineConfig
  • ExtractEngineConfig now detects engine.runtime sub-object and parses it as an inline definition, setting config.ID = runtime.id for downstream catalog resolution

Catalog (engine_definition.go)

  • Added Get(id string) *EngineDefinition method to EngineCatalog

Validation (engine_validation.go)

  • validateEngineInlineDefinition: errors on missing runtime.id; validates runtime.id maps to a known runtime adapter with fuzzy suggestions
  • registerInlineEngineDefinition: builds an EngineDefinition from the inline config (preserving built-in display names), registers it in the session catalog before Resolve() is called

Orchestration (compiler_orchestrator_engine.go)

  • Inline definitions are validated and registered immediately after ExtractEngineConfig, before catalog resolution

Tests (engine_catalog_test.go, engine_inline_test.go)

  • TestEngineCatalogMatchesSchema updated to assert the 3-variant schema structure rather than a string enum that no longer exists
  • New engine_inline_test.go covers: all field variants, legacy string regression, missing runtime.id error, unknown runtime ID error, full catalog resolution flow with provider override

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw -nolocalimports -importcfg git rev-�� --show-toplevel (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw remote.origin.urauth e/git git rev-�� --show-toplevel e/git /usr/bin/infocmp user.name om/owner/repo.girev-parse /usr/bin/git infocmp (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw git /usr/bin/git gh run list --json /usr/bin/gh --workflow nonexistent-workrev-parse --limit gh (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha it/ref/tags/v7 /tmp/go-build3074618456/b209/vet.cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha list --json /usr/bin/git --workflow nonexistent-workrev-parse --limit git rev-�� --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha d test@example.com /usr/bin/git --show-toplevel git /usr/bin/git git init�� /usr/bin/git git /usr/bin/git ithub-script/gitgit git /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --noprofile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha xterm-color x_amd64/vet /usr/bin/git -json GO111MODULE nfig/composer/ve--show-toplevel git rev-�� 0134-45286/test-3960752395 go /usr/bin/git heck '**/*.cjs' git GO111MODULE k/node_modules/.--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha ithub-script/git/ref/tags/v8 git 986300/b401/_pkg_.a --show-toplevel node /usr/bin/git git rev-�� --show-toplevel l 0/x64/bin/node --show-toplevel /usr/bin/git /usr/bin/git 0/x64/bin/node (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha origin REDACTED /opt/hostedtoolcache/node/24.14.0/x64/bin/bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel x_amd64/vet /usr/bin/git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -unreachable=false /tmp/go-build3074618456/b085/vet.cfg cal/bin/bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -unreachable=false /tmp/go-build3074618456/b194/vet.cfg nfig/composer/vendor/bin/bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel x_amd64/vet /usr/bin/git (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha om/github/gh-aw (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha d -n 10 .cfg 64/pkg/tool/linux_amd64/vet user.email (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha origin .cfg 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha /tmp/go-build3074618456/b075/_pkg_.a -trimpath ache/go/1.25.0/x64/pkg/tool/linux_amd64/asm -p testing/internalrev-parse -lang=go1.25 ache/go/1.25.0/x64/pkg/tool/linux_amd64/asm -uns�� -unreachable=false /tmp/go-build3074618456/b119/vet.cfg /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet go1.25.0 -c=4 -nolocalimports /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha = get && echo "******"; }; f store = get && echo "******"; }; f store cal/bin/bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -unreachable=false /tmp/go-build3074618456/b223/vet.cfg tnet/tools/bash (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha om/github/gh-aw /tmp/go-build3074618456/b103/vet.cfg k/_temp/ghcca-node/node/bin/bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /repos/actions/github-script/git/ref/tags/v8 --jq /usr/bin/git 210199/b383/_pkggit GO111MODULE 210199/b383=> git -C runs/20260311-050134-45286/test-3960752395 config /usr/bin/git remote.origin.urgit GOPROXY 2e90d8524e7282de--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha /tmp/gh-aw-test-runs/20260311-050348-49347/test-3399011758 config /opt/hostedtoolcache/node/24.14.0/x64/bin/node remote.origin.urgit git /usr/bin/git node /tmp�� /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/agent-performance-analyzer.md git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha -unreachable=false /tmp/go-build3074618456/b090/vet.cfg ache/go/1.25.0/x64/bin/bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha /tmp/gh-aw-add-gitattributes-test814097854/.github/workflows rev-parse /usr/bin/git 210199/b395/envugit GO111MODULE 210199/b395/impo--show-toplevel git rev-�� --show-toplevel OponvNzHYgi3f/DeNJzGr-D7xkIC-EgawJ/GFtmVa307QDDNuUCuh0B/-q2laYTO--jq ps runs/20260311-05git GOPROXY 210199/b395/_pkg--show-toplevel ps (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha /tmp/TestHashConsistency_GoAndJavaScript3895457480/001/test-frontmatter-with-arrays.md git clusion,workflowName,path,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --show-toplevel git /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git /usr/bin/git git (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha om/pmezard/go-difflib@v1.0.0/difflib/difflib.go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha /repos/actions/upload-artifact/git/ref/tags/v7 --jq bash -json GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/infocmp -json GO111MODULE ache/go/1.25.0/x--show-toplevel infocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha 986300/b384/_pkg_.a git 986300/b384=> --show-toplevel /opt/hostedtoolcrev-parse /usr/bin/gh git rev-�� ithub-script/git/ref/tags/v8 gh (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha llector.slice (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha ." (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE n-dir/node GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 go /usr/bin/git ub/workflows GO111MODULE 64/bin/go git rev-�� it/ref/tags/v7 go /usr/bin/infocmp on' --ignore-patgit GO111MODULE x_amd64/link infocmp (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 git /usr/bin/git --show-toplevel node /usr/bin/git git comm�� -m Add new feature 64/pkg/tool/linux_amd64/link --get remote.origin.urinit /usr/bin/git 64/pkg/tool/linux_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 Test User /usr/bin/git -json GO111MODULE 64/bin/go git init�� GOMODCACHE go /usr/bin/git on' --ignore-patgit GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 git /usr/bin/git /home/REDACTED/worgit s/test.md /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git user.name Test User /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env y-test.md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 test@example.com /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git on' --ignore-patgit GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 git /usr/bin/git s/test.md -tests /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git user.email test@example.comrev-parse /usr/bin/gh git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE x_amd64/link GOINSECURE GOMOD GOMODCACHE x_amd64/link env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE a7/uvoaxXZ6SdsIYvttU1Rk/W9HY2-8hHZU_--iy4qps (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 go /usr/bin/git ub/workflows GO111MODULE 64/bin/go git init�� GOMODCACHE go 64/bin/bash on' --ignore-patgit GO111MODULE 64/bin/go gh (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 git /usr/bin/git --show-toplevel I_9a60CKVjggF/xhremote /usr/bin/git git comm�� -m Update initial file 64/pkg/tool/linux_amd64/vet --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 86_64/node GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --git-dir go 0/x64/bin/bash on' --ignore-patgit GO111MODULE x_amd64/compile infocmp (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 git /usr/lib/git-core/git --show-toplevel node /usr/bin/git /usr/lib/git-core/git main�� run --auto 64/pkg/tool/linux_amd64/link --detach ache/go/1.25.0/xrev-parse /usr/bin/git 64/pkg/tool/linux_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env y-test.md GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 go /usr/bin/git ub/workflows GO111MODULE 64/bin/go git rev-�� --show-toplevel go de/node/bin/bash on' --ignore-patinfocmp GO111MODULE x_amd64/asm git (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 git /usr/bin/git GOMODCACHE node /usr/bin/git git add initial.txt git 64/pkg/tool/linux_amd64/link --ignore-path git /usr/bin/git 64/pkg/tool/linux_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/node GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 go /usr/bin/git ub/workflows GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git on' --ignore-patgit GO111MODULE x_amd64/cgo git (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 git /usr/lib/git-core/git --show-toplevel sh /usr/bin/git /usr/lib/git-corTest User main�� run --auto 64/pkg/tool/linux_amd64/compile --detach git /usr/bin/git 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path "prettier" --wriGOINSECURE 3756289/b368/impGOMOD 64/bin/go k/gh-aw/gh-aw/scsh GOPROXY 64/bin/go node /opt�� prettier --write 64/bin/go !../../../pkg/wogit --ignore-path ../../../.pretti--format go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -json GO111MODULE /usr/local/bin/sh GOINSECURE GOMOD GOMODCACHE sh -c npx prettier --check '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json GOPROXY /opt/hostedtoolcache/node/24.14.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/n-bool GOSUMDB GOWORK 64/bin/go node (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path xterm-color git /usr/bin/git --show-toplevel x_amd64/link /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel a7/uvoaxXZ6SdsIYrev-parse dAt,startedAt,up--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha matter-with-nested-objects.md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 3776838269/.github/workflows GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha LBDN/4fownHncp26b6DL2LBDN GOPROXY 0/x64/bin/node GOSUMDB GOWORK 64/bin/go 0/x64/bin/node 2101�� ons-test3368330291 210199/b413/_testmain.go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link --write ../../../pkg/wor-C 64/bin/go /opt/hostedtoolcrev-parse (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha "prettier" --wriGOSUMDB /opt/hostedtoolcGOWORK modules/@npmcli/run-script/lib/node-gyp-bin/sh /tmp/go-build274gcc -trimpath 64/bin/go go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha ry=1 GOPROXY 210199/b416/_pkg_.a GOSUMDB GOWORK 64/bin/go git for-�� --format %(refname) /usr/bin/git --merged 0f374af691314fccrev-parse 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel go ache/node/24.14./tmp/go-build274986300/b384/_pkg_.a git rev-�� --show-toplevel git bin/node --show-toplevel 64/pkg/tool/linuapi /usr/bin/git git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha ath ../../../.pr**/*.json pkg/workflow/eng--ignore-path 64/bin/go /tmp/go-build274/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -trimpath 64/bin/go go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha ath ../../../.pr**/*.json /opt/hostedtoolc--ignore-path 64/bin/go /tmp/go-build274/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -trimpath 64/bin/go go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha ath ../../../.pr**/*.json go 64/bin/go -json GO111MODULE 64/bin/go go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha ath ../../../.pr**/*.json /opt/hostedtoolc--ignore-path 64/bin/go /tmp/go-build274/opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -trimpath 64/bin/go go env re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha k/gh-aw/gh-aw/cmd/gh-aw/main.go GOPROXY 0/x64/bin/node GOSUMDB GOWORK 64/bin/go 0/x64/bin/node t-34�� sistency_GoAndJavaScript830069453/001/test-frontmatter-with-nested-objects.md node /usr/bin/git --write ../../../pkg/worconfig 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha --show-toplevel infocmp /usr/bin/git xterm-color go sh git 0135�� --show-toplevel infocmp /usr/bin/git xterm-color 64/pkg/tool/linurev-parse /usr/bin/git git (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha matter-with-nest.github/workflows/test.md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha "prettier" --check '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore GOPROXY /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -V=f�� 64/bin/go node /usr/bin/git --write ../../../pkg/wor-C 64/bin/go git (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion json' --ignore-pgit GO111MODULE 64/bin/go /usr/bin/git remo�� -v go /usr/bin/git th .prettierignogit GO111MODULE x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion xterm-color node /usr/bin/git sed s/-\�� ache/go/1.25.0/x--show-toplevel git 64/pkg/tool/linux_amd64/link --show-toplevel ache/go/1.25.0/xrev-parse (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go **/*.json --ignore-path ../../../.pretti"prettier" --check '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.prettierignore sh -c "prettier" --wriGOSUMDB /opt/hostedtoolcGOWORK 64/bin/go rror -trimpath 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go **/*.json --ignore-path ../../../.pretti"prettier" --check '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../../../.pret.prettierignore sh -c "prettier" --wriGOSUMDB /opt/hostedtoolcGOWORK 64/bin/go rror -trimpath 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /home/REDACTED/work/gh-aw/gh-aw/actions/node_modules/.bin/node GOINSECURE GOMOD GOMODCACHE node rtcf�� prettier tmain.go 0/x64/bin/node **/*.ts **/*.json --ignore-path node (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build238210199/b383/cli.test /tmp/go-build238210199/b383/cli.test -test.testlogfile=/tmp/go-build238210199/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true **/*.ts **/*.json --ignore-path sh -c npx prettier --wGOSUMDB node modules/@npmcli/run-script/lib/node-gyp-bin/sh --check scripts/**/*.js de go (http block)
    • Triggering command: /tmp/go-build213933616/b383/cli.test /tmp/go-build213933616/b383/cli.test -test.testlogfile=/tmp/go-build213933616/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE b/gh-aw/pkg/cli GOMODCACHE go env O1E8/ouGPg6lO5V6bMzIwO1E8 GO111MODULE /home/REDACTED/.local/bin/node GOINSECURE GOMOD GOMODCACHE 210199/b374/importcfg (http block)
    • Triggering command: /tmp/go-build274986300/b001/cli.test /tmp/go-build274986300/b001/cli.test -test.paniconexit0 -test.timeout=10m0s -test.count=1 -test.short=true --show-toplevel git n-dir/node --show-toplevel x_amd64/vet /usr/bin/git git 0/x6�� --show-toplevel git /usr/bin/git st-406435355/.gigit 0XVD7GS/mRL0tEU7rev-parse /usr/bin/git git (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name "prettier" --wriGOINSECURE 3756289/b369/impGOMOD 64/bin/go k/gh-aw/gh-aw/tmnode GOPROXY 64/bin/go node /opt�� prettier --write /node !../../../pkg/wogit --ignore-path ../../../.prettilog.showsignature=false go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name -json GO111MODULE /snap/bin/sh GOINSECURE GOMOD GOMODCACHE sh -c runs/20260311-050109-42353/test-3982102130 GOPROXY /home/REDACTED/.npm/_npx/b388654678d519d9/node_modules/.bin/prettier GOSUMDB GOWORK 64/bin/go prettier (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name /ref/tags/v8 git /usr/bin/git --show-toplevel x_amd64/compile (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ed engine definitions

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Extend schema and parser for inline engine definitions Phase 3: Extend schema and parser for inline and catalog-defined engine definitions Mar 11, 2026
@pelikhan pelikhan marked this pull request as ready for review March 11, 2026 05:23
Copilot AI review requested due to automatic review settings March 11, 2026 05:23
@pelikhan pelikhan merged commit 95f4259 into main Mar 11, 2026
113 checks passed
@pelikhan pelikhan deleted the copilot/extend-schema-parser-engines branch March 11, 2026 05:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Extends workflow frontmatter support to allow inline engine definitions (engine.runtime + optional engine.provider) and relaxes schema constraints to accept arbitrary named engine strings for catalog resolution.

Changes:

  • Updated JSON schema to remove hard enums for engine/engine.id and added a third oneOf variant for inline runtime/provider definitions.
  • Extended EngineConfig parsing to detect and extract inline runtime/provider fields.
  • Added inline-definition validation/registration and introduced EngineCatalog.Get() plus new/updated tests.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/workflow/engine_validation.go Adds inline-definition validation and registers inline definitions into the engine catalog.
pkg/workflow/engine_inline_test.go Adds unit tests covering inline parsing, validation errors, and catalog resolution flow.
pkg/workflow/engine_definition.go Adds EngineCatalog.Get(id) accessor.
pkg/workflow/engine_catalog_test.go Updates schema/catalog tests to assert the new 3-variant oneOf structure.
pkg/workflow/engine.go Extends engine config extraction to support engine.runtime + engine.provider.
pkg/workflow/compiler_orchestrator_engine.go Validates and registers inline definitions before catalog resolution.
pkg/parser/schemas/main_workflow_schema.json Relaxes engine enums and adds inline definition schema variant with examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

if !c.engineRegistry.IsValidEngine(config.ID) {
// Try prefix match for backward compatibility (e.g. "codex-experimental")
if matched, err := c.engineRegistry.GetEngineByPrefix(config.ID); err == nil {
engineValidationLog.Printf("Inline engine runtime.id %q matched via prefix to runtime %q", config.ID, matched.GetID())
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

In the prefix-match branch, validation logs a match but leaves config.ID unchanged. Since registerInlineEngineDefinition later sets EngineDefinition.RuntimeID = config.ID, a runtime.id like "codex-experimental" will pass validation but then fail at catalog resolution (registry likely only contains "codex"). Consider canonicalizing to the matched runtime ID (or storing the matched runtime separately and using it for RuntimeID) so validation and resolution stay consistent.

Suggested change
engineValidationLog.Printf("Inline engine runtime.id %q matched via prefix to runtime %q", config.ID, matched.GetID())
engineValidationLog.Printf("Inline engine runtime.id %q matched via prefix to runtime %q", config.ID, matched.GetID())
// Canonicalize the runtime ID to the matched engine's ID so that
// subsequent registration and catalog resolution use a known ID.
config.ID = matched.GetID()

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +45
if engineConfig != nil && engineConfig.IsInlineDefinition {
if err := c.validateEngineInlineDefinition(engineConfig); err != nil {
return nil, err
}
c.registerInlineEngineDefinition(engineConfig)
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

This registers inline definitions into c.engineCatalog, but the same Compiler instance is used to compile multiple markdown files in a single run (see pkg/cli/compile_orchestration.go loop). That means an inline override (e.g., changing provider/auth for "codex") can leak into subsequent workflow compilations. To avoid cross-file state, consider resolving with a per-workflow catalog copy (clone definitions map), or temporarily overriding and restoring the original definition after Resolve().

Copilot uses AI. Check for mistakes.
Comment on lines +116 to +142
// Variant 0: plain string (no enum — allows built-ins and custom named catalog entries)
assert.Equal(t, "string", variants[0]["type"],
"first variant should be type string")
assert.Nil(t, variants[0]["enum"],
"string variant must NOT have an enum so that named catalog entries are allowed")

// Variant 1: object with 'id' field for extended engine configuration
assert.Equal(t, "object", variants[1]["type"],
"second variant should be type object (extended config with id)")
props1, ok := variants[1]["properties"].(map[string]any)
require.True(t, ok, "second variant should have properties")
assert.Contains(t, props1, "id",
"second variant should have an 'id' property")
idProp, ok := props1["id"].(map[string]any)
require.True(t, ok, "id property should be a map")
assert.Nil(t, idProp["enum"],
"id property must NOT have an enum so that named catalog entries are allowed")

// Variant 2: object with 'runtime' sub-object for inline definitions
assert.Equal(t, "object", variants[2]["type"],
"third variant should be type object (inline definition with runtime)")
props2, ok := variants[2]["properties"].(map[string]any)
require.True(t, ok, "third variant should have properties")
assert.Contains(t, props2, "runtime",
"third variant should have a 'runtime' property for inline engine definitions")
assert.Contains(t, props2, "provider",
"third variant should have a 'provider' property for inline engine definitions")
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

This test assumes the order of engine_config.oneOf variants (variants[0], [1], [2]), but JSON Schema does not guarantee semantic meaning by order and schema generation could reorder entries without changing behavior. To make the assertion robust, identify variants by their shape (e.g., type=="string"; object with properties.id; object with properties.runtime) instead of relying on array positions.

Suggested change
// Variant 0: plain string (no enum — allows built-ins and custom named catalog entries)
assert.Equal(t, "string", variants[0]["type"],
"first variant should be type string")
assert.Nil(t, variants[0]["enum"],
"string variant must NOT have an enum so that named catalog entries are allowed")
// Variant 1: object with 'id' field for extended engine configuration
assert.Equal(t, "object", variants[1]["type"],
"second variant should be type object (extended config with id)")
props1, ok := variants[1]["properties"].(map[string]any)
require.True(t, ok, "second variant should have properties")
assert.Contains(t, props1, "id",
"second variant should have an 'id' property")
idProp, ok := props1["id"].(map[string]any)
require.True(t, ok, "id property should be a map")
assert.Nil(t, idProp["enum"],
"id property must NOT have an enum so that named catalog entries are allowed")
// Variant 2: object with 'runtime' sub-object for inline definitions
assert.Equal(t, "object", variants[2]["type"],
"third variant should be type object (inline definition with runtime)")
props2, ok := variants[2]["properties"].(map[string]any)
require.True(t, ok, "third variant should have properties")
assert.Contains(t, props2, "runtime",
"third variant should have a 'runtime' property for inline engine definitions")
assert.Contains(t, props2, "provider",
"third variant should have a 'provider' property for inline engine definitions")
// Identify variants by shape rather than relying on their order in the oneOf array.
var (
stringVariant map[string]any
idObjectVariant map[string]any
runtimeObjectVariant map[string]any
)
for _, v := range variants {
vType, _ := v["type"].(string)
switch vType {
case "string":
stringVariant = v
case "object":
props, _ := v["properties"].(map[string]any)
if props == nil {
continue
}
if _, hasRuntime := props["runtime"]; hasRuntime {
runtimeObjectVariant = v
} else if _, hasID := props["id"]; hasID {
idObjectVariant = v
}
}
}
require.NotNil(t, stringVariant, "schema must include a plain string variant")
require.NotNil(t, idObjectVariant, "schema must include an object-with-id variant")
require.NotNil(t, runtimeObjectVariant, "schema must include an object-with-runtime variant")
// Plain string variant (no enum — allows built-ins and custom named catalog entries)
assert.Equal(t, "string", stringVariant["type"],
"string variant should be type string")
assert.Nil(t, stringVariant["enum"],
"string variant must NOT have an enum so that named catalog entries are allowed")
// Object with 'id' field for extended engine configuration
assert.Equal(t, "object", idObjectVariant["type"],
"object-with-id variant should be type object (extended config with id)")
props1, ok := idObjectVariant["properties"].(map[string]any)
require.True(t, ok, "object-with-id variant should have properties")
assert.Contains(t, props1, "id",
"object-with-id variant should have an 'id' property")
idProp, ok := props1["id"].(map[string]any)
require.True(t, ok, "id property should be a map")
assert.Nil(t, idProp["enum"],
"id property must NOT have an enum so that named catalog entries are allowed")
// Object with 'runtime' sub-object for inline definitions
assert.Equal(t, "object", runtimeObjectVariant["type"],
"object-with-runtime variant should be type object (inline definition with runtime)")
props2, ok := runtimeObjectVariant["properties"].(map[string]any)
require.True(t, ok, "object-with-runtime variant should have properties")
assert.Contains(t, props2, "runtime",
"object-with-runtime variant should have a 'runtime' property for inline engine definitions")
assert.Contains(t, props2, "provider",
"object-with-runtime variant should have a 'provider' property for inline engine definitions")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Phase 3: Extend schema and parser for inline and catalog-defined engine definitions

3 participants