Closed
fix(assign-to-agent): remove invalid requiresOneOf constraint, add GraphQL query logging#40488
Conversation
…ber for triggering target, add GraphQL query logging Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Fix assign-to-agent safe output: allow triggering-context resolution, add GraphQL logging
fix(assign-to-agent): remove invalid requiresOneOf constraint, add GraphQL query logging
Jun 20, 2026
Copilot created this pull request from a session on behalf of
pelikhan
June 20, 2026 17:26
View session
pelikhan
marked this pull request as ready for review
June 20, 2026 17:31
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates the assign_to_agent safe-output contract to allow omitting issue_number/pull_number when the handler can resolve the target from workflow context (target: "triggering"), and improves diagnosability of agent assignment failures by logging the final GraphQL mutation text.
Changes:
- Loosens
assign_to_agentvalidation so calls without explicit target fields can pass when targeting the triggering context. - Adds
core.info()logging for the final and fallback GraphQL mutations used during agent assignment. - Updates docs and tool schemas/samples to reflect the optionality of
issue_number/pull_numberin triggering mode.
Show a summary per file
| File | Description |
|---|---|
schemas/agent-output.json |
Adjusts the JSON schema for assign_to_agent to make issue_number/pull_number optional. |
pkg/workflow/safe_outputs_validation_config.go |
Removes the requiresOneOf validation rule from assign_to_agent in the Go validation config. |
pkg/workflow/js/safe_outputs_tools.json |
Updates tool descriptions to document triggering-context auto-resolution and refines wording/formatting. |
actions/setup/js/safe_outputs_tools.json |
Mirrors the tool description updates for the action-side copy. |
actions/setup/js/safe_output_type_validator.test.cjs |
Updates validator test config and expectations so assign_to_agent without target fields now passes. |
actions/setup/js/assign_agent_helpers.cjs |
Logs the final constructed GraphQL mutation strings for easier debugging from run logs. |
docs/src/content/docs/reference/safe-outputs.md |
Documents that issue_number/pull_number may be omitted in triggering mode. |
.github/aw/safe-outputs-automation.md |
Fixes the default assign-to-agent.target example and clarifies omission behavior in triggering mode. |
pkg/cli/workflows/test-assign-to-agent.md |
Updates the sample workflow task text/examples to show omitting issue_number for triggering issues. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 9/9 changed files
- Comments generated: 2
Comment on lines
929
to
935
| "agent": { | ||
| "type": "string", | ||
| "description": "Agent name or slug (defaults to 'copilot' if not provided)" | ||
| } | ||
| }, | ||
| "required": ["type"], | ||
| "additionalProperties": false |
| github-token: ${{ secrets.SOME_CUSTOM_TOKEN }} # optional custom token for permissions | ||
| ``` | ||
|
|
||
| When using `target: "triggering"` (the default), the agent tool can omit `issue_number` and `pull_number` — the handler auto-resolves the target from the workflow context (the issue or PR that triggered the workflow). Explicitly providing `issue_number` or `pull_number` is required only when using `target: "*"` or a specific number. |
github-actions
Bot
deleted the
copilot/fix-assign-to-agent-safe-output-again
branch
June 28, 2026 03:01
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.
The
assign_to_agentvalidator rejected messages withoutissue_numberorpull_number, breaking triggering-context auto-resolution — agents callingassign_to_agent(agent="copilot")with no explicit target had their output silently blocked before reaching the handler.Validator fix
safe_outputs_validation_config.go: RemovedrequiresOneOf:issue_number,pull_numberfromassign_to_agent. The handler already auto-resolves from workflow context whentarget: "triggering"(the default).schemas/agent-output.json: Replaced theoneOfrequired constraint withrequired: ["type"]—issue_numberandpull_numberare now optional.safe_output_type_validator.test.cjs: Updated config and test —assign_to_agent(agent="copilot")with no target fields must now pass.GraphQL logging
assign_agent_helpers.cjs: Addedcore.info()logging of the final built mutation string (bothreplaceActorsForAssignableand theaddAssigneesToAssignablefallback) to make GraphQL failures diagnosable from run logs withoutACTIONS_STEP_DEBUG.Docs & samples
safe-outputs.md,safe-outputs-automation.md, and the sample workflow thatissue_number/pull_numberare optional whentarget: "triggering"— agents may omit them and the handler resolves the target from context.safe-outputs-automation.mdfrom"*"to"triggering".safe_outputs_tools.json(both copies) field descriptions accordingly.