Skip to content

refactor(copilot-sdk): multi-provider only — remove single-provider legacy#42740

Merged
pelikhan merged 18 commits into
mainfrom
copilot/refactor-copilot-sdk-harness
Jul 2, 2026
Merged

refactor(copilot-sdk): multi-provider only — remove single-provider legacy#42740
pelikhan merged 18 commits into
mainfrom
copilot/refactor-copilot-sdk-harness

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Removes the provider: ProviderConfig (single-session BYOK) code path entirely. All SDK sessions now use providers: NamedProviderConfig[] + models: ProviderModelConfig[], enabling per-provider wireApi routing. resolveMultiProviderFromReflect now activates on ≥1 configured endpoint (was ≥2).

Removed

  • resolveCopilotSDKCustomProviderFromReflect — single-provider resolver, all call sites, exports, and tests
  • parseWireApiEnv — no longer needed
  • GH_AW_COPILOT_SDK_PROVIDER_{BASE_URL,TYPE,WIRE_API} env vars from buildCopilotSDKChildEnv (driver no longer reads them)
  • Single-provider else fallback branch in harness provider resolution block
  • provider param from runWithCopilotSDK and createSession call

Changed

  • copilot_harness.cjs: provider resolution now calls resolveMultiProviderFromReflect directly; exits immediately on null (no fallback)
  • copilot_sdk_driver.cjs: requires GH_AW_COPILOT_SDK_MULTI_PROVIDER_JSON; exits with error if missing or unparseable; parseMultiProviderJson accepts ≥1 provider
  • copilot_sdk_session.cjs: createSession always passes providers/models; ternary removed
  • buildCopilotSDKChildEnv: still sets COPILOT_PROVIDER_* for the headless sidecar (sub-agent sessions); GH_AW_COPILOT_SDK_PROVIDER_* dropped
// Before: single-provider pattern (removed)
session = await client.createSession({ model, provider, onPermissionRequest });

// After: multi-provider always
session = await client.createSession({ model, providers, models, onPermissionRequest });

Generated by 👨‍🍳 PR Sous Chef · 12.7 AIC · ⌖ 10.4 AIC · ⊞ 6.4K ·


Generated by 👨‍🍳 PR Sous Chef · 8.66 AIC · ⌖ 21.3 AIC · ⊞ 6.4K ·


Generated by 👨‍🍳 PR Sous Chef · 10.5 AIC · ⌖ 16.1 AIC · ⊞ 6.4K ·

Copilot AI and others added 4 commits July 1, 2026 06:34
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>
@pelikhan pelikhan marked this pull request as ready for review July 1, 2026 12:11
Copilot AI review requested due to automatic review settings July 1, 2026 12:11
@pelikhan

pelikhan commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread actions/setup/js/copilot_sdk_driver.cjs Outdated
Comment on lines 62 to 74
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;
}
}
Comment on lines +509 to +513
* 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>"`.
*
Comment thread actions/setup/js/copilot_harness.cjs Outdated
Comment on lines +503 to +505
* 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.
Comment on lines +14 to +16
* 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)
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot this branch has merge conflicts. Please run make merge-main to merge the latest main branch and resolve any conflicts, then run make recompile, rerun checks, and push the result.

Generated by 👨‍🍳 PR Sous Chef · 27.2 AIC · ⌖ 28.7 AIC · ⊞ 6.4K ·

…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>

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Done — merged main (resolved .lock.yml conflicts) and recompiled workflows. All pre-commit checks pass.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Smoke Pi MISSION COMPLETE! Pi delivered. 🥧

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

✅ 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>
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Smoke Gemini MISSION COMPLETE! Gemini has spoken. ✨

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Smoke Antigravity MISSION COMPLETE! Antigravity has spoken. ✨

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot - AOAI (Entra) is now investigating this pull request. Sources say the story is developing...

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot - AOAI (apikey) is now investigating this pull request. Sources say the story is developing...

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review comments, and rerun checks once the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · 8.66 AIC · ⌖ 21.3 AIC · ⊞ 6.4K ·

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review comments, and rerun checks once the branch is up to date.

...

All review comments were already addressed in previous commits:

Review feedback (commit 7aad118):

  • Enhanced parseMultiProviderJson validation with shape checks
  • Clarified JSDoc for resolveMultiProviderFromReflect
  • Updated comments to reference COPILOT_PROVIDER_* correctly
  • Updated sample driver to use multi-provider pattern

Provider fixes:

  • Provider type inference (commit cefe704)
  • Provider resolution logging (commits 74d9fa3, 1ff53b5)
  • WireApi inference using configured model (commit a3c3df8)
  • Subagent model prefixing with "copilot/" for BYOK (commit 1734f83)

Branch status:

  • ✅ Up to date with main (merged in b2ada74)
  • ✅ All pre-commit checks pass
  • ✅ Working tree clean

Ready for CI validation.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Triage — Run §28572743533

Field Value
Category refactor
Risk 🔴 High
Score 75 / 100
Breakdown Impact: 40 · Urgency: 20 · Quality: 15
Action fast_track

✅ CI passing. Removes single-provider legacy from Copilot SDK, multi-provider only. High impact (critical path), breaking change potential — expedited review recommended.

Generated by 🔧 PR Triage Agent · 64.3 AIC · ⌖ 9.84 AIC · ⊞ 1.6K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, make sure the branch is up to date with main, address any remaining review feedback, and rerun checks.

Generated by 👨‍🍳 PR Sous Chef · 10.5 AIC · ⌖ 16.1 AIC · ⊞ 6.4K ·

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, make sure the branch is up to date with main, address any remaining review feedback, and rerun checks.

...

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:

  • make fmt
  • make lint
  • make recompile
  • make agent-report-progress

Working tree clean. Ready for CI validation.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, refresh this branch if needed, and address the remaining review feedback before rerunning checks. Please work through unresolved review comments, resolve or reply on any intentionally deferred items, and summarize the final status for maintainers.

Run: https://github.com/github/gh-aw/actions/runs/28611171544

Generated by 👨‍🍳 PR Sous Chef · 19.4 AIC · ⌖ 16.2 AIC · ⊞ 6.4K ·

Copilot AI and others added 2 commits July 2, 2026 18:17
…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>

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, refresh this branch if needed, and address the remaining review feedback before rerunning checks. Please work through unresolved review comments, resolve o...

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.

@pelikhan

pelikhan commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

@copilot review that sub agents calls weee successful at https://github.com/github/gh-aw/actions/runs/28601773743/job/84811696406

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@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.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, refresh this branch if needed, and address the remaining review feedback before rerunning checks. Please resolve or reply on any intentionally deferred review items and leave a concise maintainer-facing status note.

Run: https://github.com/github/gh-aw/actions/runs/28624179129

Generated by 👨‍🍳 PR Sous Chef · 12.5 AIC · ⌖ 16.8 AIC · ⊞ 3.1K ·

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, refresh this branch if needed, and address the remaining review feedback before rerunning checks. Please resolve or reply on any intentionally deferred rev...

PR Status Summary

✅ Reviews

All 4 review comments from @copilot-pull-request-reviewer were addressed in commit 7aad118:

  • Enhanced parseMultiProviderJson validation (non-empty models + shape checks)
  • Clarified JSDoc for resolveMultiProviderFromReflect return value
  • Updated comment in copilot_harness.cjs (now refers to COPILOT_PROVIDER_* for headless sidecar)
  • Updated sample driver to use multi-provider pattern

No unresolved review threads remain.

✅ Checks (local)

All local validation passed:

  • make fmt
  • make lint
  • make recompile
  • make agent-report-progress

✅ Mergeable

Branch 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:

  • Provider type inference for copilot/github-copilot → openai wire type (cefe704)
  • Provider resolution logging added (74d9fa3, 1ff53b5)
  • WireApi inference using configured model (a3c3df8)
  • Subagent model prefixing with "copilot/" for BYOK (1734f83)

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.

@pelikhan pelikhan merged commit 2f7742c into main Jul 2, 2026
14 checks passed
@pelikhan pelikhan deleted the copilot/refactor-copilot-sdk-harness branch July 2, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants