Align Pi provider wiring with AWF spec and correct provider metadata for multi-provider engines#31758
Merged
Merged
Conversation
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>
Copilot
AI
changed the title
Fix Pi provider integration and multi-provider engine metadata
Align Pi provider wiring with AWF spec and correct provider metadata for multi-provider engines
May 12, 2026
Copilot created this pull request from a session on behalf of
pelikhan
May 12, 2026 17:50
View session
Collaborator
|
@copilot merge main and recompile |
Collaborator
|
@copilot update dev.md to use pi and github provider |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ntic-engine-integration Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the Pi engine/provider wiring with the AWF provider contract, improves compile-time validation for Pi workflows, and corrects built-in engine/provider metadata for provider-agnostic engines (Pi/OpenCode/Crush).
Changes:
- Export
GH_AW_PI_MODEL(original workflow model) for Pi extensions while continuing to pass the CLI model via--model. - Add compile-time validation enforcing Pi’s required tool configuration (
tools.github.mode: gh-proxy,tools.cli-proxy: true). - Normalize metadata so
pi,opencode, andcrushdefault to thegithubprovider and advertise Anthropic/OpenAI/Codex alternative secrets.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/pi_engine.go | Exports GH_AW_PI_MODEL for Pi extensions during execution. |
| pkg/workflow/pi_engine_test.go | Updates coverage to assert GH_AW_PI_MODEL is present and PI_MODEL is not set. |
| pkg/workflow/engine_definition_test.go | Adjusts built-in engine provider expectations for opencode, crush, pi. |
| pkg/workflow/engine_auth_test.go | Updates built-in engine default secret expectations for opencode, crush, pi. |
| pkg/workflow/data/engines/pi.md | Updates Pi engine metadata provider name to github. |
| pkg/workflow/data/engines/opencode.md | Updates OpenCode engine metadata provider name to github. |
| pkg/workflow/data/engines/crush.md | Updates Crush engine metadata provider name to github. |
| pkg/workflow/compiler_orchestrator_tools.go | Hooks Pi-specific tool requirements validation into compilation. |
| pkg/workflow/agent_validation.go | Adds validatePiEngineRequirements enforcing gh-proxy + cli-proxy. |
| pkg/workflow/agent_validation_model_test.go | Adds tests for Pi tool requirements validation behavior. |
| pkg/constants/engine_constants.go | Updates alternative secret metadata for multi-provider engines (incl. Pi). |
| pkg/constants/constants_test.go | Adds regression coverage for multi-provider alternative secrets metadata. |
| actions/setup/js/pi_provider.cjs | Registers providers/aliases from env and prefers GH_AW_PI_MODEL for extension context. |
| actions/setup/js/pi_provider.test.cjs | Adds targeted JS tests for model precedence, provider registration, and logging. |
| .github/workflows/smoke-pi.lock.yml | Updates locked workflow env to include GH_AW_PI_MODEL. |
| .github/workflows/dev.md | Updates workflow frontmatter to inline runtime/provider structure. |
| .github/workflows/dev.lock.yml | Regenerates lockfile to reflect updated model/env wiring. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 17/17 changed files
- Comments generated: 1
| function registerConfiguredProviders(pi, logger) { | ||
| let registeredCount = 0; | ||
|
|
||
| const copilotToken = process.env.COPILOT_GITHUB_TOKEN || process.env.GITHUB_TOKEN; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Fix
The Pi integration was not fully aligned with the AWF provider contract: provider setup lived mostly in execution-time wiring, while the Pi extension itself did not register providers from AWF-injected credentials. In parallel, provider metadata for provider-agnostic engines overstated engine-specific providers instead of reflecting the actual default GitHub-backed routing and supported secret variants.
What was the bug?
github.mode: gh-proxy,cli-proxy: true) were documented but not enforced.pi,opencode, andcrushengine metadata advertised the wrong provider identity and incomplete alternative secret support.How did you fix it?
github-copilot/copilotanthropicopenai/codexGH_AW_PI_MODELso the original workflowengine.modelis available to Pi extensions without changing Pi CLI model selection behavior.tools.github.mode: gh-proxytools.cli-proxy: truepi,opencode, andcrushto the defaultgithubprovider, matching actual default routing behavior.Example
With this change, gh-aw now exposes the configured model to the Pi extension and registers the matching provider from AWF-injected credentials before the agent starts.