fix: use per-model SDK providers for Contribution Check delegates by pelikhan · Pull Request #69870 · github/gh-aw · GitHub
Skip to content

fix: use per-model SDK providers for Contribution Check delegates - #69870

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan-delegation-endpoint-compatibility
Oct 18, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan-delegation-endpoint-compatibility

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

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-luna delegates, 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-formatter and comment-dispatcher emitted subagent.failed with zero tool calls. Copilot CLI 1.0.98 resolved auto to claude-sonnet-5.5 and selected the session-wide /chat/completions endpoint. The same run's provider metadata advertised only /responses (and WebSocket Responses) for gpt-6-luna. AWF v0.28.62 correctly rejected translating tools[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 use copilot-responses. The existing SDK cross-family smoke run 38985601226 records a real GPT subagent.completed under 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-luna delegate 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

  • 132 SDK session/provider tests passed.
  • make recompile: 344/344 workflows compiled; only Contribution Check's lock changed.
  • make fmt-cjs and make lint-cjs passed (existing repository warnings only).
  • make agent-report-progress passed, including typecheck, impacted tests, and workflow drift. No Go files changed; impacted Go testing correctly skipped.
  • Strict dry-run compilation passed shellcheck, actionlint, zizmor, and poutine differential gates, with no added actionable scanner findings. Existing gh-aw-detection experimental notice explicitly accepted.
  • Read-only security review found no vulnerabilities in the change.

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.

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>
@pelikhan
pelikhan marked this pull request as ready for review October 18, 2026 06:31
Copilot AI max review requested due to automatic review settings October 18, 2026 06:31
@pelikhan
pelikhan merged commit 64b168b into main Oct 18, 2026
30 of 32 checks passed
@pelikhan
pelikhan deleted the pelikhan-delegation-endpoint-compatibility branch October 18, 2026 06:32
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

Generated from Test Quality Sentinel · haiku45 · 4.22 AIC · ⌖ 8.41 AIC · ◇ 1.7 AIC · ⊞ 9.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated from Ponytail Reviewer · gpt56 · 5.89 AIC · ⌖ 5.52 AIC · ⊞ 14.6K · ◷

Generated by Ponytail Reviewer for #69870

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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: reported_no_action

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.

Generated from Design Decision Gate 🏗️ · opus55 · 9.96 AIC · ⌖ 31.8 AIC · ◇ 14.7 AIC · ⊞ 1.9K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-18T06:34:20.602+00:00
review_event: COMMENT
top_themes:
  - brittle workflow-coupled regression coverage
  - missing auto-model resolution coverage
files_reviewed:
  - .github/workflows/contribution-check.md
  - actions/setup/js/copilot_sdk_session.test.cjs
comment_count: 2

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 127.6 AIC · ⌖ 5.93 AIC · ⊞ 12.7K · ◷
Comment /review to run again

@github-actions github-actions Bot 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.

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/js unit test.
  • The test also hardcodes the resolved Claude model, which means it does not exercise the COPILOT_MODEL=auto path 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([]);

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.

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.

Suggested change
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({

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.

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.

@github-actions github-actions Bot 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.

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.md source 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-luna delegate 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; local vitest execution 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

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.

🟡 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
Copilot AI pushed a commit that referenced this pull request Oct 18, 2026
…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>
@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants