Skip to content

fix(workflow): assign Copilot via GraphQL replaceActorsForAssignable#19

Merged
Germey merged 1 commit intomainfrom
fix/sync-copilot-graphql-assign
Apr 25, 2026
Merged

fix(workflow): assign Copilot via GraphQL replaceActorsForAssignable#19
Germey merged 1 commit intomainfrom
fix/sync-copilot-graphql-assign

Conversation

@acedatacloud-dev
Copy link
Copy Markdown
Member

Why

The Sync from Docs workflow has been failing with HTTP 422 every time Docs pushes:

  • The issue-creation request used agent_assignment (not a valid Issues REST field).
  • It also tried to assign copilot-swe-agent[bot] (not a valid assignee login).

GitHub silently swallows invalid bot assignees on the REST endpoint, but the bogus agent_assignment field triggers a hard 422.

What

  • Drop agent_assignment from the create-issue payload.
  • Drop the invalid assignee from the create-issue payload.
  • After creating the issue, look up Copilot's id via GraphQL suggestedActors(capabilities: [CAN_BE_ASSIGNED]), then assign via replaceActorsForAssignable.
  • Use ADMIN_GITHUB_TOKEN (must belong to a user with a Copilot seat) for assignment.

Verification

A local dry run with the admin token successfully:

  • found Copilot in suggestedActors (login copilot-swe-agent),
  • assigned it via the mutation,
  • and the timeline emitted a Copilot connected event indicating the agent session started.

Closes the regression that has blocked auto-sync since April.

The previous Sync from Docs workflow has been failing with HTTP 422 since
it tried to create issues with two invalid REST fields:
  - agent_assignment: {...}  (not a valid Issues API field)
  - assignees: ["copilot-swe-agent[bot]"]  (not a valid assignee login)

This rewrites the issue-creation step to:
  1. Create a plain issue (title/body/labels only)
  2. Look up the Copilot bot id via GraphQL suggestedActors
  3. Assign Copilot via GraphQL replaceActorsForAssignable

ADMIN_GITHUB_TOKEN must belong to a user with a Copilot seat for the
assignment to succeed.
@Germey Germey merged commit 428cfc6 into main Apr 25, 2026
4 checks passed
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.

2 participants