Skip to content

fix: register create_pull_request temporaryId and add synthetic update support#33853

Merged
pelikhan merged 6 commits into
mainfrom
copilot/fix-create-pull-request-silent-failure
May 21, 2026
Merged

fix: register create_pull_request temporaryId and add synthetic update support#33853
pelikhan merged 6 commits into
mainfrom
copilot/fix-create-pull-request-silent-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

create_pull_request temporary IDs were silently dropped — never written to temporary-id-map.json — because create_pull_request.cjs returned snake_case prefixed fields (pull_request_number, temporary_id) while safe_output_handler_manager.cjs registered temp IDs only when result.temporaryId && result.repo && result.number were all truthy. The guard was always false for PR results, making every #aw_prN reference in subsequent safe-output bodies render as literal text.

Return shape fix (create_pull_request.cjs)

Aligned the successful return to match the manager contract:

// Before
return { success: true, pull_request_number: pullRequest.number, pull_request_url: pullRequest.html_url, temporary_id: temporaryId, repo, branch_name };

// After
return { success: true, number: pullRequest.number, url: pullRequest.html_url, temporaryId, repo, branch_name };

Synthetic update support (safe_output_handler_manager.cjs)

  • Added create_pull_request to getContentToCheck so PR bodies containing forward #aw_* refs are tracked.
  • Added updatePullRequestBody (via github.rest.pulls.update) and a create_pull_request case in processSyntheticUpdates so tracked PR bodies are retroactively patched once forward refs resolve.

Tests

  • Updated create_pull_request.test.cjs assertion (pull_request_numbernumber).
  • Updated manager test mock to use the new field names.
  • Added three new tests: temp ID registration from create_pull_request, propagation of resolved IDs to subsequent handlers, and forward-ref tracking.

Copilot AI and others added 2 commits May 21, 2026 20:59
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…e support

- Change create_pull_request.cjs successful return shape to use camelCase
  fields (number, url, temporaryId) matching what safe_output_handler_manager
  expects, fixing the silent discard of temporary_id registrations
- Add create_pull_request to getContentToCheck so PR bodies with forward
  #aw_* refs are tracked for synthetic updates
- Add updatePullRequestBody helper and create_pull_request case in
  processSyntheticUpdates so PR bodies are patched once forward refs resolve
- Update create_pull_request.test.cjs assertion to use result.number
- Update safe_output_handler_manager.test.cjs mock to use new field names
- Add three new tests covering temp ID registration, downstream resolution,
  and forward-ref tracking for create_pull_request

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix safe-output temporary_id registration issue fix: register create_pull_request temporaryId and add synthetic update support May 21, 2026
Copilot AI requested a review from pelikhan May 21, 2026 21:09
@pelikhan pelikhan marked this pull request as ready for review May 21, 2026 21:33
Copilot AI review requested due to automatic review settings May 21, 2026 21:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes create_pull_request temporary ID registration by aligning the handler return shape with the safe-output manager contract, and extends synthetic-update processing so PR bodies that contain forward #aw_* references can be patched once those temporary IDs resolve.

Changes:

  • Updated create_pull_request.cjs to return { number, url, temporaryId, repo } instead of snake_case PR fields.
  • Extended safe_output_handler_manager.cjs to track create_pull_request bodies for unresolved temp IDs and to apply synthetic body updates via github.rest.pulls.update.
  • Updated/added tests to validate temp-ID registration, propagation, and forward-ref tracking; updated workflow lockfiles to exclude additional env vars when invoking awf.
Show a summary per file
File Description
actions/setup/js/safe_output_handler_manager.test.cjs Adds/updates tests for PR temp-id registration, propagation, and forward-ref tracking.
actions/setup/js/safe_output_handler_manager.cjs Tracks PR bodies for unresolved IDs and adds PR body synthetic updates via REST API.
actions/setup/js/create_pull_request.test.cjs Updates assertion to reflect the new create_pull_request return shape.
actions/setup/js/create_pull_request.cjs Aligns successful return fields with manager expectations (number, url, temporaryId).
.github/workflows/smoke-codex.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/smoke-call-workflow.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/schema-feature-coverage.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/necromancer.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/issue-arborist.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/grumpy-reviewer.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/duplicate-code-detector.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/daily-observability-report.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/daily-fact.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/daily-cache-strategy-analyzer.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/codex-github-remote-mcp-test.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/changeset.lock.yml Updates locked workflow command/env exclusions for awf invocation.
.github/workflows/ai-moderator.lock.yml Updates locked workflow command/env exclusions for awf invocation.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 17/17 changed files
  • Comments generated: 2

Comment on lines +1035 to +1036
case "create_pull_request":
return message.body || "";
pull_request_number: pullRequest.number,
pull_request_url: pullRequest.html_url,
number: pullRequest.number,
url: pullRequest.html_url,
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot merge main, recompile, fix conflicts, review all comments

Copilot AI and others added 2 commits May 21, 2026 22:05
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
… number/url fields

- Add managedBody to create_pull_request success return so synthetic updates
  use the actual posted body (with header/footer/caution markers) instead of
  the raw agent-provided message.body
- Update getContentToCheck to prefer result?.managedBody for create_pull_request
- Fix safe_outputs_action_outputs.cjs to read r.number/r.url instead of the
  removed r.pull_request_number/r.pull_request_url fields
- Update tests accordingly
- Merge origin/main (codex --model flag fix + uses: upgrade)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 21, 2026

@copilot merge main, recompile, fix conflicts, review all comments

Done — merged origin/main, resolved the lock-file conflicts (all 13 files), and addressed both review comments:

  1. create_pull_request.cjs:2093safe_outputs_action_outputs.cjs now reads r.number/r.url (matching the new return shape) instead of the removed r.pull_request_number/r.pull_request_url fields. Test updated accordingly.

  2. safe_output_handler_manager.cjs:1035-1036create_pull_request.cjs now returns managedBody: body (the actual body posted to GitHub, including header/footer/caution markers). getContentToCheck for create_pull_request now uses result?.managedBody || message.body || "", so synthetic updates patch the managed body rather than clobbering it with raw agent text.

All 307 test files (9 157 tests) pass.

@pelikhan pelikhan merged commit e13b1c6 into main May 21, 2026
7 checks passed
@pelikhan pelikhan deleted the copilot/fix-create-pull-request-silent-failure branch May 21, 2026 22:26
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.

create_pull_request safe-output never registers temporary_id#aw_prN references silently break

3 participants