fix: resolve assign-to-agent key mismatch (name vs default-agent)#17396
fix: resolve assign-to-agent key mismatch (name vs default-agent)#17396
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add codemod to change syntax |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| "$ref": "#/$defs/github_token", | ||
| "description": "GitHub token to use for this specific output type. Overrides global github-token if specified." | ||
| }, | ||
| "default-agent": { |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pkg/workflow/assign_to_agent.go
Outdated
| return &AssignToAgentConfig{} | ||
| } | ||
|
|
||
| // Handle deprecated 'default-agent' key: if 'name' was not set but 'default-agent' is present in the raw map, use its value and emit a deprecation warning |
There was a problem hiding this comment.
@copilot no support for deprecated field, it is removed from schema
There was a problem hiding this comment.
Removed in 8f7b65e. The deprecated alias handling code and its tests are gone — only the canonical name key is now supported at runtime.
…nt.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Aligns assign-to-agent configuration across TypeScript types, JSON schema, and Go parsing by standardizing on the canonical name key (removing the previously-advertised default-agent key), and adds an automatic codemod to migrate existing workflows.
Changes:
- Updated the TypeScript
.d.tssurface forAssignToAgentConfigto usenameand include previously missing fields. - Updated validation/parsing to drop support for
default-agentand rely onnameonly. - Added and registered a
gh aw fixcodemod (with tests) to migratedefault-agent→namein workflow frontmatter.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/types/safe-outputs-config.d.ts | Makes TS config type match canonical name key and completes the assign-to-agent config surface. |
| pkg/parser/schemas/main_workflow_schema.json | Removes default-agent from schema and ensures assign-to-agent validates against name. |
| pkg/workflow/assign_to_agent.go | Enforces canonical name parsing at runtime (no alias). |
| pkg/workflow/assign_to_agent_test.go | Adds a parsing test asserting name works for assign-to-agent. |
| pkg/cli/codemod_assign_to_agent.go | Implements a codemod to migrate default-agent → name within safe-outputs.assign-to-agent. |
| pkg/cli/codemod_assign_to_agent_test.go | Adds coverage for migration, preservation behavior, and no-op/skip scenarios. |
| pkg/cli/fix_codemods.go | Registers the new codemod in the global codemod list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ent codemod Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in aafba21. Updated |
actions/setup/js/types/safe-outputs-config.d.ts: replace"default-agent"withnameand add missing fieldspkg/workflow/assign_to_agent.go: removed deprecateddefault-agentalias support (field removed from schema)pkg/parser/schemas/main_workflow_schema.json: removeddefault-agentdeprecated propertypkg/workflow/assign_to_agent_test.go: removed deprecated alias tests, kept canonicalnametestpkg/cli/codemod_assign_to_agent.go: codemod to renamedefault-agent→nameviagh aw fixpkg/cli/codemod_assign_to_agent_test.go: codemod testspkg/cli/fix_codemods.gopkg/cli/fix_codemods_test.go: update expected codemod count (21→22) and add new codemod to order listOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.