Add Custom API Endpoint Configuration for Agentic Engines#20730
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@claude[agent] fix the pr title and summary |
Updated PR title to "Add Enterprise Configuration Support for GitHub Copilot Agents" and added a comprehensive description explaining the new enterprise configuration feature, including examples, implementation details, and testing coverage. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@pelikhan can you take a look at the front matter? this will help users configure their api endpoints. |
There was a problem hiding this comment.
Pull request overview
Adds workflow frontmatter support for configuring GitHub Enterprise (GHEC/GHES) endpoints for Copilot-based agentic workflows, wiring the configuration through to AWF and runtime environment variables.
Changes:
- Introduces
engine.enterpriseconfiguration (server-url,copilot-api-target) inEngineConfigand extracts it from frontmatter. - Routes enterprise settings into execution (overriding
GITHUB_SERVER_URL) and AWF args (--copilot-api-targetwhen manually specified). - Extends the JSON schema and adds end-user documentation for enterprise configuration.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/secrets_validation.go | Removes an unused secret-name regex from secrets validation. |
| pkg/workflow/engine.go | Adds EnterpriseConfig and extracts engine.enterprise from frontmatter. |
| pkg/workflow/engine_test.go | Adds unit tests for enterprise config extraction from frontmatter. |
| pkg/workflow/copilot_engine_execution.go | Overrides GITHUB_SERVER_URL when engine.enterprise.server-url is set. |
| pkg/workflow/awf_helpers.go | Adds --copilot-api-target support and enterprise target extraction helper. |
| pkg/parser/schemas/main_workflow_schema.json | Extends schema to validate engine.enterprise configuration. |
| docs/enterprise-configuration.md | Adds a guide for enterprise configuration and expected network allowlists. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
pkg/workflow/awf_helpers.go
Outdated
| // Add Copilot API target for GitHub Enterprise Cloud/Server | ||
| // Priority: engine.enterprise.copilot-api-target > engine.enterprise.server-url (via env var) | ||
| copilotAPITarget := extractCopilotAPITarget(config.WorkflowData) | ||
| if copilotAPITarget != "" { | ||
| awfArgs = append(awfArgs, "--copilot-api-target", copilotAPITarget) | ||
| awfHelpersLog.Printf("Added --copilot-api-target=%s", copilotAPITarget) | ||
| } |
|
does it have to be 3 field? Could it be api-target for any agentic engine? |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@claude[agent] it seems that it would be easier to allow "api-target" for any engine without automatic detection. knowing when something is auto-detected or not will be confusing. also other agentic engines may have api overrides. |
Replace the complex enterprise object (with server-url and copilot-api-target) with a simple api-target field that works for any agentic engine. Changes: - [x] Remove EnterpriseConfig struct and Enterprise field from EngineConfig - [x] Add APITarget string field to EngineConfig for custom API endpoints - [x] Update engine config extraction to parse api-target from frontmatter - [x] Simplify AWF helpers to use engine.api-target directly - [x] Remove GITHUB_SERVER_URL override logic from copilot execution - [x] Update JSON schema to replace enterprise object with api-target string - [x] Update tests: TestAPITargetExtraction replaces TestEnterpriseConfigExtraction - [x] Update documentation: Simplified from automatic detection to manual configuration Benefits: - Works with any agentic engine (Copilot, Claude, Codex, custom) - Simpler frontmatter configuration (one field vs nested object) - No automatic detection complexity or confusion - Clearer user intent - explicit API endpoint specification Example usage: ```yaml engine: id: copilot api-target: api.acme.ghe.com ``` Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@pelikhan i like the simplified version |
Add documentation for the new `api-target` field in engine configuration (introduced in #20730), which allows workflows to target custom API endpoints for GHEC, GHES, and custom AI providers. - engines.md: add api-target to the extended config example, and add a new "Enterprise API Endpoint (api-target)" subsection with GHEC and GHES usage examples - frontmatter-full.md: add api-target field entry in the engine block Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This PR adds simple, intuitive API endpoint configuration support for agentic workflows, enabling seamless integration with GitHub Enterprise Cloud (GHEC), GitHub Enterprise Server (GHES), and custom AI endpoints.
What's New
Simple Frontmatter Configuration
GHEC:
GHES:
Custom AI Endpoints:
Key Features
api-targetfield instead of nested objectsImplementation
APITargetstring field toEngineConfig--copilot-api-targetflag when configuredTesting
Documentation
docs/enterprise-configuration.mdRelated
Based on gh-aw-firewall#1264 which adds enterprise endpoint support to AWF.