Skip to content

Fix assign_to_agent validation to support both issue_number and pull_number#10270

Merged
mnkiefer merged 3 commits intomainfrom
copilot/fix-campaign-generator-error
Jan 16, 2026
Merged

Fix assign_to_agent validation to support both issue_number and pull_number#10270
mnkiefer merged 3 commits intomainfrom
copilot/fix-campaign-generator-error

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

The assign_to_agent safe output validation required issue_number as mandatory, but the handler accepts either issue_number OR pull_number for assigning agents to issues or pull requests. This mismatch caused validation failures when attempting to assign agents to PRs.

Changes

Validation config (pkg/workflow/safe_output_validation_config.go):

  • Changed issue_number from required to optional (OptionalPositiveInteger)
  • Added pull_number field as optional (OptionalPositiveInteger)
  • Added CustomValidation: "requiresOneOf:issue_number,pull_number" to enforce exactly-one semantics

Test config (pkg/workflow/safe_output_validation_config_test.go):

  • Added "requiresOneOf:issue_number,pull_number" to valid custom validation rules

JavaScript validator tests (actions/setup/js/safe_output_type_validator.test.cjs):

  • Added test coverage for all three validation states: issue_number only (✓), pull_number only (✓), neither (✗)

Example

# Both are now valid:
- type: assign_to_agent
  issue_number: 123
  agent: copilot

- type: assign_to_agent
  pull_number: 456
  agent: copilot

# This correctly fails validation:
- type: assign_to_agent
  agent: copilot  # Error: requires at least one of 'issue_number', 'pull_number'

The validation now matches the handler's actual behavior, preventing false negatives while maintaining safety guarantees.

Original prompt

Fix error in latest campaign generator run safe output (assign-to-agent):
https://github.com/githubnext/gh-aw/actions/runs/21065370327/job/60581785114
Do not call update_issue with empty payloads—always supply at least one valid field (body, title, or status).
Do not call assign_to_agent without specifying issue_number or pull_number.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 16, 2026 12:02
…number

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
…umber

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer marked this pull request as ready for review January 16, 2026 12:11
Copilot AI changed the title [WIP] Fix error in campaign generator run safe output Fix assign_to_agent validation to support both issue_number and pull_number Jan 16, 2026
Copilot AI requested a review from mnkiefer January 16, 2026 12:15
@mnkiefer mnkiefer merged commit 9b5e756 into main Jan 16, 2026
115 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-campaign-generator-error branch January 16, 2026 12:20
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