Skip to content

fix: preserve original WorkflowName when following add redirects#31105

Merged
pelikhan merged 5 commits into
mainfrom
copilot/update-action-run-logging
May 9, 2026
Merged

fix: preserve original WorkflowName when following add redirects#31105
pelikhan merged 5 commits into
mainfrom
copilot/update-action-run-logging

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

Bug Fix

What was the bug?

gh-aw add githubnext/agentics/workflows/daily-team-status.md was creating .github/workflows/team-status.md instead of daily-team-status.md. When resolveAddWorkflowSpecAndContent followed a redirect chain, it overwrote WorkflowName with 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.WorkflowName before returning the resolved spec. WorkflowPath continues to reflect the redirect target (used for import resolution and the source frontmatter field); only the local filename is pinned to the original request.

// Before
if redirect == "" {
    return &currentSpec, fetched, nil  // WorkflowName = redirect target's name
}

// After
if redirect == "" {
    currentSpec.WorkflowName = initialSpec.WorkflowName  // preserve what the user asked for
    return &currentSpec, fetched, nil
}

Testing

Updated two unit tests in add_workflow_resolution_redirect_test.go that were asserting the broken behavior (redirect target name wins). They now assert that the original requested name is preserved.

A new windows-redirect-tests job was added to ci.yml with an os matrix (ubuntu-latest, windows-latest) to run TestResolveAddWorkflowSpecAndContent on both Linux and Windows runners, ensuring redirect resolution behaves correctly cross-platform.

Copilot AI and others added 2 commits May 8, 2026 23:59
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan May 9, 2026 00:02
@pelikhan pelikhan marked this pull request as ready for review May 9, 2026 00:03
Copilot AI review requested due to automatic review settings May 9, 2026 00:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.WorkflowName when returning from resolveAddWorkflowSpecAndContent after redirect resolution completes.
  • Update redirect-resolution unit tests to assert that the original requested workflow name is preserved.
  • Regenerate multiple .github/workflows/*.lock.yml files 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

Comment on lines 345 to 349
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 }}
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented May 9, 2026

@copilot review all comments

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@copilot review all comments

The 217 .lock.yml files that were unintentionally included in the earlier commits have been reverted in 6e04e4f. The PR now only contains the two source file changes relevant to the bug fix.

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented May 9, 2026

@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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@copilot mark tests with a windows tag and add a job in ci.yml to run these windows integration tests n a windows runner

Done in the latest commit. The redirect test file now has //go:build !integration && windows so it's automatically included on Windows runners (GOOS=windows) and excluded from Linux unit test runs. A new windows-redirect-tests job was added to ci.yml that runs go test -v -run TestResolveAddWorkflowSpecAndContent ./pkg/cli/... on windows-latest.

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented May 9, 2026

@copilot also runs in Linux runners

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@copilot also runs in Linux runners

The windows build tag has been removed from the test file (back to //go:build !integration), so the tests run on all platforms. The CI job now uses an os matrix (ubuntu-latest, windows-latest) to cover both.

@pelikhan pelikhan merged commit 9544666 into main May 9, 2026
@pelikhan pelikhan deleted the copilot/update-action-run-logging branch May 9, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants