Skip to content

Add engine.copilot-sdk-driver to override Copilot SDK driver script#36662

Merged
pelikhan merged 2 commits into
mainfrom
copilot/add-copilot-sdk-driver-field
Jun 3, 2026
Merged

Add engine.copilot-sdk-driver to override Copilot SDK driver script#36662
pelikhan merged 2 commits into
mainfrom
copilot/add-copilot-sdk-driver-field

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 3, 2026

This change adds support for a new frontmatter field, engine.copilot-sdk-driver, so workflows using engine.copilot-sdk: true can select a custom SDK driver script filename instead of always using the built-in copilot_sdk_driver.cjs.
The field is wired through parsing, schema validation, runtime validation, and Copilot execution generation.

  • Frontmatter + config model

    • Added CopilotSDKDriver to EngineConfig.
    • Parsed engine.copilot-sdk-driver in engine object extraction.
    • Propagated the field through detection-path engine config cloning.
  • Copilot SDK execution path

    • Updated Copilot SDK driver-mode command construction to use the configured driver filename when provided.
    • Preserves current default behavior when the field is unset (copilot_sdk_driver.cjs).
  • Validation + schema

    • Added runtime validation for engine.copilot-sdk-driver using the same safety rules as engine.harness (safe basename + .js/.cjs/.mjs).
    • Hooked validation into orchestrator engine-setting validation.
    • Extended main_workflow_schema.json with:
      • new property definition (copilot-sdk-driver)
      • pattern constraint
      • example entry in engine examples.
  • Tests + docs

    • Added parser/schema tests for valid/invalid engine.copilot-sdk-driver patterns.
    • Added workflow tests for extraction and Copilot execution behavior with custom SDK driver.
    • Updated reference docs (engines.md, frontmatter-full.md) to document usage and constraints.
engine:
  id: copilot
  copilot-sdk: true
  copilot-sdk-driver: custom_copilot_sdk_driver.cjs

Copilot AI and others added 2 commits June 3, 2026 15:07
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 engine.copilot-sdk-driver frontmatter field Add engine.copilot-sdk-driver to override Copilot SDK driver script Jun 3, 2026
Copilot AI requested a review from pelikhan June 3, 2026 15:18
@pelikhan pelikhan marked this pull request as ready for review June 3, 2026 16:01
Copilot AI review requested due to automatic review settings June 3, 2026 16:01
Copy link
Copy Markdown
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

Adds a new engine.copilot-sdk-driver frontmatter field so workflows using engine.copilot-sdk: true can override the Copilot SDK driver script filename (default remains copilot_sdk_driver.cjs). The change is wired through engine config extraction, schema + runtime validation, Copilot execution step generation, tests, and reference docs.

Changes:

  • Extend EngineConfig + frontmatter extraction to capture engine.copilot-sdk-driver.
  • Validate engine.copilot-sdk-driver as a safe Node.js script basename and use it when constructing Copilot SDK “driver mode” commands.
  • Update schema/tests/docs and rename the “Install GitHub Copilot SDK” workflow step label to clarify the runtime (Node.js).
Show a summary per file
File Description
pkg/workflow/threat_detection.go Propagates CopilotSDKDriver through threat-detection engine config cloning.
pkg/workflow/engine.go Parses engine.copilot-sdk-driver into EngineConfig.
pkg/workflow/engine_validation.go Adds shared script-filename validation and validates engine.copilot-sdk-driver.
pkg/workflow/engine_validation_test.go Adds unit tests for engine.copilot-sdk-driver runtime validation.
pkg/workflow/engine_config_test.go Adds extraction tests for engine.copilot-sdk-driver.
pkg/workflow/copilot_engine_test.go Adds execution-step test ensuring custom driver is used in SDK mode.
pkg/workflow/copilot_engine_execution.go Uses configured driver script name when building SDK driver-mode command.
pkg/workflow/compiler_orchestrator_workflow.go Wires validateEngineCopilotSDKDriver into workflow validation.
pkg/parser/schemas/main_workflow_schema.json Adds copilot-sdk-driver schema property + example + pattern constraint.
pkg/parser/schema_test.go Adds schema validation tests for copilot-sdk-driver patterns.
docs/src/content/docs/reference/frontmatter-full.md Documents the new engine.copilot-sdk-driver field in the full frontmatter reference.
docs/src/content/docs/reference/engines.md Documents the Copilot SDK driver override behavior and constraints.
.github/workflows/smoke-copilot-sdk.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/q.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/python-data-charts.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/pr-triage-agent.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/pr-nitpick-reviewer.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/pr-code-quality-reviewer.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/plan.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/pdf-summary.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/org-health-report.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/metrics-collector.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/mergefest.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/mcp-inspector.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/linter-miner.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/layout-spec-maintainer.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/jsweep.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/firewall.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/firewall-escape.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/draft-pr-cleanup.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/docs-noob-tester.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/discussion-task-miner.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/dictation-prompt.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/dev-hawk.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/deployment-incident-monitor.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/delight.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/dead-code-remover.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-workflow-updater.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-testify-uber-super-expert.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-syntax-error-quality.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-spdd-spec-planner.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-skill-optimizer.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-sentrux-report.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-security-observability.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-secrets-analysis.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-safe-output-integrator.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-repo-chronicle.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-performance-summary.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-model-inventory.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-mcp-concurrency-analysis.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-malicious-code-scan.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-issues-report.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-geo-optimizer.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-experiment-report.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-compiler-quality.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-cli-performance.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-assign-issue-to-user.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-architecture-diagram.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/daily-agent-of-the-day-blog-writer.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/craft.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/copilot-pr-prompt-analysis.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/copilot-pr-nlp-analysis.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/copilot-pr-merged-report.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/copilot-opt.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/copilot-cli-deep-research.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/code-scanning-fixer.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/cli-consistency-checker.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/ci-coach.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/breaking-change-checker.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/brave.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/artifacts-summary.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/architecture-guardian.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.
.github/workflows/agent-performance-analyzer.lock.yml Renames SDK install step to “Install GitHub Copilot SDK (Node.js)”.

Copilot's findings

Tip

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

  • Files reviewed: 74/74 changed files
  • Comments generated: 1

Comment on lines 613 to +617
Args: detectionEngineConfig.Args,
APITarget: detectionEngineConfig.APITarget,
MaxEffectiveTokens: detectionEngineConfig.MaxEffectiveTokens,
HarnessScript: detectionEngineConfig.HarnessScript,
CopilotSDKDriver: detectionEngineConfig.CopilotSDKDriver,
@pelikhan pelikhan merged commit fd92d5b into main Jun 3, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/add-copilot-sdk-driver-field branch June 3, 2026 16:17
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.

3 participants