Fix Copilot SDK sample driver BYOK session configuration in Daily Model Inventory workflow#37454
Merged
Merged
Conversation
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>
Copilot
AI
changed the title
[WIP] Fix daily model inventory checker workflow failure
Fix Copilot SDK sample driver BYOK session configuration in Daily Model Inventory workflow
Jun 7, 2026
pelikhan
reviewed
Jun 7, 2026
| import { createRequire } from "module"; | ||
|
|
||
| const require = createRequire(import.meta.url); | ||
| const { buildSessionConfig } = require("../../../.github/drivers/copilot_sdk_driver_sample_node.cjs"); |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Copilot SDK sample Node driver used by the Daily Model Inventory workflow so it can correctly include BYOK provider configuration when the harness exports GH_AW_COPILOT_SDK_PROVIDER_BASE_URL, and so the driver can be safely imported without executing its main().
Changes:
- Added
buildSessionConfig(model, onPermissionRequest)to includeprovider: { type: "openai", baseUrl }whenGH_AW_COPILOT_SDK_PROVIDER_BASE_URLis set. - Updated
createSession(...)to consume the new session config builder. - Wrapped execution with
if (require.main === module)and exportedbuildSessionConfigfor safe import.
Show a summary per file
| File | Description |
|---|---|
.github/drivers/copilot_sdk_driver_sample_node.cjs |
Adds BYOK-aware session config construction and prevents side effects on import. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
Comment on lines
42
to
+43
| async function main() { | ||
| const { CopilotClient, approveAll } = require("@github/copilot-sdk"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Daily Model Inventory Checker failed because the Copilot SDK sample Node driver created a session without provider configuration, causing SDK auth initialization to fail (
Session was not created with authentication info or custom provider) despite harness-resolved BYOK metadata.Root cause
.github/drivers/copilot_sdk_driver_sample_node.cjs.GH_AW_COPILOT_SDK_PROVIDER_BASE_URL, but the sample driver did not passproviderintocreateSession(...).What changed
buildSessionConfig(...)in.github/drivers/copilot_sdk_driver_sample_node.cjs.GH_AW_COPILOT_SDK_PROVIDER_BASE_URLis set, session config now includes:provider: { type: "openai", baseUrl: ... }createSession(...)now consumes this config.buildSessionConfig(...).require.main === moduleso importing the driver does not executemain().