refactor(copilot-sdk): multi-provider only — remove single-provider legacy#42740
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 merge main and recompile |
There was a problem hiding this comment.
Pull request overview
This PR removes the legacy single-provider Copilot SDK configuration path and standardizes SDK sessions on multi-provider configuration (providers[] + models[]) sourced from AWF /reflect, with the harness/driver contract shifting to a single required env var (GH_AW_COPILOT_SDK_MULTI_PROVIDER_JSON).
Changes:
- Removed the single-provider resolver/contract and updated the harness + driver to exclusively use multi-provider config.
- Added multi-provider resolution in
awf_reflect.cjs, including provider/model list construction and duplicate provider-name handling. - Updated tests to reflect multi-provider session creation and resolution behavior; regenerated several workflow lockfiles.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/copilot_sdk_session.cjs | Updates session creation to pass providers/models into createSession. |
| actions/setup/js/copilot_sdk_driver.cjs | Requires/parses GH_AW_COPILOT_SDK_MULTI_PROVIDER_JSON and passes multi-provider config into the session runner. |
| actions/setup/js/copilot_sdk_driver.test.cjs | Removes parseWireApiEnv coverage and updates a targeted test to validate multi-provider createSession args. |
| actions/setup/js/copilot_harness.cjs | Switches harness provider resolution to resolveMultiProviderFromReflect and injects multi-provider JSON into driver env. |
| actions/setup/js/copilot_harness.test.cjs | Updates env-building tests and removes single-provider resolver assertions. |
| actions/setup/js/awf_reflect.cjs | Implements resolveMultiProviderFromReflect and supporting utilities for multi-provider config generation. |
| actions/setup/js/awf_reflect.test.cjs | Replaces single-provider resolver tests with multi-provider resolution test suite. |
| actions/setup/js/add_reaction_and_edit_comment.cjs | Minor formatting change (ternary expression). |
| .github/workflows/uk-ai-operational-resilience.lock.yml | Regenerated lock metadata/manifests. |
| .github/workflows/test-quality-sentinel.lock.yml | Regenerated lock metadata/manifests. |
| .github/workflows/pr-sous-chef.lock.yml | Regenerated lock metadata/manifests. |
| .github/workflows/impeccable-skills-reviewer.lock.yml | Regenerated lock metadata/manifests. |
| .github/workflows/daily-geo-optimizer.lock.yml | Regenerated lock metadata/manifests (includes manifest secret list changes). |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 13/13 changed files
- Comments generated: 4
- Review effort level: Low
| function parseMultiProviderJson(raw) { | ||
| if (!raw) return null; | ||
| try { | ||
| const parsed = JSON.parse(raw); | ||
| if (!parsed || typeof parsed !== "object") return null; | ||
| if (!Array.isArray(parsed.providers) || parsed.providers.length < 1) return null; | ||
| if (!Array.isArray(parsed.models)) return null; | ||
| const model = typeof parsed.model === "string" ? parsed.model.trim() : ""; | ||
| return { model, providers: parsed.providers, models: parsed.models }; | ||
| } catch { | ||
| return null; | ||
| } | ||
| } |
| * Each endpoint becomes a `NamedProviderConfig` (using the endpoint's `provider` | ||
| * field as the stable name) and every model advertised by that endpoint becomes a | ||
| * `ProviderModelConfig` referencing it. The provider-qualified selection id for | ||
| * a model is `"<providerName>/<modelId>"`. | ||
| * |
| * When `multiProviderJson` is set, the driver will use the experimental | ||
| * multi-provider BYOK surface and the single-provider env vars are still | ||
| * populated from the primary provider for the headless sidecar. |
| * GH_AW_COPILOT_SDK_MULTI_PROVIDER_JSON — JSON-encoded multi-provider config (required). | ||
| * Shape: { model, providers: NamedProviderConfig[], models: ProviderModelConfig[] } | ||
| * GH_AW_COPILOT_SDK_SERVER_ARGS — JSON-encoded allow-tool sidecar args (set by the engine) |
|
@copilot this branch has merge conflicts. Please run
|
…lot-sdk-harness # Conflicts: # .github/workflows/impeccable-skills-reviewer.lock.yml # .github/workflows/pr-sous-chef.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done — merged |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
🚀 Smoke Pi MISSION COMPLETE! Pi delivered. 🥧 |
|
✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready. |
…lot-sdk-harness Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
🚀 Smoke Gemini MISSION COMPLETE! Gemini has spoken. ✨ |
|
🚀 Smoke Antigravity MISSION COMPLETE! Antigravity has spoken. ✨ |
|
📰 BREAKING: Smoke Copilot - AOAI (Entra) is now investigating this pull request. Sources say the story is developing... |
|
📰 BREAKING: Smoke Copilot - AOAI (apikey) is now investigating this pull request. Sources say the story is developing... |
|
@copilot please run the
|
All review comments were already addressed in previous commits: Review feedback (commit 7aad118):
Provider fixes:
Branch status:
Ready for CI validation. |
🤖 PR Triage — Run §28572743533
|
|
@copilot please run the
|
Branch is already up to date with main (merged in c8f16e6). All review feedback was addressed in previous commits (7aad118, cefe704, 74d9fa3, 1ff53b5, a3c3df8, 1734f83). All pre-commit checks pass:
Working tree clean. Ready for CI validation. |
|
@copilot please run the Run: https://github.com/github/gh-aw/actions/runs/28611171544
|
…lot-sdk-harness Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Branch refreshed with latest main (merged 21 commits in c02832f, recompiled workflows in c22614d). All review feedback was previously addressed. All pre-commit checks pass. Ready for CI validation. |
|
@copilot review that sub agents calls weee successful at https://github.com/github/gh-aw/actions/runs/28601773743/job/84811696406 |
Confirmed ✅ — Job 84811696406 completed successfully. The "Smoke Copilot Sub Agents" workflow executed all 40 steps without errors (conclusion: success, duration: ~3min). Provider config shows copilot endpoint active with 32 models including claude-haiku-4.5, claude-opus variants, and proper multi-provider setup. The sub-agent model prefixing fix (commit 1734f83) is working as intended. |
|
@copilot please run the Run: https://github.com/github/gh-aw/actions/runs/28624179129
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
PR Status Summary✅ ReviewsAll 4 review comments from @copilot-pull-request-reviewer were addressed in commit 7aad118:
No unresolved review threads remain. ✅ Checks (local)All local validation passed:
✅ MergeableBranch refreshed with latest main (merged 7 commits in 1abc8eb). No conflicts. Working tree clean. ❓ Checks (CI)CI is stale after agent push. The agent cannot re-trigger CI—that requires maintainer action (close/reopen PR, workflow_dispatch, or push). Prior fixes committed:
All fixes were validated locally and confirmed successful in prior CI run 28601773743. Hand-off: CI must be re-triggered by a maintainer (close/reopen PR, workflow_dispatch, or push) to verify the agent's HEAD (1abc8eb). All pre-commit checks green; no agent-actionable work remains. |
Removes the
provider: ProviderConfig(single-session BYOK) code path entirely. All SDK sessions now useproviders: NamedProviderConfig[]+models: ProviderModelConfig[], enabling per-providerwireApirouting.resolveMultiProviderFromReflectnow activates on ≥1 configured endpoint (was ≥2).Removed
resolveCopilotSDKCustomProviderFromReflect— single-provider resolver, all call sites, exports, and testsparseWireApiEnv— no longer neededGH_AW_COPILOT_SDK_PROVIDER_{BASE_URL,TYPE,WIRE_API}env vars frombuildCopilotSDKChildEnv(driver no longer reads them)elsefallback branch in harness provider resolution blockproviderparam fromrunWithCopilotSDKandcreateSessioncallChanged
copilot_harness.cjs: provider resolution now callsresolveMultiProviderFromReflectdirectly; exits immediately on null (no fallback)copilot_sdk_driver.cjs: requiresGH_AW_COPILOT_SDK_MULTI_PROVIDER_JSON; exits with error if missing or unparseable;parseMultiProviderJsonaccepts ≥1 providercopilot_sdk_session.cjs:createSessionalways passesproviders/models; ternary removedbuildCopilotSDKChildEnv: still setsCOPILOT_PROVIDER_*for the headless sidecar (sub-agent sessions);GH_AW_COPILOT_SDK_PROVIDER_*dropped