fix: correct assign-to-agent GraphQL mutations per official docs#39941
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Use array notation `[CAN_BE_ASSIGNED]` for `capabilities` param in both `getAvailableAgentLogins` and `findAgent` queries - Add `agentAssignment` to fallback `addAssigneesToAssignable` mutation so agent task context is included when primary mutation is forbidden - Update stale test mocks from `addAssigneesToAssignable` to `replaceActorsForAssignable` (the actual primary mutation) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
fix: correct assign-to-agent GraphQL per official docs
fix: correct assign-to-agent GraphQL mutations per official docs
Jun 18, 2026
Copilot created this pull request from a session on behalf of
pelikhan
June 18, 2026 01:18
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes GitHub Copilot “assign to agent” GraphQL usage in the setup action so assignments succeed against the official API schema and so the fallback mutation supplies agentAssignment context needed for the agent to start.
Changes:
- Fix
suggestedActorsGraphQL argument type by passingcapabilities: [CAN_BE_ASSIGNED](list) instead of a scalar. - Update the forbidden/permission fallback path (
addAssigneesToAssignable) to optionally include anagentAssignmentblock mirroring the primary mutation’s parameters. - Correct test mocks so the success path is exercised by returning
replaceActorsForAssignable.__typename.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/assign_to_agent.test.cjs | Updates GraphQL mock responses to match the primary replaceActorsForAssignable mutation shape. |
| actions/setup/js/assign_agent_helpers.cjs | Aligns GraphQL queries/mutations with the documented schema; adds agentAssignment to the fallback mutation when applicable. |
| actions/setup-cli/install.sh | Updates a header comment (but currently makes it self-referential; see review comment). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
| set +o histexpand | ||
|
|
||
| # Kept in sync with install-gh-aw.sh — edit that file, then copy to this path. | ||
| # Kept in sync with actions/setup-cli/install.sh — edit this file, then copy to that path. |
Collaborator
|
@copilot merge main and recompile |
…-agent-js # Conflicts: # actions/setup-cli/install.sh Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done — merged main and recompiled. Resolved a single conflict in |
This was referenced Jun 18, 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.
Copilot fails to start on assigned issues because the
assign_agent_helpers.cjsGraphQL queries diverged from the official API spec.Bugs fixed
capabilitieslist notation —suggestedActorswas passedcapabilities: CAN_BE_ASSIGNED(scalar) in bothgetAvailableAgentLoginsandfindAgent; the field is a list type and requirescapabilities: [CAN_BE_ASSIGNED]Fallback mutation missing
agentAssignment— whenreplaceActorsForAssignableis forbidden and the code falls back toaddAssigneesToAssignable, theagentAssignmentblock was omitted entirely. Without it Copilot is added as an assignee but receives no task context, producing the "unable to start working" error. The fallback now conditionally buildsagentAssignmentidentically to the primary mutation using the parameters already in scope.Test fixes
11 test mocks were returning
{ addAssigneesToAssignable: ... }as the primary mutation response. Since the primary mutation isreplaceActorsForAssignable,response?.replaceActorsForAssignable?.__typenamesilently returnedundefined— the success path was never exercised. Updated to{ replaceActorsForAssignable: { __typename: "ReplaceActorsForAssignablePayload" } }.