Add multi-language Copilot SDK driver samples and wire daily workflows to exercise runtime installs#36734
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot the sample drivers should be self-contained programs that use the copilot SDK APIs in each language to create a client, create a session, run prompts, and output the result to the console. Do not spawn copilot_sdk_driver.cjs |
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>
Addressed in c844585. The sample drivers are now self-contained SDK flows: Node/TypeScript/Python create a client, create a session, run the prompt from |
|
There was a problem hiding this comment.
Pull request overview
This PR adds minimal Copilot SDK driver samples in multiple scripting languages and updates daily Copilot SDK workflows so scheduled runs exercise runtime-specific installation and execution paths (including custom driver resolution from the repository workspace).
Changes:
- Added
.github/drivers/sample SDK drivers (Node, TypeScript, Python, Ruby) and configured daily workflows to use them viaengine.copilot-sdk-driver. - Updated Copilot engine execution to resolve custom SDK drivers from
${GITHUB_WORKSPACE}/.github/driversinstead of the setup-action directory. - Updated Copilot SDK install mapping so TypeScript drivers install
ts-node+typescriptalongside@github/copilot-sdk.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/copilot_engine_test.go | Updates tests for custom-driver resolution path and TypeScript install expectations. |
| pkg/workflow/copilot_engine_installation.go | Adds a TypeScript-specific SDK install spec and runtime detection for ts-node. |
| pkg/workflow/copilot_engine_execution.go | Resolves custom SDK drivers from workspace .github/drivers and adjusts command formatting. |
| .github/workflows/daily-workflow-updater.md | Sets the daily updater to use the Ruby sample SDK driver. |
| .github/workflows/daily-workflow-updater.lock.yml | Regenerated lockfile reflecting the Ruby driver wiring/execution. |
| .github/workflows/daily-skill-optimizer.md | Sets the daily skill optimizer to use the TypeScript sample SDK driver. |
| .github/workflows/daily-skill-optimizer.lock.yml | Regenerated lockfile reflecting the TypeScript driver install/execution. |
| .github/workflows/daily-model-inventory.md | Sets the daily model inventory workflow to use the Node sample SDK driver. |
| .github/workflows/daily-model-inventory.lock.yml | Regenerated lockfile reflecting the Node driver wiring/execution. |
| .github/workflows/daily-issues-report.md | Sets the daily issues report workflow to use the Python sample SDK driver. |
| .github/workflows/daily-issues-report.lock.yml | Regenerated lockfile reflecting the Python driver install/execution. |
| .github/drivers/copilot_sdk_driver_sample_typescript.ts | New TypeScript Copilot SDK driver sample. |
| .github/drivers/copilot_sdk_driver_sample_ruby.rb | New Ruby (Node-embedded) Copilot SDK driver sample. |
| .github/drivers/copilot_sdk_driver_sample_python.py | New Python Copilot SDK driver sample. |
| .github/drivers/copilot_sdk_driver_sample_node.cjs | New Node Copilot SDK driver sample. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 15/15 changed files
- Comments generated: 5
| driverRuntimeCmd, driverArg := copilotSDKDriverExecArgs(sdkDriverScriptName) | ||
| if driverArg != "" { |
| onPermissionRequest: approveAll, | ||
| ...(model ? { model } : {}), | ||
| }); | ||
| const response = await session.sendAndWait({ prompt }); |
| ...(model ? { model } : {}), | ||
| }); | ||
|
|
||
| const response = await session.sendAndWait({ prompt }); |
| onPermissionRequest: approveAll, | ||
| ...(model ? { model } : {}), | ||
| }); | ||
| const response = await session.sendAndWait({ prompt }); |
| if model: | ||
| create_kwargs["model"] = model | ||
| session = await client.create_session(**create_kwargs) | ||
| response = await session.send_and_wait(prompt) |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commits
|
|
@copilot merge main and recompile |
…dk-driver-samples # Conflicts: # .github/workflows/daily-issues-report.lock.yml # .github/workflows/daily-model-inventory.lock.yml # .github/workflows/daily-skill-optimizer.lock.yml # .github/workflows/daily-workflow-updater.lock.yml # docs/src/content/docs/reference/copilot-sdk-driver-specification.md Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done — merged main (resolving conflicts in 4 lock files and the spec, keeping our |
|
@copilot remove implicit support for |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…shell-safety comment Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. The implicit Also addressed two follow-up issues from code review:
|
This PR adds minimal Copilot SDK driver samples for each supported script language and assigns them to daily Copilot SDK workflows. The goal is to ensure runtime-specific Copilot SDK installation paths are exercised continuously in real workflow runs.
Driver samples in repository
.github/drivers/with minimal script drivers for:.cjs).py).ts).rb)copilot_sdk_driver.cjs).COPILOT_MODELis a required environment variable in all sample drivers; each driver fails fast with a clear error when it is not set.Daily workflow assignment
engine.copilot-sdk-drivervalues as full workspace-relative paths (e.g..github/drivers/copilot_sdk_driver_sample_python.py) so each runtime path is covered by scheduled automation.Copilot SDK execution path
.github/driverspath prefix from the execution engine. Thecopilot-sdk-driverfield value is now used directly as a workspace-relative path (${GITHUB_WORKSPACE}/<value>). Callers must always specify the full relative path from the workspace root.Validation
validateEngineCopilotSDKDriverto allow/-separated relative paths with safe segments while rejecting absolute paths,.., backslashes, shell metacharacters, empty segments (consecutive//, trailing/), and unsupported extensions.copilot-sdk-driverto match the new path format.Runtime install mapping
ts-node+typescriptalongside@github/copilot-sdk, so.ts/.mtsdrivers execute without extra manual setup.Specification and docs
copilot-sdk-driver-specification.mdto markCOPILOT_MODELas a required standalone environment variable with a MUST constraint, and updated the non-normative TypeScript example accordingly.engines.mdreference docs to show full workspace-relative path examples and documentCOPILOT_MODELas required.