Repository navigation
Add fix codemods for Copilot web-fetch and reserved inputs - #66556
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The migrations can delete compatible settings or unrelated text and leave some compilation failures unresolved.
Review effort: Balanced
Findings: 4
Open (4)
What changed in this PR
Adds gh aw fix migrations for two audited compilation failures while retaining manual guidance for Codex bash restrictions.
Changes:
- Removes unsupported Copilot CLI
web-fetchsettings and reservedaw_contextinputs. - Registers both migrations and adds preservation, idempotence, and strict-compilation tests.
| File | Description |
|---|---|
pkg/cli/fix_codemods.go |
Registers both migrations. |
pkg/cli/fix_codemods_test.go |
Updates registry and ordering expectations. |
pkg/cli/codemod_workflow_dispatch_aw_context.go |
Removes reserved dispatch inputs. |
pkg/cli/codemod_workflow_dispatch_aw_context_test.go |
Tests input removal and compilation. |
pkg/cli/codemod_copilot_web_fetch.go |
Removes unsupported Copilot fetch settings. |
pkg/cli/codemod_copilot_web_fetch_test.go |
Tests removal and compatible configurations. |
| if extractEngineIDFromFrontmatter(frontmatter) != "copilot" { | ||
| return content, false, nil | ||
| } | ||
|
|
||
| _, engineConfig, _ := (&workflow.Compiler{}).ExtractEngineConfig(frontmatter) |
There was a problem hiding this comment.
Resolved the effective engine and SDK settings through ApplyWithContext; when resolution fails, the codemod now preserves tools.web-fetch. Added import/include coverage in daa2f746.
| } | ||
|
|
||
| newContent, applied, err := applyFrontmatterLineTransform(content, func(lines []string) ([]string, bool) { | ||
| result, modified := removeFieldFromBlock(lines, "web-fetch", "tools") |
There was a problem hiding this comment.
Both removals now edit YAML mapping nodes, covering flow maps and quoted keys while retaining siblings. Regression cases were added in daa2f746.
| return lines, false | ||
| } | ||
| dispatchEnd := frontmatterBlockEnd(lines, dispatchLine, len(getIndentation(lines[dispatchLine]))) | ||
| block, modified := removeFieldFromBlock(lines[dispatchLine:dispatchEnd], "aw_context", "inputs") |
There was a problem hiding this comment.
The removals now follow the actual YAML mapping path, so matching text inside block scalars remains untouched. Added literal-text regression tests in daa2f746.
| block, modified := removeFieldFromBlock(lines[dispatchLine:dispatchEnd], "aw_context", "inputs") | ||
| if !modified { | ||
| return lines, false | ||
| } |
There was a problem hiding this comment.
When the reserved input is the only entry, the codemod now leaves inputs: {} and preserves header/surviving comments. Added compiler-valid regression cases in daa2f746.
|
@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: 4b88a27
|
…-codemods Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
@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: 92f6331
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
@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: daa2f74
|
…-codemods Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Merged the latest |
|
🎉 This pull request is included in a new release. Release: |

Compatibility audits found strict-compilation failures from native Copilot
web-fetchsettings and user-declaredworkflow_dispatch.inputs.aw_context. Add automatic fixes for both; Codex bash allow-list restrictions retain their existing guided, manual remediation.tools.web-fetchfor Copilot CLI workflows; preserve it for Copilot SDK mode and other engines.aw_contextfromon.workflow_dispatch.inputs, preserving other inputs and comments.