auto-configure COPILOT_PROVIDER_WIRE_API from model catalog#46156
Conversation
- Add pkg/workflow/data/wire_api_models.json with github-copilot model wire_api mappings (responses/completions), derived from pkg/cli/data/models.json - Add pkg/workflow/copilot_wire_api.go: lookup function + shell case-statement generator for runtime resolution before Copilot CLI launches - Update addCopilotModelEnv: auto-set COPILOT_PROVIDER_WIRE_API=responses in the env block when a static model has wire_api=responses in the catalog - Update buildCopilotAWFPathSetup + buildCopilotDirectCommand: inject the wire_api case-statement into PathSetup so the dynamic (org-variable) model case is also handled at runtime before copilot starts - Remove manual COPILOT_PROVIDER_WIRE_API: responses from smoke-copilot-mai.md since mai-code-1-flash-picker is now auto-configured - Update golden files and recompile all 258 workflow lock files Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot configuration should part of the copilot harness in JavaScript |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
🤖 PR Triage
Rationale: DRAFT — auto-configure COPILOT_PROVIDER_WIRE_API from model catalog. Valuable fix for newer model wire API selection (HTTP 400 on gpt-5-mini etc.) but no CI yet. Defer until undrafted.
|
Done in commit |
|
@copilot merge main and recompile |
|
/smoke-copilot-mai |
|
✅ Smoke Copilot MAI completed successfully! Caution agentic threat detected |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ted-code-config Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in the latest commit — merged main and recompiled all 258 workflows (0 errors). |
|
@copilot apply fix to detection and evals jobs See https://github.com/github/gh-aw/actions/runs/29562782974/job/87829368417#step:17:1 |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…jobs Root cause: GH_AW_MODELS_JSON_PATH is exported in the path setup script pointing to /tmp/gh-aw/models.json (the merged activation-artifact catalog). Detection and evals jobs don't download the activation artifact, so that file doesn't exist. loadModelsJson() used the override path, got ENOENT, returned null, and applyCopilotWireAPI silently returned without setting COPILOT_PROVIDER_WIRE_API. Fix: extract parseModelsJsonFile() helper and have loadModelsJson() fall back to DEFAULT_MODELS_PATH (bundled models.json deployed alongside the module) when GH_AW_MODELS_JSON_PATH is set but the file doesn't exist. The merged catalog is a superset of the bundled one, so wire_api entries are always present in the fallback. Also log when COPILOT_PROVIDER_WIRE_API is already set in applyCopilotWireAPI to make future ambient-override issues diagnosable from CI logs. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in the latest commit. Root cause: Fix ( |
|
/smoke-mai |
|
🚀 skillet has started processing this pull request comment |
There was a problem hiding this comment.
Pull request overview
Automatically selects the Copilot wire API from the model catalog before launch.
Changes:
- Adds runtime wire API resolution and tests.
- Falls back to the bundled model catalog.
- Removes the MAI workaround and recompiles workflows.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/model_costs.test.cjs |
Tests catalog fallback. |
actions/setup/js/model_costs.cjs |
Adds parsing and fallback logic. |
actions/setup/js/copilot_harness.test.cjs |
Tests wire API selection. |
actions/setup/js/copilot_harness.cjs |
Configures the wire API before launch. |
.github/workflows/smoke-copilot-mai.md |
Removes manual configuration. |
.github/workflows/smoke-copilot-mai.lock.yml |
Recompiles the smoke workflow. |
.github/workflows/skillet.lock.yml |
Refreshes generated action metadata. |
.github/workflows/release.lock.yml |
Refreshes generated action metadata. |
.github/workflows/hourly-ci-cleaner.lock.yml |
Refreshes generated action metadata. |
.github/workflows/avenger.lock.yml |
Refreshes generated action metadata. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Medium
| const normalizedModelName = modelName.toLowerCase(); | ||
| for (const [key, value] of Object.entries(models)) { | ||
| if (key.toLowerCase() === normalizedModelName) { |
|
@copilot please run the Unresolved review threads:
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Fixed in the latest commit. |
|
/smoke-copilot-mai |
|
✅ Smoke Copilot MAI completed successfully! |
|
Recent commits focus on refactoring, linting, and threat-detection work, plus workflow/CLI and sandbox/security fixes. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Models like
gpt-5-mini,gpt-5.x, andmai-code-1-flash-pickerrequire the OpenAI Responses API (wire_api: responses); the Copilot CLI defaults tocompletions, causing HTTP 400 failures. Since the model may be resolved from a GitHub org variable at runtime, wire API selection must happen before Copilot CLI launches.Changes
pkg/workflow/data/wire_api_models.json— embedded catalog ofwire_apivalues forgithub-copilotprovider models, extracted frompkg/cli/data/models.jsonpkg/workflow/copilot_wire_api.go— model→wire_api lookup +buildCopilotWireAPIResolutionScript()that generates a shellcasestatement for runtime resolutioncopilot_engine_execution.go:addCopilotModelEnv: auto-setsCOPILOT_PROVIDER_WIRE_API=responsesin the env block for statically-configured models withwire_api: responses; userengine.envoverrides win (applied after)buildCopilotAWFPathSetup/buildCopilotDirectCommand: injects a shell fragment so runtime-resolved models (org variable) also get the correct wire API before Copilot startssmoke-copilot-mai.md: removes manualCOPILOT_PROVIDER_WIRE_API: responses— now auto-configuredRuntime resolution (dynamic model case)
The
[ -z "${COPILOT_PROVIDER_WIRE_API:-}" ]guard ensures explicitengine.envvalues always take precedence. Unknown models (e.g. BYOK custom deployments) are left unset, requiring manual configuration as before.