Skip to content

feat: add copilot-sdk engine front matter field#35936

Merged
pelikhan merged 17 commits into
mainfrom
copilot/add-sdk-field-to-engine
May 30, 2026
Merged

feat: add copilot-sdk engine front matter field#35936
pelikhan merged 17 commits into
mainfrom
copilot/add-sdk-field-to-engine

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

Adds a copilot-sdk boolean field to the Copilot engine front matter. When enabled, the harness starts and stops a separate headless Copilot CLI sidecar on the configured localhost port and propagates COPILOT_SDK_URI to child processes. The @github/copilot-sdk package is already bundled with the Copilot CLI, so no additional installation step is required. The feature is marked as experimental: the schema labels it accordingly and the compiler emits an experimental warning when engine.copilot-sdk is enabled.

engine:
  id: copilot
  copilot-sdk: true

Constants

  • DefaultCopilotSDKPort = 3002 in constants.go
  • CopilotSDKURIEnvVar (COPILOT_SDK_URI) in engine_constants.go

Compiler / workflow engine

  • Execution (copilot_engine_execution.go): injects COPILOT_SDK_URI=http://127.0.0.1:3002 into the step env, without changing the main Copilot CLI invocation into transport mode
  • Schema (main_workflow_schema.json): copilot-sdk boolean added to the extended engine config object with updated behavior description and experimental labeling
  • Validation (compiler_validators.go): emits Using experimental feature: engine.copilot-sdk when the field is enabled

JS harnesses

  • process_runner.cjs: exported buildCopilotSDKEnv() helper returns { COPILOT_SDK_URI } when COPILOT_SDK_URI is set, {} otherwise
  • copilot_sdk_sidecar.cjs: owns the Copilot SDK sidecar URL/port parsing plus spawn, readiness, and shutdown helpers
  • copilot_harness.cjs: starts a separate headless Copilot CLI sidecar with --headless --no-auto-update --port <configured-port>, waits for the port to become ready, forwards COPILOT_SDK_URI to child processes, and stops the sidecar when the run completes
  • Tests: added focused Go and JS coverage for the updated SDK sidecar lifecycle, compiler contract, and experimental warning behavior

> Generated by 👨‍🍳 PR Sous Chef · gpt54 23.8M ·

Copilot AI and others added 3 commits May 30, 2026 14:35
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>
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot

  • merge main and recompile
  • find latest release version in github/copilot-sdk

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 30, 2026

@copilot

  • merge main and recompile
  • find latest release version in github/copilot-sdk

Done in b251421:

  • Merged main (resolved conflicts in the two lock files)
  • Latest @github/copilot-sdk npm release is v1.0.0-beta.10 — updated DefaultCopilotSDKVersion accordingly
  • Recompiled all 236 workflow lock files (0 errors)

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot copilot-sdk is installed by default with copilot-cli so the step does not need to be added when the copilot engine is used.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 30, 2026

@copilot copilot-sdk is installed by default with copilot-cli so the step does not need to be added when the copilot engine is used.

Done in the latest commit — removed the @github/copilot-sdk install step from GetInstallationSteps and cleaned up the now-unused DefaultCopilotSDKVersion / DefaultCopilotSDKPackage constants.

@pelikhan pelikhan marked this pull request as ready for review May 30, 2026 15:51
Copilot AI review requested due to automatic review settings May 30, 2026 15:51
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

…-to-engine

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 30, 2026

@copilot merge main and recompile

Checked on 00c12b4375: this branch is already up to date with main, and make recompile completed cleanly with no diff.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link
Copy Markdown
Contributor

@copilot summarize the remaining blockers and rerun checks.

Generated by 👨‍🍳 PR Sous Chef · gpt54 24.3M ·

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot when the copilot-sdk is enabled, the copilot harness should start and stop a copilot cli process in headless mode with the correct port.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot review all changes apply DRY / SOLID

Copilot AI and others added 4 commits May 30, 2026 19:05
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>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 30, 2026

@copilot review all changes apply DRY / SOLID

Addressed in 42a562b — centralized the copilot-sdk enablement check, made the sidecar lifecycle cleanup deterministic on startup/runtime failures, and tightened the lifecycle tests around listener cleanup.

Comment thread pkg/constants/engine_constants.go Outdated
// GHAWCopilotSDKEnvVar is the internal signal variable set by the compiler to tell
// the harness that copilot-sdk mode is active. The harness starts and stops the
// Copilot CLI headless sidecar and ensures COPILOT_SDK_URI is forwarded to child processes.
GHAWCopilotSDKEnvVar = "GH_AW_COPILOT_SDK"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot this one is not needed, use copilot_sdk_uri

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a028e1a — removed the extra GH_AW_COPILOT_SDK signal and now use COPILOT_SDK_URI as the copilot-sdk activation signal in the compiler, harness helpers, and tests.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main, recompile, fix conflicts

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

@copilot review all comments and address unresolved review feedback.

Generated by 👨‍🍳 PR Sous Chef · gpt54 23.8M ·

@github-actions
Copy link
Copy Markdown
Contributor

Please refresh the branch, rerun checks, and summarize any remaining blockers.

Generated by 👨‍🍳 PR Sous Chef · gpt54 23.8M ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 30, 2026

@copilot merge main, recompile, fix conflicts

Done in a2ca54c — merged main, resolved the copilot_harness.cjs conflict, and ran make recompile successfully on the merged tree.

@github-actions
Copy link
Copy Markdown
Contributor

@copilot refresh the branch and rerun checks, then summarize the remaining blockers.

Generated by 👨‍🍳 PR Sous Chef · gpt54 9.9M ·

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot mark as experimental

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 30, 2026

@copilot mark as experimental

Done in 8046680engine.copilot-sdk now emits an experimental compiler warning when enabled, and the schema text marks it as experimental.

@pelikhan pelikhan merged commit b1ae2f1 into main May 30, 2026
@pelikhan pelikhan deleted the copilot/add-sdk-field-to-engine branch May 30, 2026 20:19
@github-actions
Copy link
Copy Markdown
Contributor

@copilot review all comments and address unresolved review feedback.

Generated by 👨‍🍳 PR Sous Chef · gpt54 5.8M ·

@github-actions
Copy link
Copy Markdown
Contributor

@copilot summarize the remaining blockers and next steps.

Generated by 👨‍🍳 PR Sous Chef · gpt54 5.8M ·

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