fix: preserve original WorkflowName when following add redirects#31105
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes an add redirect-resolution bug where following workflow redirects caused the local filename to switch to the redirect target’s basename, rather than preserving the name the user originally requested.
Changes:
- Preserve
initialSpec.WorkflowNamewhen returning fromresolveAddWorkflowSpecAndContentafter redirect resolution completes. - Update redirect-resolution unit tests to assert that the original requested workflow name is preserved.
- Regenerate multiple
.github/workflows/*.lock.ymlfiles to propagate new agent outputs/env vars (effective token rate-limit signal, max effective tokens budget) and adjust threat-detection error handling.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/add_workflow_resolution.go | Preserve the originally requested WorkflowName after following redirects. |
| pkg/cli/add_workflow_resolution_redirect_test.go | Update tests to match the corrected redirect/name preservation behavior. |
| .github/workflows/video-analyzer.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/test-workflow.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/test-project-url-default.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/test-dispatcher.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/smoke-opencode.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/smoke-gemini.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/smoke-crush.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/smoke-ci.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/release.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/poem-bot.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/jsweep.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/issue-triage-agent.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/hippo-embed.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/gpclean.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/firewall.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/example-permissions-warning.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/dev.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/daily-malicious-code-scan.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/copilot-token-optimizer.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/codex-github-remote-mcp-test.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/code-simplifier.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/changeset.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/brave.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens, threat detection guard). |
| .github/workflows/bot-detection.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/ai-moderator.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
| .github/workflows/ace-editor.lock.yml | Regenerated lock workflow (effective token outputs/env, maxEffectiveTokens). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 70/219 changed files
- Comments generated: 1
| agentic_engine_timeout: ${{ steps.detect-copilot-errors.outputs.agentic_engine_timeout || 'false' }} | ||
| checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} | ||
| effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }} | ||
| effective_tokens_rate_limit_error: ${{ steps.parse-mcp-gateway.outputs.effective_tokens_rate_limit_error || 'false' }} | ||
| has_patch: ${{ steps.collect_output.outputs.has_patch }} |
|
@copilot review all comments |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
The 217 |
|
@copilot mark tests with a windows tag and add a job in ci.yml to run these windows integration tests n a windows runner |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in the latest commit. The redirect test file now has |
|
@copilot also runs in Linux runners |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
The |
Bug Fix
What was the bug?
gh-aw add githubnext/agentics/workflows/daily-team-status.mdwas creating.github/workflows/team-status.mdinstead ofdaily-team-status.md. WhenresolveAddWorkflowSpecAndContentfollowed a redirect chain, it overwroteWorkflowNamewith the redirect target's basename — so the local filename reflected the destination, not what the user requested.How did you fix it?
Restore
currentSpec.WorkflowName = initialSpec.WorkflowNamebefore returning the resolved spec.WorkflowPathcontinues to reflect the redirect target (used for import resolution and thesourcefrontmatter field); only the local filename is pinned to the original request.Testing
Updated two unit tests in
add_workflow_resolution_redirect_test.gothat were asserting the broken behavior (redirect target name wins). They now assert that the original requested name is preserved.A new
windows-redirect-testsjob was added toci.ymlwith anosmatrix (ubuntu-latest,windows-latest) to runTestResolveAddWorkflowSpecAndContenton both Linux and Windows runners, ensuring redirect resolution behaves correctly cross-platform.