Skip to content

feat(safe-outputs): allow model-selected PR reviewers - #2099

Draft
jamesadevine with Copilot wants to merge 5 commits into
mainfrom
copilot/agent-issue-allow-model-selected-reviewers
Draft

feat(safe-outputs): allow model-selected PR reviewers#2099
jamesadevine with Copilot wants to merge 5 commits into
mainfrom
copilot/agent-issue-allow-model-selected-reviewers

Conversation

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Model-selected reviewers need the PR created by the same run, but Azure DevOps assigns its numeric ID only during SafeOutputs execution. Rather than making reviewer selection a special inline field on create-pull-request, this change adds composable temporary PR references:

  • create-pull-request returns and persists a server-generated #aw_... temporary ID.
  • Every update-pr operation accepts either a numeric PR ID or a same-job temporary ID.
  • Temporary references retain the exact organization, project, and repository target, including cross-organization routing.
  • Model-selected reviewers remain an update-pr add-reviewers operation with default-deny allowed-reviewers and a separate max-reviewers limit.
  • Reviewer identities require an unambiguous case-insensitive exact email, account, display-name, or GUID match; fuzzy first-result selection is removed.
  • Reviewer resolution and API failures return structured warnings with added and failed arrays, while policy and reference failures remain hard failures.
  • Static operator-configured create-pull-request.reviewers remain unchanged.
safe-outputs:
  create-pull-request: {}
  update-pr:
    allowed-operations:
      - add-reviewers
    allowed-reviewers:
      - user@example.com
    max-reviewers: 3
    max: 2

Temporary IDs resolve in NDJSON proposal order and only within one SafeOutputs job. Automatic and manually reviewed outputs run in separate jobs and therefore cannot share temporary references.

Test plan

  • Verify create-PR MCP responses return and persist generated temporary IDs.
  • Verify create-PR input excludes internal temporary IDs and inline model reviewer fields.
  • Verify numeric, quoted numeric, and temporary PR reference parsing and routing.
  • Verify exact cross-organization target retention and repository mismatch rejection.
  • Verify default-deny reviewer policy, wildcard opt-in, limits, and deduplication.
  • Verify exact identity matching rejects fuzzy and ambiguous results.
  • Verify partial and total reviewer failures produce structured warnings.
  • Verify ordered executor NDJSON creates a PR, registers its temporary ID, then resolves it in a following update-pr request.
  • Add the same create→update temporary-ID handoff to the deterministic Azure DevOps executor E2E suite.
  • Run cargo test --all-targets.
  • Run cargo clippy --all-targets.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot AI changed the title [WIP] Allow model-selected reviewers in create-pull-request feat(safe-outputs): allow model-selected PR reviewers Sep 3, 2026
Copilot AI requested a review from jamesadevine September 3, 2026 16:44
Use generated temporary PR references so update-pr can safely apply model-selected reviewers and other follow-up operations after PR creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 93d15887-5c0e-4975-98a2-82ca84d35d5f
Exercise ordered create-pull-request and update-pr NDJSON execution through the shared temporary PR registry and mocked Azure DevOps APIs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 93d15887-5c0e-4975-98a2-82ca84d35d5f
Update existing create-pull-request fixtures for the required temporary ID and add a deterministic create-then-update handoff scenario in one executor process.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 93d15887-5c0e-4975-98a2-82ca84d35d5f
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.

[agent-issue]: Allow model-selected reviewers in create-pull-request

2 participants