Repository navigation
fix: use per-model SDK providers for Contribution Check delegates - #69870
Conversation
Keep the auto-selected main model and gpt-6-luna delegates while allowing each model to use its supported endpoint. Cover workflow configuration, emitted SDK wiring, model qualification, and prompt preservation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Verdict
Non-blocking, but the new regression coverage still has two weak spots.
Themes
- The new SDK regression test is over-coupled to the checked-in workflow and generated lock, so unrelated workflow-copy or lock churn can fail an
actions/setup/jsunit test. - The test also hardcodes the resolved Claude model, which means it does not exercise the
COPILOT_MODEL=autopath that triggered the production failure described in the PR.
I reviewed this statically from the supplied diff and surrounding source only; I did not execute the suite.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 127.6 AIC · ⌖ 5.93 AIC · ⊞ 12.7K
Comment /review to run again
| expect(document.errors).toEqual([]); | ||
| expect(document.toJS().engine).toMatchObject({ id: "copilot", "copilot-sdk": true, agent: "contribution-checker" }); | ||
| const lock = parseDocument(fs.readFileSync(path.join(root, ".github/workflows/contribution-check.lock.yml"), "utf8")); | ||
| expect(lock.errors).toEqual([]); |
There was a problem hiding this comment.
This regression test is tightly coupled to the checked-in workflow and generated lock, so unrelated workflow-copy or recompile changes will start failing the Copilot SDK session suite even when provider routing is still correct.
💡 Why this matters
This block now depends on .github/workflows/contribution-check.md, the generated .lock.yml, the exact inline-agent names, and prompt bodies. Any future rename, prompt tweak, or harmless lock regeneration in Contribution Check will break an actions/setup/js unit test that is supposed to validate SDK provider routing.
A smaller fixture would keep the test focused on the contract that matters here: SDK mode enabled, no global COPILOT_PROVIDER_WIRE_API, and GPT delegates resolving to the Responses provider.
| expect(lock.errors).toEqual([]); | |
| const workflow = `--- | |
| engine: | |
| id: copilot | |
| copilot-sdk: true | |
| agent: contribution-checker | |
| --- | |
| <!-- minimal inline agents here -->`; | |
| // assert only the routing contract, not the whole checked-in workflow copy |
| for (const agent of agents) fs.writeFileSync(path.join(base, `.github/agents/${agent.name}.agent.md`), agent.content); | ||
|
|
||
| // Endpoint capabilities observed in Contribution Check run 39098581712. | ||
| const config = resolveMultiProviderFromReflect({ |
There was a problem hiding this comment.
This setup bypasses the production failure path because it hardcodes claude-sonnet-5.5 instead of exercising the COPILOT_MODEL=auto resolution that actually selected the Claude main in the failing run.
💡 Why this matters
The bug report here is specifically about an auto-selected Claude main spawning GPT delegates that only support Responses. By injecting an already-resolved model into resolveMultiProviderFromReflect, the test never proves that the workflow-to-SDK handoff preserves the auto/main-model decision. A regression in that handoff would still pass this test.
Please drive the case through the same env path the workflow uses, or add a higher-level assertion that starts with COPILOT_MODEL=auto and verifies the resolved session still maps the delegates to copilot-responses/gpt-6-luna.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs (primary) with a sanity pass against /tdd principles. No actionable issues found — approving.
📋 Key Themes & Highlights
Root cause fix
The single-line copilot-sdk: true addition directly addresses the documented endpoint mismatch (Claude main resolving to /chat/completions while GPT-6-luna delegates only support /responses), rather than papering over symptoms.
Regression test (copilot_sdk_session.test.cjs)
- Uses the actual
contribution-check.mdsource and generated.lock.yml, not a synthetic fixture. - Replays the real endpoint/routing metadata observed in the failing run (39098581712).
- Asserts per-model provider selection, preserved
gpt-6-lunadelegate models/prompts, and absence of both a global wire-API override and the "warning: custom agent" log — the precise failure signature from the original bug. - I statically traced every imported helper (
resolveMultiProviderFromReflect,extractInlineSubAgents,extractFrontmatterAndBody,parseDocument,loadCopilotSDKCustomAgents) to confirm signatures/behavior match; localvitestexecution was blocked by sandbox network restrictions (self-signed cert on the registry), so this review relied on code tracing rather than a live test run.
Scope discipline
Prompts, delegate models, and existing safe outputs are explicitly preserved and verified — no unrelated behavior changed. Diff is minimal (103/3 across 3 files) and tightly scoped to the fix.
Note: I was unable to execute the test suite locally due to sandbox network restrictions blocking package installation; verification here is based on static code tracing of the new test's dependencies rather than a live run. If CI confirms the test passes against the regenerated lock, this is good to merge.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 43 AIC · ⌖ 15.8 AIC · ⊞ 10.1K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
The SDK denial limit can terminate this workflow during permission failures that previously allowed recovery.
1 open issue
What changed in this PR
Enables Copilot SDK mode for Contribution Check so its main agent and GPT delegates use model-compatible APIs.
Changes:
- Enable SDK execution without changing declared models or prompts.
- Regenerate workflow execution settings.
- Add regression coverage for per-model routing.
| File | Description |
|---|---|
actions/setup/js/copilot_sdk_session.test.cjs |
Tests workflow-based routing and delegate preservation. |
.github/workflows/contribution-check.md |
Enables Copilot SDK mode. |
.github/workflows/contribution-check.lock.yml |
Adds SDK installation and runtime configuration. |
Review effort: Max
| engine: | ||
| id: copilot | ||
| # GPT delegates need Responses while the auto-selected Claude main uses Chat Completions. | ||
| copilot-sdk: true |
…9870) Keep the auto-selected main model and gpt-6-luna delegates while allowing each model to use its supported endpoint. Cover workflow configuration, emitted SDK wiring, model qualification, and prompt preservation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>


Summary
Enable the existing Copilot SDK mode for Contribution Check so the main agent and its delegates use separate, model-compatible wire APIs. Preserve the auto-selected main model, both
gpt-6-lunadelegates, all prompts, request features, endpoint validation, and existing safe outputs. Regenerate the workflow lock.Root cause
Contribution Check run 39098581712 succeeded overall but both
report-formatterandcomment-dispatcheremittedsubagent.failedwith zero tool calls. Copilot CLI 1.0.98 resolvedautotoclaude-sonnet-5.5and selected the session-wide/chat/completionsendpoint. The same run's provider metadata advertised only/responses(and WebSocket Responses) forgpt-6-luna. AWF v0.28.62 correctly rejected translatingtools[custom]between the APIs. This is an endpoint/feature mismatch, not missing AI-credit pricing.Copilot SDK mode already resolves per-model providers: Claude uses
copilot-completions, while GPT delegates usecopilot-responses. The existing SDK cross-family smoke run 38985601226 records a real GPTsubagent.completedunder a Claude main, independently supporting this configuration path.Regression coverage
Add a regression using the actual Contribution Check source, generated lock, inline agent definitions, and the observed models' endpoint metadata. It verifies SDK activation, absence of a global wire-API override, per-model provider selection, retained
gpt-6-lunadelegate models and prompts, and no model-substitution warning. The test failed against the old compiled CLI lock and passes with the regenerated SDK lock.Validation
make recompile: 344/344 workflows compiled; only Contribution Check's lock changed.make fmt-cjsandmake lint-cjspassed (existing repository warnings only).make agent-report-progresspassed, including typecheck, impacted tests, and workflow drift. No Go files changed; impacted Go testing correctly skipped.gh-aw-detectionexperimental notice explicitly accepted.No new workflow run was dispatched. The updated Contribution Check has not been live-run; validation covers local configuration/runtime handoff and existing run evidence. Audit-success wording and CLI coverage-reporting surfaces are unchanged.