Repository navigation
fix(workflow): preserve Copilot BYOK HTTP API targets - #71680
Conversation
Reuse version-gated API proxy target formatting while preserving Copilot target precedence, literal URL handling, and host-only allowlists. Regenerate the affected Ollama workflow lock and cover HTTP routing compatibility with regression tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Commit pushed:
|
|
✅ 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.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
🏗️ Design Decision Gate — ADR RequiredThis PR adds more than 100 lines under 📄 Draft ADR committed: Decision taken from the diff: the Copilot target precedence chain (explicit
📋 What to do next
After the ADR is linked in the PR body, this gate runs again and checks that the implementation matches the decision. ❓ Why ADRs MatterADRs give the repository a permanent, searchable record of why the code is shaped the way it is. That record helps future contributors, including you. 📋 Michael Nygard ADR Format ReferenceAn ADR is complete only when it has these four sections:
ADRs are stored in
|
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.
Request changes
The checked-in generated Ollama workflow is stale: its embedded AWF config still uses the bare host.docker.internal:11434 target, so this fix is not present in the workflow that will run and compile-drift validation is likely to fail. Regenerate and commit the lock file, then verify the emitted target includes `(redacted)
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd (via pr-triage: bug_fix) — approving. This is a well-diagnosed, well-tested fix.
📋 Key Themes & Highlights
Root cause and fix
- Correctly identifies that
extractAPITargetHostwas stripping the(redacted) prefix needed by self-hosted BYOK backends (Ollama), and fixes it by introducing a scheme-preserving variant (extractAPIProxyTargetHost) that is version-gated behindAWFHTTPAPITargetMinVersion(awfSupportsHTTPAPITargets`). resolveCopilotAPITargetcleanly shares the precedence logic (explicitapi-target→GITHUB_COPILOT_BASE_URL→ literalCOPILOT_PROVIDER_BASE_URL) between the host-only allowlist consumer (GetCopilotAPITarget) and the API-proxy config builder, via an injectedextractHostfunction — good use of dependency injection to avoid duplicating the precedence chain (/codebase-designdeepening).
Test coverage (/tdd)
- The regression suite grew from 1 assertion-based case to 14 table-driven cases, covering: HTTP preservation at/above/below the min AWF version, HTTPS and bare-host behavior (unchanged), explicit
api-targetandGITHUB_COPILOT_BASE_URLprecedence over the BYOK URL, GitHub-expression values correctly rejected as literal targets, and a direct assertion that the firewall allowlist stays scheme-free (assert.NotContains(host, "://")) — this is exactly the kind of boundary-condition coverage/tddcalls for. - Test names read as specifications (e.g. "older AWF retains bare host and port", "GitHub HTTPS URL is not changed by HTTP provider URL").
Lock file
daily-byok-ollama-test.lock.ymldiff is a single-line, single-field change (thecopilottarget host gains `(redacted) matching the PR description; firewall allowlist, models, and credit guards are untouched, as claimed.
Minor nit
- Left one inline comment on
engine_api_targets.goabout the BYOK fallback looking upCOPILOT_PROVIDER_BASE_URLtwice (once to validate it's not a GitHub expression, once to extract the host) — purely cosmetic, non-blocking.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · ~56 AIC · ⌖ ~16 AIC · ⊞ 10.2K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
The expanded HTTP handling can transmit GitHub authentication tokens in cleartext outside BYOK mode.
1 open issue
What changed in this PR
Updates the gh-aw compiler to preserve HTTP schemes in Copilot API proxy targets while retaining host-only firewall allowlists and AWF version compatibility.
Changes:
- Shares target resolution with consumer-specific formatting.
- Expands regression coverage to 14 cases.
- Regenerates the Ollama workflow configuration and documents the design.
| File | Description |
|---|---|
pkg/workflow/engine_api_targets.go |
Extracts shared Copilot target resolution. |
pkg/workflow/awf_helpers_test.go |
Tests schemes, precedence, compatibility, and allowlists. |
pkg/workflow/awf_config_build.go |
Applies version-gated formatting to Copilot targets. |
docs/adr/71680-share-copilot-api-target-resolution-with-pluggable-host-formatter.md |
Records the design and alternatives. |
.github/workflows/daily-byok-ollama-test.lock.yml |
Preserves HTTP in the generated Ollama target. |
Review effort: Max
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 55245c6
|
Keep GitHub-token base URLs host-only, extract literal BYOK hosts once, and cover token handling and transport boundaries. Update the draft ADR to reflect the provider-only decision. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
In reply to this comment: Accepted the ADR follow-up: reviewed and updated the generated draft in 973bf25 and linked it in the PR body. It now documents provider-only HTTP preservation and remains Draft pending human acceptance. |
|
In reply to this comment: Acknowledged; this status report requests no implementation change and is not being treated as proof of validation. The updated batch passed focused Copilot/config tests and |
|
In reply to this comment: Acknowledged; no implementation change is requested by this status report. Validation of the updated batch was performed locally rather than inferred from the reported no-op outcome. |
|
In reply to this comment: Acknowledged the completed review and evaluated its inline finding separately. The stale-lock claim is already satisfied by the checked-in HTTP target, and all 348 workflows compile without lock drift. |
|
In reply to this comment: Accepted the associated simplification feedback in 973bf25: literal provider hosts are extracted once without a formatter callback. The remaining review notification requires no separate code change. |
|
In reply to this comment: Accepted: updated the ADR in 973bf25 and linked it in the PR body, replacing the unverified decider attribution with an explicit pending-human-review status. The decision and alternatives now match the simpler resolver and restrict HTTP preservation to literal BYOK provider targets. |
|
In reply to this comment: Declined the stale-lock finding as already satisfied: the checked-in Ollama target contains |
|
🎉 This pull request is included in a new release. Release: |

Summary
Copilot BYOK config generation stripped
http://from literal provider URLs, emittinghost.docker.internal:11434instead ofhttp://host.docker.internal:11434. This loses the protocol information needed to route to HTTP backends such as Ollama.COPILOT_PROVIDER_BASE_URLfallback.GITHUB_COPILOT_BASE_URLhost-only so GitHub-token-authenticated traffic does not switch to cleartext transport. Preserve explicit target precedence, expression handling, HTTPS behavior, legacy AWF compatibility, and host-only firewall allowlists.ADR: ADR-71680: Preserve HTTP Only for Copilot BYOK Provider Targets
Validation
make fmtpassed.make agent-report-progresspassed build, impacted tests, lint, schema checks, and compilation/drift checks for all 348 workflows.Scope and uncertainty
The emitted-config bug is locally reproduced and fixed. Its socket-level role in the 503 failures from run 40033597616 remains unproven without the full upstream-error payload. No workflow was dispatched and no guard conditions were relaxed. The ADR remains Draft pending human acceptance.