Handle missing PR-head refs in centralized slash-command dispatch#41835
Closed
Copilot wants to merge 2 commits into
Closed
Handle missing PR-head refs in centralized slash-command dispatch#41835Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
June 27, 2026 03:25
View session
Collaborator
|
@copilot the agentic commands dispatcher code is not properly capturing the pr Number |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
🤖 PR Triage — §28282332784
Rationale: Draft PR with no CI yet. Slash-command dispatch resilience fix (164 additions, 2 files with tests) is meaningful but needs to leave draft status and pass CI before review.
|
This was referenced Jun 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Centralized slash-command routing can fail for PR-originated events when the computed dispatch ref (PR head branch) is not available to
workflow_dispatchin the target repo context. This change makes dispatch resilient by retrying on a safe default branch ref instead of aborting routing.Dispatch fallback for PR ref mismatches
route_slash_command.cjs,dispatchWorkflow(...)now detects422errors with missing-ref semantics ("No ref found for").Fallback ref resolution
resolveDefaultBranchRef(ref)to derive fallback in priority order:context.payload.repository.default_branchrepos.get(...).data.default_branch"main"as final fallbackError classification clarity
isMissingWorkflowDispatchRefError(error)to isolate ref-not-found failures from other422conditions (e.g., disabled workflow), preserving existing behavior for unrelated errors.Regression coverage
route_slash_command.test.cjsfor PR issue-comment routing: